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 a Reserved Instance modification.

 
 public class ReservedInstancesModification implements SerializableCloneable {

    
A unique ID for the Reserved Instance modification.
 
     private String reservedInstancesModificationId;

    
The IDs of one or more Reserved Instances.
 
Contains target configurations along with their corresponding new Reserved Instance IDs.
 
The time when the modification request was created.
 
     private java.util.Date createDate;

    
The time when the modification request was last updated.
 
     private java.util.Date updateDate;

    
The time for the modification to become effective.
 
     private java.util.Date effectiveDate;

    
The status of the Reserved Instances modification request.
 
     private String status;

    
The reason for the status.
 
     private String statusMessage;

    
A unique, case-sensitive key supplied by the client to ensure that the request is idempotent. For more information, see Ensuring Idempotency.
 
     private String clientToken;

    
A unique ID for the Reserved Instance modification.

Returns:
A unique ID for the Reserved Instance modification.
 
         return ;
     }
    
    
A unique ID for the Reserved Instance modification.

Parameters:
reservedInstancesModificationId A unique ID for the Reserved Instance modification.
 
     public void setReservedInstancesModificationId(String reservedInstancesModificationId) {
         this. = reservedInstancesModificationId;
     }
    
    
A unique ID for the Reserved Instance modification.

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

Parameters:
reservedInstancesModificationId A unique ID for the Reserved Instance modification.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ReservedInstancesModification withReservedInstancesModificationId(String reservedInstancesModificationId) {
        this. = reservedInstancesModificationId;
        return this;
    }

    
The IDs of one or more Reserved Instances.

Returns:
The IDs of one or more Reserved Instances.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
The IDs of one or more Reserved Instances.

Parameters:
reservedInstancesIds The IDs of one or more Reserved Instances.
    public void setReservedInstancesIds(java.util.Collection<ReservedInstancesIdreservedInstancesIds) {
        if (reservedInstancesIds == null) {
            this. = null;
            return;
        }
        reservedInstancesIdsCopy.addAll(reservedInstancesIds);
        this. = reservedInstancesIdsCopy;
    }
    
    
The IDs of one or more Reserved Instances.

NOTE: This method appends the values to the existing list (if any). Use setReservedInstancesIds(java.util.Collection) or withReservedInstancesIds(java.util.Collection) if you want to override the existing values.

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

Parameters:
reservedInstancesIds The IDs of one or more Reserved Instances.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (getReservedInstancesIds() == nullsetReservedInstancesIds(new java.util.ArrayList<ReservedInstancesId>(reservedInstancesIds.length));
        for (ReservedInstancesId value : reservedInstancesIds) {
            getReservedInstancesIds().add(value);
        }
        return this;
    }
    
    
The IDs of one or more Reserved Instances.

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

Parameters:
reservedInstancesIds The IDs of one or more Reserved Instances.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (reservedInstancesIds == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<ReservedInstancesIdreservedInstancesIdsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<ReservedInstancesId>(reservedInstancesIds.size());
            reservedInstancesIdsCopy.addAll(reservedInstancesIds);
            this. = reservedInstancesIdsCopy;
        }
        return this;
    }

    
Contains target configurations along with their corresponding new Reserved Instance IDs.

Returns:
Contains target configurations along with their corresponding new Reserved Instance IDs.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
Contains target configurations along with their corresponding new Reserved Instance IDs.

Parameters:
modificationResults Contains target configurations along with their corresponding new Reserved Instance IDs.
    public void setModificationResults(java.util.Collection<ReservedInstancesModificationResultmodificationResults) {
        if (modificationResults == null) {
            this. = null;
            return;
        }
        modificationResultsCopy.addAll(modificationResults);
        this. = modificationResultsCopy;
    }
    
    
Contains target configurations along with their corresponding new Reserved Instance IDs.

NOTE: This method appends the values to the existing list (if any). Use setModificationResults(java.util.Collection) or withModificationResults(java.util.Collection) if you want to override the existing values.

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

Parameters:
modificationResults Contains target configurations along with their corresponding new Reserved Instance IDs.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (getModificationResults() == nullsetModificationResults(new java.util.ArrayList<ReservedInstancesModificationResult>(modificationResults.length));
        for (ReservedInstancesModificationResult value : modificationResults) {
            getModificationResults().add(value);
        }
        return this;
    }
    
    
Contains target configurations along with their corresponding new Reserved Instance IDs.

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

Parameters:
modificationResults Contains target configurations along with their corresponding new Reserved Instance IDs.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (modificationResults == null) {
            this. = null;
        } else {
            modificationResultsCopy.addAll(modificationResults);
            this. = modificationResultsCopy;
        }
        return this;
    }

    
The time when the modification request was created.

Returns:
The time when the modification request was created.
    public java.util.Date getCreateDate() {
        return ;
    }
    
    
The time when the modification request was created.

Parameters:
createDate The time when the modification request was created.
    public void setCreateDate(java.util.Date createDate) {
        this. = createDate;
    }
    
    
The time when the modification request was created.

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

Parameters:
createDate The time when the modification request was created.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = createDate;
        return this;
    }

    
The time when the modification request was last updated.

Returns:
The time when the modification request was last updated.
    public java.util.Date getUpdateDate() {
        return ;
    }
    
    
The time when the modification request was last updated.

Parameters:
updateDate The time when the modification request was last updated.
    public void setUpdateDate(java.util.Date updateDate) {
        this. = updateDate;
    }
    
    
The time when the modification request was last updated.

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

Parameters:
updateDate The time when the modification request was last updated.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = updateDate;
        return this;
    }

    
The time for the modification to become effective.

Returns:
The time for the modification to become effective.
    public java.util.Date getEffectiveDate() {
        return ;
    }
    
    
The time for the modification to become effective.

Parameters:
effectiveDate The time for the modification to become effective.
    public void setEffectiveDate(java.util.Date effectiveDate) {
        this. = effectiveDate;
    }
    
    
The time for the modification to become effective.

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

Parameters:
effectiveDate The time for the modification to become effective.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = effectiveDate;
        return this;
    }

    
The status of the Reserved Instances modification request.

Returns:
The status of the Reserved Instances modification request.
    public String getStatus() {
        return ;
    }
    
    
The status of the Reserved Instances modification request.

Parameters:
status The status of the Reserved Instances modification request.
    public void setStatus(String status) {
        this. = status;
    }
    
    
The status of the Reserved Instances modification request.

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

Parameters:
status The status of the Reserved Instances modification request.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = status;
        return this;
    }

    
The reason for the status.

Returns:
The reason for the status.
    public String getStatusMessage() {
        return ;
    }
    
    
The reason for the status.

Parameters:
statusMessage The reason for the status.
    public void setStatusMessage(String statusMessage) {
        this. = statusMessage;
    }
    
    
The reason for the status.

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

Parameters:
statusMessage The reason for the status.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ReservedInstancesModification withStatusMessage(String statusMessage) {
        this. = 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.

Returns:
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 ;
    }
    
    
A unique, case-sensitive key supplied by the client to ensure that the request is idempotent. For more information, see Ensuring Idempotency.

Parameters:
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;
    }
    
    
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.

Parameters:
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 updated object so that method calls can be chained together.
    public ReservedInstancesModification withClientToken(String clientToken) {
        this. = clientToken;
        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 (getReservedInstancesModificationId() != nullsb.append("ReservedInstancesModificationId: " + getReservedInstancesModificationId() + ",");
        if (getReservedInstancesIds() != nullsb.append("ReservedInstancesIds: " + getReservedInstancesIds() + ",");
        if (getModificationResults() != nullsb.append("ModificationResults: " + getModificationResults() + ",");
        if (getCreateDate() != nullsb.append("CreateDate: " + getCreateDate() + ",");
        if (getUpdateDate() != nullsb.append("UpdateDate: " + getUpdateDate() + ",");
        if (getEffectiveDate() != nullsb.append("EffectiveDate: " + getEffectiveDate() + ",");
        if (getStatus() != nullsb.append("Status: " + getStatus() + ",");
        if (getStatusMessage() != nullsb.append("StatusMessage: " + getStatusMessage() + ",");
        if (getClientToken() != nullsb.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 == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof ReservedInstancesModification == falsereturn false;
        
        if (other.getReservedInstancesModificationId() == null ^ this.getReservedInstancesModificationId() == nullreturn false;
        if (other.getReservedInstancesModificationId() != null && other.getReservedInstancesModificationId().equals(this.getReservedInstancesModificationId()) == falsereturn false
        if (other.getReservedInstancesIds() == null ^ this.getReservedInstancesIds() == nullreturn false;
        if (other.getReservedInstancesIds() != null && other.getReservedInstancesIds().equals(this.getReservedInstancesIds()) == falsereturn false
        if (other.getModificationResults() == null ^ this.getModificationResults() == nullreturn false;
        if (other.getModificationResults() != null && other.getModificationResults().equals(this.getModificationResults()) == falsereturn false
        if (other.getCreateDate() == null ^ this.getCreateDate() == nullreturn false;
        if (other.getCreateDate() != null && other.getCreateDate().equals(this.getCreateDate()) == falsereturn false
        if (other.getUpdateDate() == null ^ this.getUpdateDate() == nullreturn false;
        if (other.getUpdateDate() != null && other.getUpdateDate().equals(this.getUpdateDate()) == falsereturn false
        if (other.getEffectiveDate() == null ^ this.getEffectiveDate() == nullreturn false;
        if (other.getEffectiveDate() != null && other.getEffectiveDate().equals(this.getEffectiveDate()) == falsereturn false
        if (other.getStatus() == null ^ this.getStatus() == nullreturn false;
        if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == falsereturn false
        if (other.getStatusMessage() == null ^ this.getStatusMessage() == nullreturn false;
        if (other.getStatusMessage() != null && other.getStatusMessage().equals(this.getStatusMessage()) == falsereturn false
        if (other.getClientToken() == null ^ this.getClientToken() == nullreturn false;
        if (other.getClientToken() != null && other.getClientToken().equals(this.getClientToken()) == falsereturn false
        return true;
    }
    
    @Override
        try {
            return (ReservedInstancesModificationsuper.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