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

Provides information about the cluster instances that Amazon EMR provisions on behalf of a user when it creates the cluster. For example, this operation indicates when the EC2 instances reach the Ready state, when instances become available to Amazon EMR to use for jobs, and the IP addresses for cluster instances, etc.

 
 public class ListInstancesRequest extends AmazonWebServiceRequest implements SerializableCloneable {

    
The identifier of the cluster for which to list the instances.
 
     private String clusterId;

    
The identifier of the instance group for which to list the instances.
 
     private String instanceGroupId;

    
The type of instance group for which to list the instances.
 
The pagination token that indicates the next set of results to retrieve.
 
     private String marker;

    
The identifier of the cluster for which to list the instances.

Returns:
The identifier of the cluster for which to list the instances.
 
     public String getClusterId() {
         return ;
     }
    
    
The identifier of the cluster for which to list the instances.

Parameters:
clusterId The identifier of the cluster for which to list the instances.
 
     public void setClusterId(String clusterId) {
         this. = clusterId;
     }
    
    
The identifier of the cluster for which to list the instances.

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

Parameters:
clusterId The identifier of the cluster for which to list the instances.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public ListInstancesRequest withClusterId(String clusterId) {
         this. = clusterId;
         return this;
     }

    
The identifier of the instance group for which to list the instances.

Returns:
The identifier of the instance group for which to list the instances.
 
     public String getInstanceGroupId() {
         return ;
     }
    
    
The identifier of the instance group for which to list the instances.

Parameters:
instanceGroupId The identifier of the instance group for which to list the instances.
    public void setInstanceGroupId(String instanceGroupId) {
        this. = instanceGroupId;
    }
    
    
The identifier of the instance group for which to list the instances.

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

Parameters:
instanceGroupId The identifier of the instance group for which to list the instances.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ListInstancesRequest withInstanceGroupId(String instanceGroupId) {
        this. = instanceGroupId;
        return this;
    }

    
The type of instance group for which to list the instances.

Returns:
The type of instance group for which to list the instances.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
The type of instance group for which to list the instances.

Parameters:
instanceGroupTypes The type of instance group for which to list the instances.
    public void setInstanceGroupTypes(java.util.Collection<StringinstanceGroupTypes) {
        if (instanceGroupTypes == null) {
            this. = null;
            return;
        }
        com.amazonaws.internal.ListWithAutoConstructFlag<StringinstanceGroupTypesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(instanceGroupTypes.size());
        instanceGroupTypesCopy.addAll(instanceGroupTypes);
        this. = instanceGroupTypesCopy;
    }
    
    
The type of instance group for which to list the instances.

NOTE: This method appends the values to the existing list (if any). Use setInstanceGroupTypes(java.util.Collection) or withInstanceGroupTypes(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:
instanceGroupTypes The type of instance group for which to list the instances.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ListInstancesRequest withInstanceGroupTypes(String... instanceGroupTypes) {
        if (getInstanceGroupTypes() == nullsetInstanceGroupTypes(new java.util.ArrayList<String>(instanceGroupTypes.length));
        for (String value : instanceGroupTypes) {
            getInstanceGroupTypes().add(value);
        }
        return this;
    }
    
    
The type of instance group for which to list the instances.

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

Parameters:
instanceGroupTypes The type of instance group for which to list the instances.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ListInstancesRequest withInstanceGroupTypes(java.util.Collection<StringinstanceGroupTypes) {
        if (instanceGroupTypes == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<StringinstanceGroupTypesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(instanceGroupTypes.size());
            instanceGroupTypesCopy.addAll(instanceGroupTypes);
            this. = instanceGroupTypesCopy;
        }
        return this;
    }

    
The type of instance group for which to list the instances.

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

Parameters:
instanceGroupTypes The type of instance group for which to list the instances.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ListInstancesRequest withInstanceGroupTypes(InstanceGroupType... instanceGroupTypes) {
        java.util.ArrayList<StringinstanceGroupTypesCopy = new java.util.ArrayList<String>(instanceGroupTypes.length);
        for (InstanceGroupType member : instanceGroupTypes) {
            instanceGroupTypesCopy.add(member.toString());
        }
        if (getInstanceGroupTypes() == null) {
            setInstanceGroupTypes(instanceGroupTypesCopy);
        } else {
            getInstanceGroupTypes().addAll(instanceGroupTypesCopy);
        }
        return this;
    }

    
The pagination token that indicates the next set of results to retrieve.

Returns:
The pagination token that indicates the next set of results to retrieve.
    public String getMarker() {
        return ;
    }
    
    
The pagination token that indicates the next set of results to retrieve.

Parameters:
marker The pagination token that indicates the next set of results to retrieve.
    public void setMarker(String marker) {
        this. = marker;
    }
    
    
The pagination token that indicates the next set of results to retrieve.

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

Parameters:
marker The pagination token that indicates the next set of results to retrieve.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ListInstancesRequest withMarker(String marker) {
        this. = marker;
        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 (getClusterId() != nullsb.append("ClusterId: " + getClusterId() + ",");
        if (getInstanceGroupId() != nullsb.append("InstanceGroupId: " + getInstanceGroupId() + ",");
        if (getInstanceGroupTypes() != nullsb.append("InstanceGroupTypes: " + getInstanceGroupTypes() + ",");
        if (getMarker() != nullsb.append("Marker: " + getMarker() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getClusterId() == null) ? 0 : getClusterId().hashCode()); 
        hashCode = prime * hashCode + ((getInstanceGroupId() == null) ? 0 : getInstanceGroupId().hashCode()); 
        hashCode = prime * hashCode + ((getInstanceGroupTypes() == null) ? 0 : getInstanceGroupTypes().hashCode()); 
        hashCode = prime * hashCode + ((getMarker() == null) ? 0 : getMarker().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof ListInstancesRequest == falsereturn false;
        ListInstancesRequest other = (ListInstancesRequest)obj;
        
        if (other.getClusterId() == null ^ this.getClusterId() == nullreturn false;
        if (other.getClusterId() != null && other.getClusterId().equals(this.getClusterId()) == falsereturn false
        if (other.getInstanceGroupId() == null ^ this.getInstanceGroupId() == nullreturn false;
        if (other.getInstanceGroupId() != null && other.getInstanceGroupId().equals(this.getInstanceGroupId()) == falsereturn false
        if (other.getInstanceGroupTypes() == null ^ this.getInstanceGroupTypes() == nullreturn false;
        if (other.getInstanceGroupTypes() != null && other.getInstanceGroupTypes().equals(this.getInstanceGroupTypes()) == falsereturn false
        if (other.getMarker() == null ^ this.getMarker() == nullreturn false;
        if (other.getMarker() != null && other.getMarker().equals(this.getMarker()) == falsereturn false
        return true;
    }
    
    @Override
    public ListInstancesRequest clone() {
        
            return (ListInstancesRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X