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

Contains the response to a DescribeDeployments request.

 
 public class DescribeDeploymentsResult implements SerializableCloneable {

    
An array of Deployment objects that describe the deployments.
 
An array of Deployment objects that describe the deployments.

Returns:
An array of Deployment objects that describe the deployments.
 
     public java.util.List<DeploymentgetDeployments() {
         if ( == null) {
                = new com.amazonaws.internal.ListWithAutoConstructFlag<Deployment>();
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
An array of Deployment objects that describe the deployments.

Parameters:
deployments An array of Deployment objects that describe the deployments.
 
     public void setDeployments(java.util.Collection<Deploymentdeployments) {
         if (deployments == null) {
             this. = null;
             return;
         }
         deploymentsCopy.addAll(deployments);
         this. = deploymentsCopy;
     }
    
    
An array of Deployment objects that describe the deployments.

NOTE: This method appends the values to the existing list (if any). Use setDeployments(java.util.Collection) or withDeployments(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:
deployments An array of Deployment objects that describe the deployments.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public DescribeDeploymentsResult withDeployments(Deployment... deployments) {
         if (getDeployments() == nullsetDeployments(new java.util.ArrayList<Deployment>(deployments.length));
         for (Deployment value : deployments) {
             getDeployments().add(value);
         }
         return this;
     }
    
    
An array of Deployment objects that describe the deployments.

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

Parameters:
deployments An array of Deployment objects that describe the deployments.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (deployments == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<DeploymentdeploymentsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<Deployment>(deployments.size());
            deploymentsCopy.addAll(deployments);
            this. = deploymentsCopy;
        }
        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 (getDeployments() != nullsb.append("Deployments: " + getDeployments() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getDeployments() == null) ? 0 : getDeployments().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof DescribeDeploymentsResult == falsereturn false;
        
        if (other.getDeployments() == null ^ this.getDeployments() == nullreturn false;
        if (other.getDeployments() != null && other.getDeployments().equals(this.getDeployments()) == falsereturn false
        return true;
    }
    
    @Override
    public DescribeDeploymentsResult clone() {
        try {
            return (DescribeDeploymentsResultsuper.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