Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License").
   * You may not use this file except in compliance with the License.
   * A copy of the License is located at
   * 
   *  http://aws.amazon.com/apache2.0
   * 
  * or in the "license" file accompanying this file. This file is distributed
  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  * express or implied. See the License for the specific language governing
  * permissions and limitations under the License.
  */
 package com.amazonaws.services.ec2.model;
 

Describes the maximum hourly price (bid) for any Spot Instance launched to fulfill the request.

 
 public class SpotPrice implements SerializableCloneable {

    
The instance type.

Constraints:
Allowed Values: t1.micro, m1.small, m1.medium, m1.large, m1.xlarge, m3.medium, m3.large, m3.xlarge, m3.2xlarge, t2.micro, t2.small, t2.medium, m2.xlarge, m2.2xlarge, m2.4xlarge, cr1.8xlarge, i2.xlarge, i2.2xlarge, i2.4xlarge, i2.8xlarge, hi1.4xlarge, hs1.8xlarge, c1.medium, c1.xlarge, c3.large, c3.xlarge, c3.2xlarge, c3.4xlarge, c3.8xlarge, c4.large, c4.xlarge, c4.2xlarge, c4.4xlarge, c4.8xlarge, cc1.4xlarge, cc2.8xlarge, g2.2xlarge, cg1.4xlarge, r3.large, r3.xlarge, r3.2xlarge, r3.4xlarge, r3.8xlarge, d2.xlarge, d2.2xlarge, d2.4xlarge, d2.8xlarge

 
     private String instanceType;

    
A general description of the AMI.

Constraints:
Allowed Values: Linux/UNIX, Linux/UNIX (Amazon VPC), Windows, Windows (Amazon VPC)

 
     private String productDescription;

    
The maximum price (bid) that you are willing to pay for a Spot Instance.
 
     private String spotPrice;

    
The date and time the request was created, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ).
 
     private java.util.Date timestamp;

    
The Availability Zone.
 
     private String availabilityZone;

    
The instance type.

Constraints:
Allowed Values: t1.micro, m1.small, m1.medium, m1.large, m1.xlarge, m3.medium, m3.large, m3.xlarge, m3.2xlarge, t2.micro, t2.small, t2.medium, m2.xlarge, m2.2xlarge, m2.4xlarge, cr1.8xlarge, i2.xlarge, i2.2xlarge, i2.4xlarge, i2.8xlarge, hi1.4xlarge, hs1.8xlarge, c1.medium, c1.xlarge, c3.large, c3.xlarge, c3.2xlarge, c3.4xlarge, c3.8xlarge, c4.large, c4.xlarge, c4.2xlarge, c4.4xlarge, c4.8xlarge, cc1.4xlarge, cc2.8xlarge, g2.2xlarge, cg1.4xlarge, r3.large, r3.xlarge, r3.2xlarge, r3.4xlarge, r3.8xlarge, d2.xlarge, d2.2xlarge, d2.4xlarge, d2.8xlarge

Returns:
The instance type.
See also:
InstanceType
 
     public String getInstanceType() {
         return ;
     }
    
    
The instance type.

Constraints:
Allowed Values: t1.micro, m1.small, m1.medium, m1.large, m1.xlarge, m3.medium, m3.large, m3.xlarge, m3.2xlarge, t2.micro, t2.small, t2.medium, m2.xlarge, m2.2xlarge, m2.4xlarge, cr1.8xlarge, i2.xlarge, i2.2xlarge, i2.4xlarge, i2.8xlarge, hi1.4xlarge, hs1.8xlarge, c1.medium, c1.xlarge, c3.large, c3.xlarge, c3.2xlarge, c3.4xlarge, c3.8xlarge, c4.large, c4.xlarge, c4.2xlarge, c4.4xlarge, c4.8xlarge, cc1.4xlarge, cc2.8xlarge, g2.2xlarge, cg1.4xlarge, r3.large, r3.xlarge, r3.2xlarge, r3.4xlarge, r3.8xlarge, d2.xlarge, d2.2xlarge, d2.4xlarge, d2.8xlarge

Parameters:
instanceType The instance type.
See also:
InstanceType
 
     public void setInstanceType(String instanceType) {
         this. = instanceType;
     }
    
    
The instance type.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: t1.micro, m1.small, m1.medium, m1.large, m1.xlarge, m3.medium, m3.large, m3.xlarge, m3.2xlarge, t2.micro, t2.small, t2.medium, m2.xlarge, m2.2xlarge, m2.4xlarge, cr1.8xlarge, i2.xlarge, i2.2xlarge, i2.4xlarge, i2.8xlarge, hi1.4xlarge, hs1.8xlarge, c1.medium, c1.xlarge, c3.large, c3.xlarge, c3.2xlarge, c3.4xlarge, c3.8xlarge, c4.large, c4.xlarge, c4.2xlarge, c4.4xlarge, c4.8xlarge, cc1.4xlarge, cc2.8xlarge, g2.2xlarge, cg1.4xlarge, r3.large, r3.xlarge, r3.2xlarge, r3.4xlarge, r3.8xlarge, d2.xlarge, d2.2xlarge, d2.4xlarge, d2.8xlarge

Parameters:
instanceType The instance type.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
InstanceType
    public SpotPrice withInstanceType(String instanceType) {
        this. = instanceType;
        return this;
    }

    
The instance type.

Constraints:
Allowed Values: t1.micro, m1.small, m1.medium, m1.large, m1.xlarge, m3.medium, m3.large, m3.xlarge, m3.2xlarge, t2.micro, t2.small, t2.medium, m2.xlarge, m2.2xlarge, m2.4xlarge, cr1.8xlarge, i2.xlarge, i2.2xlarge, i2.4xlarge, i2.8xlarge, hi1.4xlarge, hs1.8xlarge, c1.medium, c1.xlarge, c3.large, c3.xlarge, c3.2xlarge, c3.4xlarge, c3.8xlarge, c4.large, c4.xlarge, c4.2xlarge, c4.4xlarge, c4.8xlarge, cc1.4xlarge, cc2.8xlarge, g2.2xlarge, cg1.4xlarge, r3.large, r3.xlarge, r3.2xlarge, r3.4xlarge, r3.8xlarge, d2.xlarge, d2.2xlarge, d2.4xlarge, d2.8xlarge

Parameters:
instanceType The instance type.
See also:
InstanceType
    public void setInstanceType(InstanceType instanceType) {
        this. = instanceType.toString();
    }
    
    
The instance type.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: t1.micro, m1.small, m1.medium, m1.large, m1.xlarge, m3.medium, m3.large, m3.xlarge, m3.2xlarge, t2.micro, t2.small, t2.medium, m2.xlarge, m2.2xlarge, m2.4xlarge, cr1.8xlarge, i2.xlarge, i2.2xlarge, i2.4xlarge, i2.8xlarge, hi1.4xlarge, hs1.8xlarge, c1.medium, c1.xlarge, c3.large, c3.xlarge, c3.2xlarge, c3.4xlarge, c3.8xlarge, c4.large, c4.xlarge, c4.2xlarge, c4.4xlarge, c4.8xlarge, cc1.4xlarge, cc2.8xlarge, g2.2xlarge, cg1.4xlarge, r3.large, r3.xlarge, r3.2xlarge, r3.4xlarge, r3.8xlarge, d2.xlarge, d2.2xlarge, d2.4xlarge, d2.8xlarge

Parameters:
instanceType The instance type.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
InstanceType
    public SpotPrice withInstanceType(InstanceType instanceType) {
        this. = instanceType.toString();
        return this;
    }

    
A general description of the AMI.

Constraints:
Allowed Values: Linux/UNIX, Linux/UNIX (Amazon VPC), Windows, Windows (Amazon VPC)

Returns:
A general description of the AMI.
See also:
RIProductDescription
    public String getProductDescription() {
        return ;
    }
    
    
A general description of the AMI.

Constraints:
Allowed Values: Linux/UNIX, Linux/UNIX (Amazon VPC), Windows, Windows (Amazon VPC)

Parameters:
productDescription A general description of the AMI.
See also:
RIProductDescription
    public void setProductDescription(String productDescription) {
        this. = productDescription;
    }
    
    
A general description of the AMI.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: Linux/UNIX, Linux/UNIX (Amazon VPC), Windows, Windows (Amazon VPC)

Parameters:
productDescription A general description of the AMI.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
RIProductDescription
    public SpotPrice withProductDescription(String productDescription) {
        this. = productDescription;
        return this;
    }

    
A general description of the AMI.

Constraints:
Allowed Values: Linux/UNIX, Linux/UNIX (Amazon VPC), Windows, Windows (Amazon VPC)

Parameters:
productDescription A general description of the AMI.
See also:
RIProductDescription
    public void setProductDescription(RIProductDescription productDescription) {
        this. = productDescription.toString();
    }
    
    
A general description of the AMI.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: Linux/UNIX, Linux/UNIX (Amazon VPC), Windows, Windows (Amazon VPC)

Parameters:
productDescription A general description of the AMI.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
RIProductDescription
    public SpotPrice withProductDescription(RIProductDescription productDescription) {
        this. = productDescription.toString();
        return this;
    }

    
The maximum price (bid) that you are willing to pay for a Spot Instance.

Returns:
The maximum price (bid) that you are willing to pay for a Spot Instance.
    public String getSpotPrice() {
        return ;
    }
    
    
The maximum price (bid) that you are willing to pay for a Spot Instance.

Parameters:
spotPrice The maximum price (bid) that you are willing to pay for a Spot Instance.
    public void setSpotPrice(String spotPrice) {
        this. = spotPrice;
    }
    
    
The maximum price (bid) that you are willing to pay for a Spot Instance.

Returns a reference to this object so that method calls can be chained together.

Parameters:
spotPrice The maximum price (bid) that you are willing to pay for a Spot Instance.
Returns:
A reference to this updated object so that method calls can be chained together.
    public SpotPrice withSpotPrice(String spotPrice) {
        this. = spotPrice;
        return this;
    }

    
The date and time the request was created, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ).

Returns:
The date and time the request was created, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ).
    public java.util.Date getTimestamp() {
        return ;
    }
    
    
The date and time the request was created, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ).

Parameters:
timestamp The date and time the request was created, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ).
    public void setTimestamp(java.util.Date timestamp) {
        this. = timestamp;
    }
    
    
The date and time the request was created, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ).

Returns a reference to this object so that method calls can be chained together.

Parameters:
timestamp The date and time the request was created, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ).
Returns:
A reference to this updated object so that method calls can be chained together.
    public SpotPrice withTimestamp(java.util.Date timestamp) {
        this. = timestamp;
        return this;
    }

    
The Availability Zone.

Returns:
The Availability Zone.
    public String getAvailabilityZone() {
        return ;
    }
    
    
The Availability Zone.

Parameters:
availabilityZone The Availability Zone.
    public void setAvailabilityZone(String availabilityZone) {
        this. = availabilityZone;
    }
    
    
The Availability Zone.

Returns a reference to this object so that method calls can be chained together.

Parameters:
availabilityZone The Availability Zone.
Returns:
A reference to this updated object so that method calls can be chained together.
    public SpotPrice withAvailabilityZone(String availabilityZone) {
        this. = availabilityZone;
        return this;
    }

    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getInstanceType() != nullsb.append("InstanceType: " + getInstanceType() + ",");
        if (getProductDescription() != nullsb.append("ProductDescription: " + getProductDescription() + ",");
        if (getSpotPrice() != nullsb.append("SpotPrice: " + getSpotPrice() + ",");
        if (getTimestamp() != nullsb.append("Timestamp: " + getTimestamp() + ",");
        if (getAvailabilityZone() != nullsb.append("AvailabilityZone: " + getAvailabilityZone() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getInstanceType() == null) ? 0 : getInstanceType().hashCode()); 
        hashCode = prime * hashCode + ((getProductDescription() == null) ? 0 : getProductDescription().hashCode()); 
        hashCode = prime * hashCode + ((getSpotPrice() == null) ? 0 : getSpotPrice().hashCode()); 
        hashCode = prime * hashCode + ((getTimestamp() == null) ? 0 : getTimestamp().hashCode()); 
        hashCode = prime * hashCode + ((getAvailabilityZone() == null) ? 0 : getAvailabilityZone().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof SpotPrice == falsereturn false;
        SpotPrice other = (SpotPrice)obj;
        
        if (other.getInstanceType() == null ^ this.getInstanceType() == nullreturn false;
        if (other.getInstanceType() != null && other.getInstanceType().equals(this.getInstanceType()) == falsereturn false
        if (other.getProductDescription() == null ^ this.getProductDescription() == nullreturn false;
        if (other.getProductDescription() != null && other.getProductDescription().equals(this.getProductDescription()) == falsereturn false
        if (other.getSpotPrice() == null ^ this.getSpotPrice() == nullreturn false;
        if (other.getSpotPrice() != null && other.getSpotPrice().equals(this.getSpotPrice()) == falsereturn false
        if (other.getTimestamp() == null ^ this.getTimestamp() == nullreturn false;
        if (other.getTimestamp() != null && other.getTimestamp().equals(this.getTimestamp()) == falsereturn false
        if (other.getAvailabilityZone() == null ^ this.getAvailabilityZone() == nullreturn false;
        if (other.getAvailabilityZone() != null && other.getAvailabilityZone().equals(this.getAvailabilityZone()) == falsereturn false
        return true;
    }
    
    @Override
    public SpotPrice clone() {
        try {
            return (SpotPricesuper.clone();
        
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException(
                    "Got a CloneNotSupportedException from Object.clone() "
                    + "even though we're Cloneable!",
                    e);
        }
        
    }
}
    
New to GrepCode? Check out our FAQ X