/* * Copyright 2010-2018 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 a Reserved Instance modification. *
*/ public class ReservedInstancesModification implements Serializable { /** * A unique ID for the Reserved Instance modification. */ private String reservedInstancesModificationId; /** * The IDs of one or more Reserved Instances. */ private com.amazonaws.internal.ListWithAutoConstructFlag
* Returns a reference to this object so that method calls can be chained together.
*
* @param reservedInstancesModificationId A unique ID for the Reserved Instance modification.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public ReservedInstancesModification withReservedInstancesModificationId(String reservedInstancesModificationId) {
this.reservedInstancesModificationId = reservedInstancesModificationId;
return this;
}
/**
* The IDs of one or more Reserved Instances.
*
* @return The IDs of one or more Reserved Instances.
*/
public java.util.List
* Returns a reference to this object so that method calls can be chained together.
*
* @param reservedInstancesIds The IDs of one or more Reserved Instances.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public ReservedInstancesModification withReservedInstancesIds(ReservedInstancesId... reservedInstancesIds) {
if (getReservedInstancesIds() == null) setReservedInstancesIds(new java.util.ArrayList
* Returns a reference to this object so that method calls can be chained together.
*
* @param reservedInstancesIds The IDs of one or more Reserved Instances.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public ReservedInstancesModification withReservedInstancesIds(java.util.Collection
* Returns a reference to this object so that method calls can be chained together.
*
* @param modificationResults Contains target configurations along with their corresponding new
* Reserved Instance IDs.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public ReservedInstancesModification withModificationResults(ReservedInstancesModificationResult... modificationResults) {
if (getModificationResults() == null) setModificationResults(new java.util.ArrayList
* Returns a reference to this object so that method calls can be chained together.
*
* @param modificationResults Contains target configurations along with their corresponding new
* Reserved Instance IDs.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public ReservedInstancesModification withModificationResults(java.util.Collection
* Returns a reference to this object so that method calls can be chained together.
*
* @param createDate The time when the modification request was created.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public ReservedInstancesModification withCreateDate(java.util.Date createDate) {
this.createDate = createDate;
return this;
}
/**
* The time when the modification request was last updated.
*
* @return The time when the modification request was last updated.
*/
public java.util.Date getUpdateDate() {
return updateDate;
}
/**
* The time when the modification request was last updated.
*
* @param updateDate The time when the modification request was last updated.
*/
public void setUpdateDate(java.util.Date updateDate) {
this.updateDate = updateDate;
}
/**
* The time when the modification request was last updated.
*
* Returns a reference to this object so that method calls can be chained together.
*
* @param updateDate The time when the modification request was last updated.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public ReservedInstancesModification withUpdateDate(java.util.Date updateDate) {
this.updateDate = updateDate;
return this;
}
/**
* The time for the modification to become effective.
*
* @return The time for the modification to become effective.
*/
public java.util.Date getEffectiveDate() {
return effectiveDate;
}
/**
* The time for the modification to become effective.
*
* @param effectiveDate The time for the modification to become effective.
*/
public void setEffectiveDate(java.util.Date effectiveDate) {
this.effectiveDate = effectiveDate;
}
/**
* The time for the modification to become effective.
*
* Returns a reference to this object so that method calls can be chained together.
*
* @param effectiveDate The time for the modification to become effective.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public ReservedInstancesModification withEffectiveDate(java.util.Date effectiveDate) {
this.effectiveDate = effectiveDate;
return this;
}
/**
* The status of the Reserved Instances modification request.
*
* @return The status of the Reserved Instances modification request.
*/
public String getStatus() {
return status;
}
/**
* The status of the Reserved Instances modification request.
*
* @param status The status of the Reserved Instances modification request.
*/
public void setStatus(String status) {
this.status = status;
}
/**
* The status of the Reserved Instances modification request.
*
* Returns a reference to this object so that method calls can be chained together.
*
* @param status The status of the Reserved Instances modification request.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public ReservedInstancesModification withStatus(String status) {
this.status = status;
return this;
}
/**
* The reason for the status.
*
* @return The reason for the status.
*/
public String getStatusMessage() {
return statusMessage;
}
/**
* The reason for the status.
*
* @param statusMessage The reason for the status.
*/
public void setStatusMessage(String statusMessage) {
this.statusMessage = statusMessage;
}
/**
* The reason for the status.
*
* Returns a reference to this object so that method calls can be chained together.
*
* @param statusMessage The reason for the status.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public ReservedInstancesModification withStatusMessage(String statusMessage) {
this.statusMessage = statusMessage;
return this;
}
/**
* A unique, case-sensitive key supplied by the client to ensure that the
* request is idempotent. For more information, see Ensuring
* Idempotency.
*
* @return A unique, case-sensitive key supplied by the client to ensure that the
* request is idempotent. For more information, see Ensuring
* Idempotency.
*/
public String getClientToken() {
return clientToken;
}
/**
* A unique, case-sensitive key supplied by the client to ensure that the
* request is idempotent. For more information, see Ensuring
* Idempotency.
*
* @param clientToken A unique, case-sensitive key supplied by the client to ensure that the
* request is idempotent. For more information, see Ensuring
* Idempotency.
*/
public void setClientToken(String clientToken) {
this.clientToken = clientToken;
}
/**
* A unique, case-sensitive key supplied by the client to ensure that the
* request is idempotent. For more information, see Ensuring
* Idempotency.
*
* Returns a reference to this object so that method calls can be chained together.
*
* @param clientToken A unique, case-sensitive key supplied by the client to ensure that the
* request is idempotent. For more information, see Ensuring
* Idempotency.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public ReservedInstancesModification withClientToken(String clientToken) {
this.clientToken = clientToken;
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 (getReservedInstancesModificationId() != null) sb.append("ReservedInstancesModificationId: " + getReservedInstancesModificationId() + ",");
if (getReservedInstancesIds() != null) sb.append("ReservedInstancesIds: " + getReservedInstancesIds() + ",");
if (getModificationResults() != null) sb.append("ModificationResults: " + getModificationResults() + ",");
if (getCreateDate() != null) sb.append("CreateDate: " + getCreateDate() + ",");
if (getUpdateDate() != null) sb.append("UpdateDate: " + getUpdateDate() + ",");
if (getEffectiveDate() != null) sb.append("EffectiveDate: " + getEffectiveDate() + ",");
if (getStatus() != null) sb.append("Status: " + getStatus() + ",");
if (getStatusMessage() != null) sb.append("StatusMessage: " + getStatusMessage() + ",");
if (getClientToken() != null) sb.append("ClientToken: " + getClientToken() );
sb.append("}");
return sb.toString();
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getReservedInstancesModificationId() == null) ? 0 : getReservedInstancesModificationId().hashCode());
hashCode = prime * hashCode + ((getReservedInstancesIds() == null) ? 0 : getReservedInstancesIds().hashCode());
hashCode = prime * hashCode + ((getModificationResults() == null) ? 0 : getModificationResults().hashCode());
hashCode = prime * hashCode + ((getCreateDate() == null) ? 0 : getCreateDate().hashCode());
hashCode = prime * hashCode + ((getUpdateDate() == null) ? 0 : getUpdateDate().hashCode());
hashCode = prime * hashCode + ((getEffectiveDate() == null) ? 0 : getEffectiveDate().hashCode());
hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode());
hashCode = prime * hashCode + ((getStatusMessage() == null) ? 0 : getStatusMessage().hashCode());
hashCode = prime * hashCode + ((getClientToken() == null) ? 0 : getClientToken().hashCode());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null) return false;
if (obj instanceof ReservedInstancesModification == false) return false;
ReservedInstancesModification other = (ReservedInstancesModification)obj;
if (other.getReservedInstancesModificationId() == null ^ this.getReservedInstancesModificationId() == null) return false;
if (other.getReservedInstancesModificationId() != null && other.getReservedInstancesModificationId().equals(this.getReservedInstancesModificationId()) == false) return false;
if (other.getReservedInstancesIds() == null ^ this.getReservedInstancesIds() == null) return false;
if (other.getReservedInstancesIds() != null && other.getReservedInstancesIds().equals(this.getReservedInstancesIds()) == false) return false;
if (other.getModificationResults() == null ^ this.getModificationResults() == null) return false;
if (other.getModificationResults() != null && other.getModificationResults().equals(this.getModificationResults()) == 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.getUpdateDate() == null ^ this.getUpdateDate() == null) return false;
if (other.getUpdateDate() != null && other.getUpdateDate().equals(this.getUpdateDate()) == false) return false;
if (other.getEffectiveDate() == null ^ this.getEffectiveDate() == null) return false;
if (other.getEffectiveDate() != null && other.getEffectiveDate().equals(this.getEffectiveDate()) == false) return false;
if (other.getStatus() == null ^ this.getStatus() == null) return false;
if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false) return false;
if (other.getStatusMessage() == null ^ this.getStatusMessage() == null) return false;
if (other.getStatusMessage() != null && other.getStatusMessage().equals(this.getStatusMessage()) == false) return false;
if (other.getClientToken() == null ^ this.getClientToken() == null) return false;
if (other.getClientToken() != null && other.getClientToken().equals(this.getClientToken()) == false) return false;
return true;
}
}