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 ListClusters operation.

Provides the status of all clusters visible to this AWS account. Allows you to filter the list of clusters based on certain criteria; for example, filtering by cluster creation date and time or by status. This call returns a maximum of 50 clusters per call, but returns a marker to track the paging of the cluster list across multiple ListClusters calls.

 
 public class ListClustersRequest extends AmazonWebServiceRequest implements SerializableCloneable {

    
The creation date and time beginning value filter for listing clusters .
 
     private java.util.Date createdAfter;

    
The creation date and time end value filter for listing clusters .
 
     private java.util.Date createdBefore;

    
The cluster state filters to apply when listing clusters.
 
The pagination token that indicates the next set of results to retrieve.
 
     private String marker;

    
The creation date and time beginning value filter for listing clusters .

Returns:
The creation date and time beginning value filter for listing clusters .
 
     public java.util.Date getCreatedAfter() {
         return ;
     }
    
    
The creation date and time beginning value filter for listing clusters .

Parameters:
createdAfter The creation date and time beginning value filter for listing clusters .
 
     public void setCreatedAfter(java.util.Date createdAfter) {
         this. = createdAfter;
     }
    
    
The creation date and time beginning value filter for listing clusters .

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

Parameters:
createdAfter The creation date and time beginning value filter for listing clusters .
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public ListClustersRequest withCreatedAfter(java.util.Date createdAfter) {
         this. = createdAfter;
         return this;
     }

    
The creation date and time end value filter for listing clusters .

Returns:
The creation date and time end value filter for listing clusters .
    public java.util.Date getCreatedBefore() {
        return ;
    }
    
    
The creation date and time end value filter for listing clusters .

Parameters:
createdBefore The creation date and time end value filter for listing clusters .
    public void setCreatedBefore(java.util.Date createdBefore) {
        this. = createdBefore;
    }
    
    
The creation date and time end value filter for listing clusters .

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

Parameters:
createdBefore The creation date and time end value filter for listing clusters .
Returns:
A reference to this updated object so that method calls can be chained together.
    public ListClustersRequest withCreatedBefore(java.util.Date createdBefore) {
        this. = createdBefore;
        return this;
    }

    
The cluster state filters to apply when listing clusters.

Returns:
The cluster state filters to apply when listing clusters.
    public java.util.List<StringgetClusterStates() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
The cluster state filters to apply when listing clusters.

Parameters:
clusterStates The cluster state filters to apply when listing clusters.
    public void setClusterStates(java.util.Collection<StringclusterStates) {
        if (clusterStates == null) {
            this. = null;
            return;
        }
        com.amazonaws.internal.ListWithAutoConstructFlag<StringclusterStatesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(clusterStates.size());
        clusterStatesCopy.addAll(clusterStates);
        this. = clusterStatesCopy;
    }
    
    
The cluster state filters to apply when listing clusters.

NOTE: This method appends the values to the existing list (if any). Use setClusterStates(java.util.Collection) or withClusterStates(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:
clusterStates The cluster state filters to apply when listing clusters.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ListClustersRequest withClusterStates(String... clusterStates) {
        if (getClusterStates() == nullsetClusterStates(new java.util.ArrayList<String>(clusterStates.length));
        for (String value : clusterStates) {
            getClusterStates().add(value);
        }
        return this;
    }
    
    
The cluster state filters to apply when listing clusters.

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

Parameters:
clusterStates The cluster state filters to apply when listing clusters.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ListClustersRequest withClusterStates(java.util.Collection<StringclusterStates) {
        if (clusterStates == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<StringclusterStatesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(clusterStates.size());
            clusterStatesCopy.addAll(clusterStates);
            this. = clusterStatesCopy;
        }
        return this;
    }

    
The cluster state filters to apply when listing clusters.

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

Parameters:
clusterStates The cluster state filters to apply when listing clusters.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ListClustersRequest withClusterStates(ClusterState... clusterStates) {
        java.util.ArrayList<StringclusterStatesCopy = new java.util.ArrayList<String>(clusterStates.length);
        for (ClusterState member : clusterStates) {
            clusterStatesCopy.add(member.toString());
        }
        if (getClusterStates() == null) {
            setClusterStates(clusterStatesCopy);
        } else {
            getClusterStates().addAll(clusterStatesCopy);
        }
        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 ListClustersRequest 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 (getCreatedAfter() != nullsb.append("CreatedAfter: " + getCreatedAfter() + ",");
        if (getCreatedBefore() != nullsb.append("CreatedBefore: " + getCreatedBefore() + ",");
        if (getClusterStates() != nullsb.append("ClusterStates: " + getClusterStates() + ",");
        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 + ((getCreatedAfter() == null) ? 0 : getCreatedAfter().hashCode()); 
        hashCode = prime * hashCode + ((getCreatedBefore() == null) ? 0 : getCreatedBefore().hashCode()); 
        hashCode = prime * hashCode + ((getClusterStates() == null) ? 0 : getClusterStates().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 ListClustersRequest == falsereturn false;
        ListClustersRequest other = (ListClustersRequest)obj;
        
        if (other.getCreatedAfter() == null ^ this.getCreatedAfter() == nullreturn false;
        if (other.getCreatedAfter() != null && other.getCreatedAfter().equals(this.getCreatedAfter()) == falsereturn false
        if (other.getCreatedBefore() == null ^ this.getCreatedBefore() == nullreturn false;
        if (other.getCreatedBefore() != null && other.getCreatedBefore().equals(this.getCreatedBefore()) == falsereturn false
        if (other.getClusterStates() == null ^ this.getClusterStates() == nullreturn false;
        if (other.getClusterStates() != null && other.getClusterStates().equals(this.getClusterStates()) == 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 ListClustersRequest clone() {
        
            return (ListClustersRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X