All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazonaws.services.ec2.model.SpotPrice Maven / Gradle / Ivy

Go to download

The AWS SDK for Java with support for OSGi. The AWS SDK for Java provides Java APIs for building software on AWS' cost-effective, scalable, and reliable infrastructure products. The AWS Java SDK allows developers to code against APIs for all of Amazon's infrastructure web services (Amazon S3, Amazon EC2, Amazon SQS, Amazon Relational Database Service, Amazon AutoScaling, etc).

There is a newer version: 1.11.60
Show newest version
/*
 * Copyright 2011-2016 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;

import java.io.Serializable;

/**
 * 

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

*/ public class SpotPrice implements Serializable, Cloneable { /** *

* The instance type. *

*/ private String instanceType; /** *

* A general description of the AMI. *

*/ 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. *

* * @param instanceType * The instance type. * @see InstanceType */ public void setInstanceType(String instanceType) { this.instanceType = instanceType; } /** *

* The instance type. *

* * @return The instance type. * @see InstanceType */ public String getInstanceType() { return this.instanceType; } /** *

* The instance type. *

* * @param instanceType * The instance type. * @return Returns a reference to this object so that method calls can be * chained together. * @see InstanceType */ public SpotPrice withInstanceType(String instanceType) { setInstanceType(instanceType); return this; } /** *

* The instance type. *

* * @param instanceType * The instance type. * @see InstanceType */ public void setInstanceType(InstanceType instanceType) { this.instanceType = instanceType.toString(); } /** *

* The instance type. *

* * @param instanceType * The instance type. * @return Returns a reference to this object so that method calls can be * chained together. * @see InstanceType */ public SpotPrice withInstanceType(InstanceType instanceType) { setInstanceType(instanceType); return this; } /** *

* A general description of the AMI. *

* * @param productDescription * A general description of the AMI. * @see RIProductDescription */ public void setProductDescription(String productDescription) { this.productDescription = productDescription; } /** *

* A general description of the AMI. *

* * @return A general description of the AMI. * @see RIProductDescription */ public String getProductDescription() { return this.productDescription; } /** *

* A general description of the AMI. *

* * @param productDescription * A general description of the AMI. * @return Returns a reference to this object so that method calls can be * chained together. * @see RIProductDescription */ public SpotPrice withProductDescription(String productDescription) { setProductDescription(productDescription); return this; } /** *

* A general description of the AMI. *

* * @param productDescription * A general description of the AMI. * @see RIProductDescription */ public void setProductDescription(RIProductDescription productDescription) { this.productDescription = productDescription.toString(); } /** *

* A general description of the AMI. *

* * @param productDescription * A general description of the AMI. * @return Returns a reference to this object so that method calls can be * chained together. * @see RIProductDescription */ public SpotPrice withProductDescription( RIProductDescription productDescription) { setProductDescription(productDescription); return this; } /** *

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

* * @param spotPrice * The maximum price (bid) that you are willing to pay for a Spot * instance. */ public void setSpotPrice(String spotPrice) { this.spotPrice = spotPrice; } /** *

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

* * @return The maximum price (bid) that you are willing to pay for a Spot * instance. */ public String getSpotPrice() { return this.spotPrice; } /** *

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

* * @param spotPrice * The maximum price (bid) that you are willing to pay for a Spot * instance. * @return Returns a reference to this object so that method calls can be * chained together. */ public SpotPrice withSpotPrice(String spotPrice) { setSpotPrice(spotPrice); return this; } /** *

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

* * @param 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 = timestamp; } /** *

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

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

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

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

* The Availability Zone. *

* * @param availabilityZone * The Availability Zone. */ public void setAvailabilityZone(String availabilityZone) { this.availabilityZone = availabilityZone; } /** *

* The Availability Zone. *

* * @return The Availability Zone. */ public String getAvailabilityZone() { return this.availabilityZone; } /** *

* The Availability Zone. *

* * @param availabilityZone * The Availability Zone. * @return Returns a reference to this object so that method calls can be * chained together. */ public SpotPrice withAvailabilityZone(String availabilityZone) { setAvailabilityZone(availabilityZone); return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getInstanceType() != null) sb.append("InstanceType: " + getInstanceType() + ","); if (getProductDescription() != null) sb.append("ProductDescription: " + getProductDescription() + ","); if (getSpotPrice() != null) sb.append("SpotPrice: " + getSpotPrice() + ","); if (getTimestamp() != null) sb.append("Timestamp: " + getTimestamp() + ","); if (getAvailabilityZone() != null) sb.append("AvailabilityZone: " + getAvailabilityZone()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof SpotPrice == false) return false; SpotPrice other = (SpotPrice) obj; if (other.getInstanceType() == null ^ this.getInstanceType() == null) return false; if (other.getInstanceType() != null && other.getInstanceType().equals(this.getInstanceType()) == false) return false; if (other.getProductDescription() == null ^ this.getProductDescription() == null) return false; if (other.getProductDescription() != null && other.getProductDescription().equals( this.getProductDescription()) == false) return false; if (other.getSpotPrice() == null ^ this.getSpotPrice() == null) return false; if (other.getSpotPrice() != null && other.getSpotPrice().equals(this.getSpotPrice()) == false) return false; if (other.getTimestamp() == null ^ this.getTimestamp() == null) return false; if (other.getTimestamp() != null && other.getTimestamp().equals(this.getTimestamp()) == false) return false; if (other.getAvailabilityZone() == null ^ this.getAvailabilityZone() == null) return false; if (other.getAvailabilityZone() != null && other.getAvailabilityZone().equals( this.getAvailabilityZone()) == false) return false; return true; } @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 SpotPrice clone() { try { return (SpotPrice) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException( "Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy