com.amazonaws.services.ec2.model.SpotPrice Maven / Gradle / Ivy
Show all versions of aws-java-sdk-ec2 Show documentation
/*
* Copyright 2016-2021 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;
import javax.annotation.Generated;
/**
*
* Describes the maximum price per hour that you are willing to pay for a Spot Instance.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class SpotPrice implements Serializable, Cloneable {
/**
*
* The Availability Zone.
*
*/
private String availabilityZone;
/**
*
* The instance type.
*
*/
private String instanceType;
/**
*
* A general description of the AMI.
*
*/
private String productDescription;
/**
*
* The maximum price per hour 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.
*
*
* @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;
}
/**
*
* 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) {
withInstanceType(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(InstanceType instanceType) {
this.instanceType = instanceType.toString();
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) {
withProductDescription(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(RIProductDescription productDescription) {
this.productDescription = productDescription.toString();
return this;
}
/**
*
* The maximum price per hour that you are willing to pay for a Spot Instance.
*
*
* @param spotPrice
* The maximum price per hour that you are willing to pay for a Spot Instance.
*/
public void setSpotPrice(String spotPrice) {
this.spotPrice = spotPrice;
}
/**
*
* The maximum price per hour that you are willing to pay for a Spot Instance.
*
*
* @return The maximum price per hour that you are willing to pay for a Spot Instance.
*/
public String getSpotPrice() {
return this.spotPrice;
}
/**
*
* The maximum price per hour that you are willing to pay for a Spot Instance.
*
*
* @param spotPrice
* The maximum price per hour 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;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getAvailabilityZone() != null)
sb.append("AvailabilityZone: ").append(getAvailabilityZone()).append(",");
if (getInstanceType() != null)
sb.append("InstanceType: ").append(getInstanceType()).append(",");
if (getProductDescription() != null)
sb.append("ProductDescription: ").append(getProductDescription()).append(",");
if (getSpotPrice() != null)
sb.append("SpotPrice: ").append(getSpotPrice()).append(",");
if (getTimestamp() != null)
sb.append("Timestamp: ").append(getTimestamp());
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.getAvailabilityZone() == null ^ this.getAvailabilityZone() == null)
return false;
if (other.getAvailabilityZone() != null && other.getAvailabilityZone().equals(this.getAvailabilityZone()) == false)
return false;
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;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAvailabilityZone() == null) ? 0 : getAvailabilityZone().hashCode());
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());
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);
}
}
}