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.elasticmapreduce.model;
 

Modify an instance group size.

 
 public class InstanceGroupModifyConfig implements SerializableCloneable {

    
Unique ID of the instance group to expand or shrink.

Constraints:
Length: 0 - 256
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

 
     private String instanceGroupId;

    
Target size for the instance group.
 
     private Integer instanceCount;

    
The EC2 InstanceIds to terminate. For advanced users only. Once you terminate the instances, the instance group will not return to its original requested size.
 
Default constructor for a new InstanceGroupModifyConfig object. Callers should use the setter or fluent setter (with...) methods to initialize this object after creating it.
 
     public InstanceGroupModifyConfig() {}
    
    
Constructs a new InstanceGroupModifyConfig object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.

Parameters:
instanceGroupId Unique ID of the instance group to expand or shrink.
instanceCount Target size for the instance group.
 
     public InstanceGroupModifyConfig(String instanceGroupIdInteger instanceCount) {
         setInstanceGroupId(instanceGroupId);
         setInstanceCount(instanceCount);
     }

    
Unique ID of the instance group to expand or shrink.

Constraints:
Length: 0 - 256
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Returns:
Unique ID of the instance group to expand or shrink.
 
     public String getInstanceGroupId() {
         return ;
     }
    
    
Unique ID of the instance group to expand or shrink.

Constraints:
Length: 0 - 256
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
instanceGroupId Unique ID of the instance group to expand or shrink.
 
     public void setInstanceGroupId(String instanceGroupId) {
         this. = instanceGroupId;
     }
    
    
Unique ID of the instance group to expand or shrink.

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

Constraints:
Length: 0 - 256
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
instanceGroupId Unique ID of the instance group to expand or shrink.
Returns:
A reference to this updated object so that method calls can be chained together.
    public InstanceGroupModifyConfig withInstanceGroupId(String instanceGroupId) {
        this. = instanceGroupId;
        return this;
    }

    
Target size for the instance group.

Returns:
Target size for the instance group.
    public Integer getInstanceCount() {
        return ;
    }
    
    
Target size for the instance group.

Parameters:
instanceCount Target size for the instance group.
    public void setInstanceCount(Integer instanceCount) {
        this. = instanceCount;
    }
    
    
Target size for the instance group.

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

Parameters:
instanceCount Target size for the instance group.
Returns:
A reference to this updated object so that method calls can be chained together.
    public InstanceGroupModifyConfig withInstanceCount(Integer instanceCount) {
        this. = instanceCount;
        return this;
    }

    
The EC2 InstanceIds to terminate. For advanced users only. Once you terminate the instances, the instance group will not return to its original requested size.

Returns:
The EC2 InstanceIds to terminate. For advanced users only. Once you terminate the instances, the instance group will not return to its original requested size.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
The EC2 InstanceIds to terminate. For advanced users only. Once you terminate the instances, the instance group will not return to its original requested size.

Parameters:
eC2InstanceIdsToTerminate The EC2 InstanceIds to terminate. For advanced users only. Once you terminate the instances, the instance group will not return to its original requested size.
    public void setEC2InstanceIdsToTerminate(java.util.Collection<StringeC2InstanceIdsToTerminate) {
        if (eC2InstanceIdsToTerminate == null) {
            this. = null;
            return;
        }
        com.amazonaws.internal.ListWithAutoConstructFlag<StringeC2InstanceIdsToTerminateCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(eC2InstanceIdsToTerminate.size());
        eC2InstanceIdsToTerminateCopy.addAll(eC2InstanceIdsToTerminate);
        this. = eC2InstanceIdsToTerminateCopy;
    }
    
    
The EC2 InstanceIds to terminate. For advanced users only. Once you terminate the instances, the instance group will not return to its original requested size.

NOTE: This method appends the values to the existing list (if any). Use setEC2InstanceIdsToTerminate(java.util.Collection) or withEC2InstanceIdsToTerminate(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:
eC2InstanceIdsToTerminate The EC2 InstanceIds to terminate. For advanced users only. Once you terminate the instances, the instance group will not return to its original requested size.
Returns:
A reference to this updated object so that method calls can be chained together.
    public InstanceGroupModifyConfig withEC2InstanceIdsToTerminate(String... eC2InstanceIdsToTerminate) {
        if (getEC2InstanceIdsToTerminate() == nullsetEC2InstanceIdsToTerminate(new java.util.ArrayList<String>(eC2InstanceIdsToTerminate.length));
        for (String value : eC2InstanceIdsToTerminate) {
            getEC2InstanceIdsToTerminate().add(value);
        }
        return this;
    }
    
    
The EC2 InstanceIds to terminate. For advanced users only. Once you terminate the instances, the instance group will not return to its original requested size.

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

Parameters:
eC2InstanceIdsToTerminate The EC2 InstanceIds to terminate. For advanced users only. Once you terminate the instances, the instance group will not return to its original requested size.
Returns:
A reference to this updated object so that method calls can be chained together.
    public InstanceGroupModifyConfig withEC2InstanceIdsToTerminate(java.util.Collection<StringeC2InstanceIdsToTerminate) {
        if (eC2InstanceIdsToTerminate == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<StringeC2InstanceIdsToTerminateCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(eC2InstanceIdsToTerminate.size());
            eC2InstanceIdsToTerminateCopy.addAll(eC2InstanceIdsToTerminate);
            this. = eC2InstanceIdsToTerminateCopy;
        }
        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 (getInstanceGroupId() != nullsb.append("InstanceGroupId: " + getInstanceGroupId() + ",");
        if (getInstanceCount() != nullsb.append("InstanceCount: " + getInstanceCount() + ",");
        if (getEC2InstanceIdsToTerminate() != nullsb.append("EC2InstanceIdsToTerminate: " + getEC2InstanceIdsToTerminate() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getInstanceGroupId() == null) ? 0 : getInstanceGroupId().hashCode()); 
        hashCode = prime * hashCode + ((getInstanceCount() == null) ? 0 : getInstanceCount().hashCode()); 
        hashCode = prime * hashCode + ((getEC2InstanceIdsToTerminate() == null) ? 0 : getEC2InstanceIdsToTerminate().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof InstanceGroupModifyConfig == falsereturn false;
        
        if (other.getInstanceGroupId() == null ^ this.getInstanceGroupId() == nullreturn false;
        if (other.getInstanceGroupId() != null && other.getInstanceGroupId().equals(this.getInstanceGroupId()) == falsereturn false
        if (other.getInstanceCount() == null ^ this.getInstanceCount() == nullreturn false;
        if (other.getInstanceCount() != null && other.getInstanceCount().equals(this.getInstanceCount()) == falsereturn false
        if (other.getEC2InstanceIdsToTerminate() == null ^ this.getEC2InstanceIdsToTerminate() == nullreturn false;
        if (other.getEC2InstanceIdsToTerminate() != null && other.getEC2InstanceIdsToTerminate().equals(this.getEC2InstanceIdsToTerminate()) == falsereturn false
        return true;
    }
    
    @Override
    public InstanceGroupModifyConfig clone() {
        try {
            return (InstanceGroupModifyConfigsuper.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