com.amazonaws.services.ec2.model.ScheduledInstance Maven / Gradle / Ivy
Show all versions of aws-java-sdk-ec2 Show documentation
/*
* Copyright 2019-2024 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 a Scheduled Instance.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ScheduledInstance implements Serializable, Cloneable {
/**
*
* The Availability Zone.
*
*/
private String availabilityZone;
/**
*
* The date when the Scheduled Instance was purchased.
*
*/
private java.util.Date createDate;
/**
*
* The hourly price for a single instance.
*
*/
private String hourlyPrice;
/**
*
* The number of instances.
*
*/
private Integer instanceCount;
/**
*
* The instance type.
*
*/
private String instanceType;
/**
*
* The network platform.
*
*/
private String networkPlatform;
/**
*
* The time for the next schedule to start.
*
*/
private java.util.Date nextSlotStartTime;
/**
*
* The platform (Linux/UNIX
or Windows
).
*
*/
private String platform;
/**
*
* The time that the previous schedule ended or will end.
*
*/
private java.util.Date previousSlotEndTime;
/**
*
* The schedule recurrence.
*
*/
private ScheduledInstanceRecurrence recurrence;
/**
*
* The Scheduled Instance ID.
*
*/
private String scheduledInstanceId;
/**
*
* The number of hours in the schedule.
*
*/
private Integer slotDurationInHours;
/**
*
* The end date for the Scheduled Instance.
*
*/
private java.util.Date termEndDate;
/**
*
* The start date for the Scheduled Instance.
*
*/
private java.util.Date termStartDate;
/**
*
* The total number of hours for a single instance for the entire term.
*
*/
private Integer totalScheduledInstanceHours;
/**
*
* 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 ScheduledInstance withAvailabilityZone(String availabilityZone) {
setAvailabilityZone(availabilityZone);
return this;
}
/**
*
* The date when the Scheduled Instance was purchased.
*
*
* @param createDate
* The date when the Scheduled Instance was purchased.
*/
public void setCreateDate(java.util.Date createDate) {
this.createDate = createDate;
}
/**
*
* The date when the Scheduled Instance was purchased.
*
*
* @return The date when the Scheduled Instance was purchased.
*/
public java.util.Date getCreateDate() {
return this.createDate;
}
/**
*
* The date when the Scheduled Instance was purchased.
*
*
* @param createDate
* The date when the Scheduled Instance was purchased.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ScheduledInstance withCreateDate(java.util.Date createDate) {
setCreateDate(createDate);
return this;
}
/**
*
* The hourly price for a single instance.
*
*
* @param hourlyPrice
* The hourly price for a single instance.
*/
public void setHourlyPrice(String hourlyPrice) {
this.hourlyPrice = hourlyPrice;
}
/**
*
* The hourly price for a single instance.
*
*
* @return The hourly price for a single instance.
*/
public String getHourlyPrice() {
return this.hourlyPrice;
}
/**
*
* The hourly price for a single instance.
*
*
* @param hourlyPrice
* The hourly price for a single instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ScheduledInstance withHourlyPrice(String hourlyPrice) {
setHourlyPrice(hourlyPrice);
return this;
}
/**
*
* The number of instances.
*
*
* @param instanceCount
* The number of instances.
*/
public void setInstanceCount(Integer instanceCount) {
this.instanceCount = instanceCount;
}
/**
*
* The number of instances.
*
*
* @return The number of instances.
*/
public Integer getInstanceCount() {
return this.instanceCount;
}
/**
*
* The number of instances.
*
*
* @param instanceCount
* The number of instances.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ScheduledInstance withInstanceCount(Integer instanceCount) {
setInstanceCount(instanceCount);
return this;
}
/**
*
* The instance type.
*
*
* @param instanceType
* The instance type.
*/
public void setInstanceType(String instanceType) {
this.instanceType = instanceType;
}
/**
*
* The instance type.
*
*
* @return The instance type.
*/
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.
*/
public ScheduledInstance withInstanceType(String instanceType) {
setInstanceType(instanceType);
return this;
}
/**
*
* The network platform.
*
*
* @param networkPlatform
* The network platform.
*/
public void setNetworkPlatform(String networkPlatform) {
this.networkPlatform = networkPlatform;
}
/**
*
* The network platform.
*
*
* @return The network platform.
*/
public String getNetworkPlatform() {
return this.networkPlatform;
}
/**
*
* The network platform.
*
*
* @param networkPlatform
* The network platform.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ScheduledInstance withNetworkPlatform(String networkPlatform) {
setNetworkPlatform(networkPlatform);
return this;
}
/**
*
* The time for the next schedule to start.
*
*
* @param nextSlotStartTime
* The time for the next schedule to start.
*/
public void setNextSlotStartTime(java.util.Date nextSlotStartTime) {
this.nextSlotStartTime = nextSlotStartTime;
}
/**
*
* The time for the next schedule to start.
*
*
* @return The time for the next schedule to start.
*/
public java.util.Date getNextSlotStartTime() {
return this.nextSlotStartTime;
}
/**
*
* The time for the next schedule to start.
*
*
* @param nextSlotStartTime
* The time for the next schedule to start.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ScheduledInstance withNextSlotStartTime(java.util.Date nextSlotStartTime) {
setNextSlotStartTime(nextSlotStartTime);
return this;
}
/**
*
* The platform (Linux/UNIX
or Windows
).
*
*
* @param platform
* The platform (Linux/UNIX
or Windows
).
*/
public void setPlatform(String platform) {
this.platform = platform;
}
/**
*
* The platform (Linux/UNIX
or Windows
).
*
*
* @return The platform (Linux/UNIX
or Windows
).
*/
public String getPlatform() {
return this.platform;
}
/**
*
* The platform (Linux/UNIX
or Windows
).
*
*
* @param platform
* The platform (Linux/UNIX
or Windows
).
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ScheduledInstance withPlatform(String platform) {
setPlatform(platform);
return this;
}
/**
*
* The time that the previous schedule ended or will end.
*
*
* @param previousSlotEndTime
* The time that the previous schedule ended or will end.
*/
public void setPreviousSlotEndTime(java.util.Date previousSlotEndTime) {
this.previousSlotEndTime = previousSlotEndTime;
}
/**
*
* The time that the previous schedule ended or will end.
*
*
* @return The time that the previous schedule ended or will end.
*/
public java.util.Date getPreviousSlotEndTime() {
return this.previousSlotEndTime;
}
/**
*
* The time that the previous schedule ended or will end.
*
*
* @param previousSlotEndTime
* The time that the previous schedule ended or will end.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ScheduledInstance withPreviousSlotEndTime(java.util.Date previousSlotEndTime) {
setPreviousSlotEndTime(previousSlotEndTime);
return this;
}
/**
*
* The schedule recurrence.
*
*
* @param recurrence
* The schedule recurrence.
*/
public void setRecurrence(ScheduledInstanceRecurrence recurrence) {
this.recurrence = recurrence;
}
/**
*
* The schedule recurrence.
*
*
* @return The schedule recurrence.
*/
public ScheduledInstanceRecurrence getRecurrence() {
return this.recurrence;
}
/**
*
* The schedule recurrence.
*
*
* @param recurrence
* The schedule recurrence.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ScheduledInstance withRecurrence(ScheduledInstanceRecurrence recurrence) {
setRecurrence(recurrence);
return this;
}
/**
*
* The Scheduled Instance ID.
*
*
* @param scheduledInstanceId
* The Scheduled Instance ID.
*/
public void setScheduledInstanceId(String scheduledInstanceId) {
this.scheduledInstanceId = scheduledInstanceId;
}
/**
*
* The Scheduled Instance ID.
*
*
* @return The Scheduled Instance ID.
*/
public String getScheduledInstanceId() {
return this.scheduledInstanceId;
}
/**
*
* The Scheduled Instance ID.
*
*
* @param scheduledInstanceId
* The Scheduled Instance ID.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ScheduledInstance withScheduledInstanceId(String scheduledInstanceId) {
setScheduledInstanceId(scheduledInstanceId);
return this;
}
/**
*
* The number of hours in the schedule.
*
*
* @param slotDurationInHours
* The number of hours in the schedule.
*/
public void setSlotDurationInHours(Integer slotDurationInHours) {
this.slotDurationInHours = slotDurationInHours;
}
/**
*
* The number of hours in the schedule.
*
*
* @return The number of hours in the schedule.
*/
public Integer getSlotDurationInHours() {
return this.slotDurationInHours;
}
/**
*
* The number of hours in the schedule.
*
*
* @param slotDurationInHours
* The number of hours in the schedule.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ScheduledInstance withSlotDurationInHours(Integer slotDurationInHours) {
setSlotDurationInHours(slotDurationInHours);
return this;
}
/**
*
* The end date for the Scheduled Instance.
*
*
* @param termEndDate
* The end date for the Scheduled Instance.
*/
public void setTermEndDate(java.util.Date termEndDate) {
this.termEndDate = termEndDate;
}
/**
*
* The end date for the Scheduled Instance.
*
*
* @return The end date for the Scheduled Instance.
*/
public java.util.Date getTermEndDate() {
return this.termEndDate;
}
/**
*
* The end date for the Scheduled Instance.
*
*
* @param termEndDate
* The end date for the Scheduled Instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ScheduledInstance withTermEndDate(java.util.Date termEndDate) {
setTermEndDate(termEndDate);
return this;
}
/**
*
* The start date for the Scheduled Instance.
*
*
* @param termStartDate
* The start date for the Scheduled Instance.
*/
public void setTermStartDate(java.util.Date termStartDate) {
this.termStartDate = termStartDate;
}
/**
*
* The start date for the Scheduled Instance.
*
*
* @return The start date for the Scheduled Instance.
*/
public java.util.Date getTermStartDate() {
return this.termStartDate;
}
/**
*
* The start date for the Scheduled Instance.
*
*
* @param termStartDate
* The start date for the Scheduled Instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ScheduledInstance withTermStartDate(java.util.Date termStartDate) {
setTermStartDate(termStartDate);
return this;
}
/**
*
* The total number of hours for a single instance for the entire term.
*
*
* @param totalScheduledInstanceHours
* The total number of hours for a single instance for the entire term.
*/
public void setTotalScheduledInstanceHours(Integer totalScheduledInstanceHours) {
this.totalScheduledInstanceHours = totalScheduledInstanceHours;
}
/**
*
* The total number of hours for a single instance for the entire term.
*
*
* @return The total number of hours for a single instance for the entire term.
*/
public Integer getTotalScheduledInstanceHours() {
return this.totalScheduledInstanceHours;
}
/**
*
* The total number of hours for a single instance for the entire term.
*
*
* @param totalScheduledInstanceHours
* The total number of hours for a single instance for the entire term.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ScheduledInstance withTotalScheduledInstanceHours(Integer totalScheduledInstanceHours) {
setTotalScheduledInstanceHours(totalScheduledInstanceHours);
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 (getCreateDate() != null)
sb.append("CreateDate: ").append(getCreateDate()).append(",");
if (getHourlyPrice() != null)
sb.append("HourlyPrice: ").append(getHourlyPrice()).append(",");
if (getInstanceCount() != null)
sb.append("InstanceCount: ").append(getInstanceCount()).append(",");
if (getInstanceType() != null)
sb.append("InstanceType: ").append(getInstanceType()).append(",");
if (getNetworkPlatform() != null)
sb.append("NetworkPlatform: ").append(getNetworkPlatform()).append(",");
if (getNextSlotStartTime() != null)
sb.append("NextSlotStartTime: ").append(getNextSlotStartTime()).append(",");
if (getPlatform() != null)
sb.append("Platform: ").append(getPlatform()).append(",");
if (getPreviousSlotEndTime() != null)
sb.append("PreviousSlotEndTime: ").append(getPreviousSlotEndTime()).append(",");
if (getRecurrence() != null)
sb.append("Recurrence: ").append(getRecurrence()).append(",");
if (getScheduledInstanceId() != null)
sb.append("ScheduledInstanceId: ").append(getScheduledInstanceId()).append(",");
if (getSlotDurationInHours() != null)
sb.append("SlotDurationInHours: ").append(getSlotDurationInHours()).append(",");
if (getTermEndDate() != null)
sb.append("TermEndDate: ").append(getTermEndDate()).append(",");
if (getTermStartDate() != null)
sb.append("TermStartDate: ").append(getTermStartDate()).append(",");
if (getTotalScheduledInstanceHours() != null)
sb.append("TotalScheduledInstanceHours: ").append(getTotalScheduledInstanceHours());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ScheduledInstance == false)
return false;
ScheduledInstance other = (ScheduledInstance) obj;
if (other.getAvailabilityZone() == null ^ this.getAvailabilityZone() == null)
return false;
if (other.getAvailabilityZone() != null && other.getAvailabilityZone().equals(this.getAvailabilityZone()) == false)
return false;
if (other.getCreateDate() == null ^ this.getCreateDate() == null)
return false;
if (other.getCreateDate() != null && other.getCreateDate().equals(this.getCreateDate()) == false)
return false;
if (other.getHourlyPrice() == null ^ this.getHourlyPrice() == null)
return false;
if (other.getHourlyPrice() != null && other.getHourlyPrice().equals(this.getHourlyPrice()) == false)
return false;
if (other.getInstanceCount() == null ^ this.getInstanceCount() == null)
return false;
if (other.getInstanceCount() != null && other.getInstanceCount().equals(this.getInstanceCount()) == 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.getNetworkPlatform() == null ^ this.getNetworkPlatform() == null)
return false;
if (other.getNetworkPlatform() != null && other.getNetworkPlatform().equals(this.getNetworkPlatform()) == false)
return false;
if (other.getNextSlotStartTime() == null ^ this.getNextSlotStartTime() == null)
return false;
if (other.getNextSlotStartTime() != null && other.getNextSlotStartTime().equals(this.getNextSlotStartTime()) == false)
return false;
if (other.getPlatform() == null ^ this.getPlatform() == null)
return false;
if (other.getPlatform() != null && other.getPlatform().equals(this.getPlatform()) == false)
return false;
if (other.getPreviousSlotEndTime() == null ^ this.getPreviousSlotEndTime() == null)
return false;
if (other.getPreviousSlotEndTime() != null && other.getPreviousSlotEndTime().equals(this.getPreviousSlotEndTime()) == false)
return false;
if (other.getRecurrence() == null ^ this.getRecurrence() == null)
return false;
if (other.getRecurrence() != null && other.getRecurrence().equals(this.getRecurrence()) == false)
return false;
if (other.getScheduledInstanceId() == null ^ this.getScheduledInstanceId() == null)
return false;
if (other.getScheduledInstanceId() != null && other.getScheduledInstanceId().equals(this.getScheduledInstanceId()) == false)
return false;
if (other.getSlotDurationInHours() == null ^ this.getSlotDurationInHours() == null)
return false;
if (other.getSlotDurationInHours() != null && other.getSlotDurationInHours().equals(this.getSlotDurationInHours()) == false)
return false;
if (other.getTermEndDate() == null ^ this.getTermEndDate() == null)
return false;
if (other.getTermEndDate() != null && other.getTermEndDate().equals(this.getTermEndDate()) == false)
return false;
if (other.getTermStartDate() == null ^ this.getTermStartDate() == null)
return false;
if (other.getTermStartDate() != null && other.getTermStartDate().equals(this.getTermStartDate()) == false)
return false;
if (other.getTotalScheduledInstanceHours() == null ^ this.getTotalScheduledInstanceHours() == null)
return false;
if (other.getTotalScheduledInstanceHours() != null && other.getTotalScheduledInstanceHours().equals(this.getTotalScheduledInstanceHours()) == 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 + ((getCreateDate() == null) ? 0 : getCreateDate().hashCode());
hashCode = prime * hashCode + ((getHourlyPrice() == null) ? 0 : getHourlyPrice().hashCode());
hashCode = prime * hashCode + ((getInstanceCount() == null) ? 0 : getInstanceCount().hashCode());
hashCode = prime * hashCode + ((getInstanceType() == null) ? 0 : getInstanceType().hashCode());
hashCode = prime * hashCode + ((getNetworkPlatform() == null) ? 0 : getNetworkPlatform().hashCode());
hashCode = prime * hashCode + ((getNextSlotStartTime() == null) ? 0 : getNextSlotStartTime().hashCode());
hashCode = prime * hashCode + ((getPlatform() == null) ? 0 : getPlatform().hashCode());
hashCode = prime * hashCode + ((getPreviousSlotEndTime() == null) ? 0 : getPreviousSlotEndTime().hashCode());
hashCode = prime * hashCode + ((getRecurrence() == null) ? 0 : getRecurrence().hashCode());
hashCode = prime * hashCode + ((getScheduledInstanceId() == null) ? 0 : getScheduledInstanceId().hashCode());
hashCode = prime * hashCode + ((getSlotDurationInHours() == null) ? 0 : getSlotDurationInHours().hashCode());
hashCode = prime * hashCode + ((getTermEndDate() == null) ? 0 : getTermEndDate().hashCode());
hashCode = prime * hashCode + ((getTermStartDate() == null) ? 0 : getTermStartDate().hashCode());
hashCode = prime * hashCode + ((getTotalScheduledInstanceHours() == null) ? 0 : getTotalScheduledInstanceHours().hashCode());
return hashCode;
}
@Override
public ScheduledInstance clone() {
try {
return (ScheduledInstance) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}