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;
 
 
Container for the parameters to the ModifyReservedInstances operation.

Modifies the Availability Zone, instance count, instance type, or network platform (EC2-Classic or EC2-VPC) of your Reserved Instances. The Reserved Instances to be modified must be identical, except for Availability Zone, network platform, and instance type.

For more information, see Modifying Reserved Instances in the Amazon Elastic Compute Cloud User Guide for Linux.

 
 public class ModifyReservedInstancesRequest extends AmazonWebServiceRequest implements SerializableCloneable {

    
A unique, case-sensitive token you provide to ensure idempotency of your modification request. For more information, see Ensuring Idempotency.
 
     private String clientToken;

    
The IDs of the Reserved Instances to modify.
 
The configuration settings for the Reserved Instances to modify.
 
A unique, case-sensitive token you provide to ensure idempotency of your modification request. For more information, see Ensuring Idempotency.

Returns:
A unique, case-sensitive token you provide to ensure idempotency of your modification request. For more information, see Ensuring Idempotency.
 
     public String getClientToken() {
         return ;
     }
    
    
A unique, case-sensitive token you provide to ensure idempotency of your modification request. For more information, see Ensuring Idempotency.

Parameters:
clientToken A unique, case-sensitive token you provide to ensure idempotency of your modification request. For more information, see Ensuring Idempotency.
 
     public void setClientToken(String clientToken) {
         this. = clientToken;
     }
    
    
A unique, case-sensitive token you provide to ensure idempotency of your modification request. 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 token you provide to ensure idempotency of your modification request. For more information, see Ensuring Idempotency.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ModifyReservedInstancesRequest withClientToken(String clientToken) {
        this. = clientToken;
        return this;
    }

    
The IDs of the Reserved Instances to modify.

Returns:
The IDs of the Reserved Instances to modify.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
The IDs of the Reserved Instances to modify.

Parameters:
reservedInstancesIds The IDs of the Reserved Instances to modify.
    public void setReservedInstancesIds(java.util.Collection<StringreservedInstancesIds) {
        if (reservedInstancesIds == null) {
            this. = null;
            return;
        }
        com.amazonaws.internal.ListWithAutoConstructFlag<StringreservedInstancesIdsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(reservedInstancesIds.size());
        reservedInstancesIdsCopy.addAll(reservedInstancesIds);
        this. = reservedInstancesIdsCopy;
    }
    
    
The IDs of the Reserved Instances to modify.

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 the Reserved Instances to modify.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ModifyReservedInstancesRequest withReservedInstancesIds(String... reservedInstancesIds) {
        if (getReservedInstancesIds() == nullsetReservedInstancesIds(new java.util.ArrayList<String>(reservedInstancesIds.length));
        for (String value : reservedInstancesIds) {
            getReservedInstancesIds().add(value);
        }
        return this;
    }
    
    
The IDs of the Reserved Instances to modify.

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

Parameters:
reservedInstancesIds The IDs of the Reserved Instances to modify.
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<StringreservedInstancesIdsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(reservedInstancesIds.size());
            reservedInstancesIdsCopy.addAll(reservedInstancesIds);
            this. = reservedInstancesIdsCopy;
        }
        return this;
    }

    
The configuration settings for the Reserved Instances to modify.

Returns:
The configuration settings for the Reserved Instances to modify.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
The configuration settings for the Reserved Instances to modify.

Parameters:
targetConfigurations The configuration settings for the Reserved Instances to modify.
    public void setTargetConfigurations(java.util.Collection<ReservedInstancesConfigurationtargetConfigurations) {
        if (targetConfigurations == null) {
            this. = null;
            return;
        }
        targetConfigurationsCopy.addAll(targetConfigurations);
        this. = targetConfigurationsCopy;
    }
    
    
The configuration settings for the Reserved Instances to modify.

NOTE: This method appends the values to the existing list (if any). Use setTargetConfigurations(java.util.Collection) or withTargetConfigurations(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:
targetConfigurations The configuration settings for the Reserved Instances to modify.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (getTargetConfigurations() == nullsetTargetConfigurations(new java.util.ArrayList<ReservedInstancesConfiguration>(targetConfigurations.length));
        for (ReservedInstancesConfiguration value : targetConfigurations) {
            getTargetConfigurations().add(value);
        }
        return this;
    }
    
    
The configuration settings for the Reserved Instances to modify.

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

Parameters:
targetConfigurations The configuration settings for the Reserved Instances to modify.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (targetConfigurations == null) {
            this. = null;
        } else {
            targetConfigurationsCopy.addAll(targetConfigurations);
            this. = targetConfigurationsCopy;
        }
        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 (getClientToken() != nullsb.append("ClientToken: " + getClientToken() + ",");
        if (getReservedInstancesIds() != nullsb.append("ReservedInstancesIds: " + getReservedInstancesIds() + ",");
        if (getTargetConfigurations() != nullsb.append("TargetConfigurations: " + getTargetConfigurations() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getClientToken() == null) ? 0 : getClientToken().hashCode()); 
        hashCode = prime * hashCode + ((getReservedInstancesIds() == null) ? 0 : getReservedInstancesIds().hashCode()); 
        hashCode = prime * hashCode + ((getTargetConfigurations() == null) ? 0 : getTargetConfigurations().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof ModifyReservedInstancesRequest == falsereturn false;
        
        if (other.getClientToken() == null ^ this.getClientToken() == nullreturn false;
        if (other.getClientToken() != null && other.getClientToken().equals(this.getClientToken()) == falsereturn false
        if (other.getReservedInstancesIds() == null ^ this.getReservedInstancesIds() == nullreturn false;
        if (other.getReservedInstancesIds() != null && other.getReservedInstancesIds().equals(this.getReservedInstancesIds()) == falsereturn false
        if (other.getTargetConfigurations() == null ^ this.getTargetConfigurations() == nullreturn false;
        if (other.getTargetConfigurations() != null && other.getTargetConfigurations().equals(this.getTargetConfigurations()) == falsereturn false
        return true;
    }
    
    @Override
        
            return (ModifyReservedInstancesRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X