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;
 

Describes a deployment of a stack or app.

 
 public class Deployment implements SerializableCloneable {

    
The deployment ID.
 
     private String deploymentId;

    
The stack ID.
 
     private String stackId;

    
The app ID.
 
     private String appId;

    
Date when the deployment was created.
 
     private String createdAt;

    
Date when the deployment completed.
 
     private String completedAt;

    
The deployment duration.
 
     private Integer duration;

    
The user's IAM ARN.
 
     private String iamUserArn;

    
A user-defined comment.
 
     private String comment;

    
Used to specify a stack or deployment command.
 
     private DeploymentCommand command;

    
The deployment status:
  • running
  • successful
  • failed
 
     private String status;

    
A string that contains user-defined custom JSON. It is used to override the corresponding default stack configuration JSON values for stack. The string should be in the following format and must escape characters such as '"'.:

"{\"key1\": \"value1\", \"key2\": \"value2\",...}"

For more information on custom JSON, see Use Custom JSON to Modify the Stack Configuration JSON.

 
     private String customJson;

    
The IDs of the target instances.
 
The deployment ID.

Returns:
The deployment ID.
 
     public String getDeploymentId() {
         return ;
    }
    
    
The deployment ID.

Parameters:
deploymentId The deployment ID.
    public void setDeploymentId(String deploymentId) {
        this. = deploymentId;
    }
    
    
The deployment ID.

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

Parameters:
deploymentId The deployment ID.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Deployment withDeploymentId(String deploymentId) {
        this. = deploymentId;
        return this;
    }

    
The stack ID.

Returns:
The stack ID.
    public String getStackId() {
        return ;
    }
    
    
The stack ID.

Parameters:
stackId The stack ID.
    public void setStackId(String stackId) {
        this. = stackId;
    }
    
    
The stack ID.

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

Parameters:
stackId The stack ID.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Deployment withStackId(String stackId) {
        this. = stackId;
        return this;
    }

    
The app ID.

Returns:
The app ID.
    public String getAppId() {
        return ;
    }
    
    
The app ID.

Parameters:
appId The app ID.
    public void setAppId(String appId) {
        this. = appId;
    }
    
    
The app ID.

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

Parameters:
appId The app ID.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Deployment withAppId(String appId) {
        this. = appId;
        return this;
    }

    
Date when the deployment was created.

Returns:
Date when the deployment was created.
    public String getCreatedAt() {
        return ;
    }
    
    
Date when the deployment was created.

Parameters:
createdAt Date when the deployment was created.
    public void setCreatedAt(String createdAt) {
        this. = createdAt;
    }
    
    
Date when the deployment was created.

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

Parameters:
createdAt Date when the deployment was created.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Deployment withCreatedAt(String createdAt) {
        this. = createdAt;
        return this;
    }

    
Date when the deployment completed.

Returns:
Date when the deployment completed.
    public String getCompletedAt() {
        return ;
    }
    
    
Date when the deployment completed.

Parameters:
completedAt Date when the deployment completed.
    public void setCompletedAt(String completedAt) {
        this. = completedAt;
    }
    
    
Date when the deployment completed.

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

Parameters:
completedAt Date when the deployment completed.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Deployment withCompletedAt(String completedAt) {
        this. = completedAt;
        return this;
    }

    
The deployment duration.

Returns:
The deployment duration.
    public Integer getDuration() {
        return ;
    }
    
    
The deployment duration.

Parameters:
duration The deployment duration.
    public void setDuration(Integer duration) {
        this. = duration;
    }
    
    
The deployment duration.

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

Parameters:
duration The deployment duration.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Deployment withDuration(Integer duration) {
        this. = duration;
        return this;
    }

    
The user's IAM ARN.

Returns:
The user's IAM ARN.
    public String getIamUserArn() {
        return ;
    }
    
    
The user's IAM ARN.

Parameters:
iamUserArn The user's IAM ARN.
    public void setIamUserArn(String iamUserArn) {
        this. = iamUserArn;
    }
    
    
The user's IAM ARN.

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

Parameters:
iamUserArn The user's IAM ARN.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Deployment withIamUserArn(String iamUserArn) {
        this. = iamUserArn;
        return this;
    }

    
A user-defined comment.

Returns:
A user-defined comment.
    public String getComment() {
        return ;
    }
    
    
A user-defined comment.

Parameters:
comment A user-defined comment.
    public void setComment(String comment) {
        this. = comment;
    }
    
    
A user-defined comment.

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

Parameters:
comment A user-defined comment.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Deployment withComment(String comment) {
        this. = comment;
        return this;
    }

    
Used to specify a stack or deployment command.

Returns:
Used to specify a stack or deployment command.
    public DeploymentCommand getCommand() {
        return ;
    }
    
    
Used to specify a stack or deployment command.

Parameters:
command Used to specify a stack or deployment command.
    public void setCommand(DeploymentCommand command) {
        this. = command;
    }
    
    
Used to specify a stack or deployment command.

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

Parameters:
command Used to specify a stack or deployment command.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Deployment withCommand(DeploymentCommand command) {
        this. = command;
        return this;
    }

    
The deployment status:
  • running
  • successful
  • failed

Returns:
The deployment status:
  • running
  • successful
  • failed
    public String getStatus() {
        return ;
    }
    
    
The deployment status:
  • running
  • successful
  • failed

Parameters:
status The deployment status:
  • running
  • successful
  • failed
    public void setStatus(String status) {
        this. = status;
    }
    
    
The deployment status:
  • running
  • successful
  • failed

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

Parameters:
status The deployment status:
  • running
  • successful
  • failed
Returns:
A reference to this updated object so that method calls can be chained together.
    public Deployment withStatus(String status) {
        this. = status;
        return this;
    }

    
A string that contains user-defined custom JSON. It is used to override the corresponding default stack configuration JSON values for stack. The string should be in the following format and must escape characters such as '"'.:

"{\"key1\": \"value1\", \"key2\": \"value2\",...}"

For more information on custom JSON, see Use Custom JSON to Modify the Stack Configuration JSON.

Returns:
A string that contains user-defined custom JSON. It is used to override the corresponding default stack configuration JSON values for stack. The string should be in the following format and must escape characters such as '"'.:

"{\"key1\": \"value1\", \"key2\": \"value2\",...}"

For more information on custom JSON, see Use Custom JSON to Modify the Stack Configuration JSON.

    public String getCustomJson() {
        return ;
    }
    
    
A string that contains user-defined custom JSON. It is used to override the corresponding default stack configuration JSON values for stack. The string should be in the following format and must escape characters such as '"'.:

"{\"key1\": \"value1\", \"key2\": \"value2\",...}"

For more information on custom JSON, see Use Custom JSON to Modify the Stack Configuration JSON.

Parameters:
customJson A string that contains user-defined custom JSON. It is used to override the corresponding default stack configuration JSON values for stack. The string should be in the following format and must escape characters such as '"'.:

"{\"key1\": \"value1\", \"key2\": \"value2\",...}"

For more information on custom JSON, see Use Custom JSON to Modify the Stack Configuration JSON.

    public void setCustomJson(String customJson) {
        this. = customJson;
    }
    
    
A string that contains user-defined custom JSON. It is used to override the corresponding default stack configuration JSON values for stack. The string should be in the following format and must escape characters such as '"'.:

"{\"key1\": \"value1\", \"key2\": \"value2\",...}"

For more information on custom JSON, see Use Custom JSON to Modify the Stack Configuration JSON.

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

Parameters:
customJson A string that contains user-defined custom JSON. It is used to override the corresponding default stack configuration JSON values for stack. The string should be in the following format and must escape characters such as '"'.:

"{\"key1\": \"value1\", \"key2\": \"value2\",...}"

For more information on custom JSON, see Use Custom JSON to Modify the Stack Configuration JSON.

Returns:
A reference to this updated object so that method calls can be chained together.
    public Deployment withCustomJson(String customJson) {
        this. = customJson;
        return this;
    }

    
The IDs of the target instances.

Returns:
The IDs of the target instances.
    public java.util.List<StringgetInstanceIds() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
The IDs of the target instances.

Parameters:
instanceIds The IDs of the target instances.
    public void setInstanceIds(java.util.Collection<StringinstanceIds) {
        if (instanceIds == null) {
            this. = null;
            return;
        }
        instanceIdsCopy.addAll(instanceIds);
        this. = instanceIdsCopy;
    }
    
    
The IDs of the target instances.

NOTE: This method appends the values to the existing list (if any). Use setInstanceIds(java.util.Collection) or withInstanceIds(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:
instanceIds The IDs of the target instances.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Deployment withInstanceIds(String... instanceIds) {
        if (getInstanceIds() == nullsetInstanceIds(new java.util.ArrayList<String>(instanceIds.length));
        for (String value : instanceIds) {
            getInstanceIds().add(value);
        }
        return this;
    }
    
    
The IDs of the target instances.

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

Parameters:
instanceIds The IDs of the target instances.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Deployment withInstanceIds(java.util.Collection<StringinstanceIds) {
        if (instanceIds == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<StringinstanceIdsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(instanceIds.size());
            instanceIdsCopy.addAll(instanceIds);
            this. = instanceIdsCopy;
        }
        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 (getDeploymentId() != nullsb.append("DeploymentId: " + getDeploymentId() + ",");
        if (getStackId() != nullsb.append("StackId: " + getStackId() + ",");
        if (getAppId() != nullsb.append("AppId: " + getAppId() + ",");
        if (getCreatedAt() != nullsb.append("CreatedAt: " + getCreatedAt() + ",");
        if (getCompletedAt() != nullsb.append("CompletedAt: " + getCompletedAt() + ",");
        if (getDuration() != nullsb.append("Duration: " + getDuration() + ",");
        if (getIamUserArn() != nullsb.append("IamUserArn: " + getIamUserArn() + ",");
        if (getComment() != nullsb.append("Comment: " + getComment() + ",");
        if (getCommand() != nullsb.append("Command: " + getCommand() + ",");
        if (getStatus() != nullsb.append("Status: " + getStatus() + ",");
        if (getCustomJson() != nullsb.append("CustomJson: " + getCustomJson() + ",");
        if (getInstanceIds() != nullsb.append("InstanceIds: " + getInstanceIds() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getDeploymentId() == null) ? 0 : getDeploymentId().hashCode()); 
        hashCode = prime * hashCode + ((getStackId() == null) ? 0 : getStackId().hashCode()); 
        hashCode = prime * hashCode + ((getAppId() == null) ? 0 : getAppId().hashCode()); 
        hashCode = prime * hashCode + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode()); 
        hashCode = prime * hashCode + ((getCompletedAt() == null) ? 0 : getCompletedAt().hashCode()); 
        hashCode = prime * hashCode + ((getDuration() == null) ? 0 : getDuration().hashCode()); 
        hashCode = prime * hashCode + ((getIamUserArn() == null) ? 0 : getIamUserArn().hashCode()); 
        hashCode = prime * hashCode + ((getComment() == null) ? 0 : getComment().hashCode()); 
        hashCode = prime * hashCode + ((getCommand() == null) ? 0 : getCommand().hashCode()); 
        hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); 
        hashCode = prime * hashCode + ((getCustomJson() == null) ? 0 : getCustomJson().hashCode()); 
        hashCode = prime * hashCode + ((getInstanceIds() == null) ? 0 : getInstanceIds().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof Deployment == falsereturn false;
        Deployment other = (Deployment)obj;
        
        if (other.getDeploymentId() == null ^ this.getDeploymentId() == nullreturn false;
        if (other.getDeploymentId() != null && other.getDeploymentId().equals(this.getDeploymentId()) == falsereturn false
        if (other.getStackId() == null ^ this.getStackId() == nullreturn false;
        if (other.getStackId() != null && other.getStackId().equals(this.getStackId()) == falsereturn false
        if (other.getAppId() == null ^ this.getAppId() == nullreturn false;
        if (other.getAppId() != null && other.getAppId().equals(this.getAppId()) == falsereturn false
        if (other.getCreatedAt() == null ^ this.getCreatedAt() == nullreturn false;
        if (other.getCreatedAt() != null && other.getCreatedAt().equals(this.getCreatedAt()) == falsereturn false
        if (other.getCompletedAt() == null ^ this.getCompletedAt() == nullreturn false;
        if (other.getCompletedAt() != null && other.getCompletedAt().equals(this.getCompletedAt()) == falsereturn false
        if (other.getDuration() == null ^ this.getDuration() == nullreturn false;
        if (other.getDuration() != null && other.getDuration().equals(this.getDuration()) == falsereturn false
        if (other.getIamUserArn() == null ^ this.getIamUserArn() == nullreturn false;
        if (other.getIamUserArn() != null && other.getIamUserArn().equals(this.getIamUserArn()) == falsereturn false
        if (other.getComment() == null ^ this.getComment() == nullreturn false;
        if (other.getComment() != null && other.getComment().equals(this.getComment()) == falsereturn false
        if (other.getCommand() == null ^ this.getCommand() == nullreturn false;
        if (other.getCommand() != null && other.getCommand().equals(this.getCommand()) == falsereturn false
        if (other.getStatus() == null ^ this.getStatus() == nullreturn false;
        if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == falsereturn false
        if (other.getCustomJson() == null ^ this.getCustomJson() == nullreturn false;
        if (other.getCustomJson() != null && other.getCustomJson().equals(this.getCustomJson()) == falsereturn false
        if (other.getInstanceIds() == null ^ this.getInstanceIds() == nullreturn false;
        if (other.getInstanceIds() != null && other.getInstanceIds().equals(this.getInstanceIds()) == falsereturn false
        return true;
    }
    
    @Override
    public Deployment clone() {
        try {
            return (Deploymentsuper.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