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.ecs.model;
 
 
 public class DescribeClustersResult implements SerializableCloneable {

    
The list of clusters.
 
 
The list of clusters.

Returns:
The list of clusters.
 
     public java.util.List<ClustergetClusters() {
         if ( == null) {
                = new com.amazonaws.internal.ListWithAutoConstructFlag<Cluster>();
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
The list of clusters.

Parameters:
clusters The list of clusters.
 
     public void setClusters(java.util.Collection<Clusterclusters) {
         if (clusters == null) {
             this. = null;
             return;
         }
         clustersCopy.addAll(clusters);
         this. = clustersCopy;
     }
    
    
The list of clusters.

NOTE: This method appends the values to the existing list (if any). Use setClusters(java.util.Collection) or withClusters(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:
clusters The list of clusters.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public DescribeClustersResult withClusters(Cluster... clusters) {
         if (getClusters() == nullsetClusters(new java.util.ArrayList<Cluster>(clusters.length));
         for (Cluster value : clusters) {
             getClusters().add(value);
         }
         return this;
     }
    
    
The list of clusters.

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

Parameters:
clusters The list of clusters.
Returns:
A reference to this updated object so that method calls can be chained together.
 
         if (clusters == null) {
             this. = null;
         } else {
             com.amazonaws.internal.ListWithAutoConstructFlag<ClusterclustersCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<Cluster>(clusters.size());
            clustersCopy.addAll(clusters);
            this. = clustersCopy;
        }
        return this;
    }

    

Returns:
    public java.util.List<FailuregetFailures() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<Failure>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    

Parameters:
failures
    public void setFailures(java.util.Collection<Failurefailures) {
        if (failures == null) {
            this. = null;
            return;
        }
        failuresCopy.addAll(failures);
        this. = failuresCopy;
    }
    
    

NOTE: This method appends the values to the existing list (if any). Use setFailures(java.util.Collection) or withFailures(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:
failures
Returns:
A reference to this updated object so that method calls can be chained together.
    public DescribeClustersResult withFailures(Failure... failures) {
        if (getFailures() == nullsetFailures(new java.util.ArrayList<Failure>(failures.length));
        for (Failure value : failures) {
            getFailures().add(value);
        }
        return this;
    }
    
    

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

Parameters:
failures
Returns:
A reference to this updated object so that method calls can be chained together.
        if (failures == null) {
            this. = null;
        } else {
            failuresCopy.addAll(failures);
            this. = failuresCopy;
        }
        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 (getClusters() != nullsb.append("Clusters: " + getClusters() + ",");
        if (getFailures() != nullsb.append("Failures: " + getFailures() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getClusters() == null) ? 0 : getClusters().hashCode()); 
        hashCode = prime * hashCode + ((getFailures() == null) ? 0 : getFailures().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof DescribeClustersResult == falsereturn false;
        DescribeClustersResult other = (DescribeClustersResult)obj;
        
        if (other.getClusters() == null ^ this.getClusters() == nullreturn false;
        if (other.getClusters() != null && other.getClusters().equals(this.getClusters()) == falsereturn false
        if (other.getFailures() == null ^ this.getFailures() == nullreturn false;
        if (other.getFailures() != null && other.getFailures().equals(this.getFailures()) == falsereturn false
        return true;
    }
    
    @Override
    public DescribeClustersResult clone() {
        try {
            return (DescribeClustersResultsuper.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