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 command.

 
 public class Command implements SerializableCloneable {

    
The command ID.
 
     private String commandId;

    
The ID of the instance where the command was executed.
 
     private String instanceId;

    
The command deployment ID.
 
     private String deploymentId;

    
Date and time when the command was run.
 
     private String createdAt;

    
Date and time when the command was acknowledged.
 
     private String acknowledgedAt;

    
Date when the command completed.
 
     private String completedAt;

    
The command status:
  • failed
  • successful
  • skipped
  • pending
 
     private String status;

    
The command exit code.
 
     private Integer exitCode;

    
The URL of the command log.
 
     private String logUrl;

    
The command type:
  • deploy
  • rollback
  • start
  • stop
  • restart
  • undeploy
  • update_dependencies
  • install_dependencies
  • update_custom_cookbooks
  • execute_recipes
 
     private String type;

    
The command ID.

Returns:
The command ID.
 
     public String getCommandId() {
         return ;
     }
    
    
The command ID.

Parameters:
commandId The command ID.
 
     public void setCommandId(String commandId) {
         this. = commandId;
    }
    
    
The command ID.

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

Parameters:
commandId The command ID.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Command withCommandId(String commandId) {
        this. = commandId;
        return this;
    }

    
The ID of the instance where the command was executed.

Returns:
The ID of the instance where the command was executed.
    public String getInstanceId() {
        return ;
    }
    
    
The ID of the instance where the command was executed.

Parameters:
instanceId The ID of the instance where the command was executed.
    public void setInstanceId(String instanceId) {
        this. = instanceId;
    }
    
    
The ID of the instance where the command was executed.

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

Parameters:
instanceId The ID of the instance where the command was executed.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Command withInstanceId(String instanceId) {
        this. = instanceId;
        return this;
    }

    
The command deployment ID.

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

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

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

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

    
Date and time when the command was run.

Returns:
Date and time when the command was run.
    public String getCreatedAt() {
        return ;
    }
    
    
Date and time when the command was run.

Parameters:
createdAt Date and time when the command was run.
    public void setCreatedAt(String createdAt) {
        this. = createdAt;
    }
    
    
Date and time when the command was run.

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

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

    
Date and time when the command was acknowledged.

Returns:
Date and time when the command was acknowledged.
    public String getAcknowledgedAt() {
        return ;
    }
    
    
Date and time when the command was acknowledged.

Parameters:
acknowledgedAt Date and time when the command was acknowledged.
    public void setAcknowledgedAt(String acknowledgedAt) {
        this. = acknowledgedAt;
    }
    
    
Date and time when the command was acknowledged.

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

Parameters:
acknowledgedAt Date and time when the command was acknowledged.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Command withAcknowledgedAt(String acknowledgedAt) {
        this. = acknowledgedAt;
        return this;
    }

    
Date when the command completed.

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

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

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

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

    
The command status:
  • failed
  • successful
  • skipped
  • pending

Returns:
The command status:
  • failed
  • successful
  • skipped
  • pending
    public String getStatus() {
        return ;
    }
    
    
The command status:
  • failed
  • successful
  • skipped
  • pending

Parameters:
status The command status:
  • failed
  • successful
  • skipped
  • pending
    public void setStatus(String status) {
        this. = status;
    }
    
    
The command status:
  • failed
  • successful
  • skipped
  • pending

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

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

    
The command exit code.

Returns:
The command exit code.
    public Integer getExitCode() {
        return ;
    }
    
    
The command exit code.

Parameters:
exitCode The command exit code.
    public void setExitCode(Integer exitCode) {
        this. = exitCode;
    }
    
    
The command exit code.

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

Parameters:
exitCode The command exit code.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Command withExitCode(Integer exitCode) {
        this. = exitCode;
        return this;
    }

    
The URL of the command log.

Returns:
The URL of the command log.
    public String getLogUrl() {
        return ;
    }
    
    
The URL of the command log.

Parameters:
logUrl The URL of the command log.
    public void setLogUrl(String logUrl) {
        this. = logUrl;
    }
    
    
The URL of the command log.

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

Parameters:
logUrl The URL of the command log.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Command withLogUrl(String logUrl) {
        this. = logUrl;
        return this;
    }

    
The command type:
  • deploy
  • rollback
  • start
  • stop
  • restart
  • undeploy
  • update_dependencies
  • install_dependencies
  • update_custom_cookbooks
  • execute_recipes

Returns:
The command type:
  • deploy
  • rollback
  • start
  • stop
  • restart
  • undeploy
  • update_dependencies
  • install_dependencies
  • update_custom_cookbooks
  • execute_recipes
    public String getType() {
        return ;
    }
    
    
The command type:
  • deploy
  • rollback
  • start
  • stop
  • restart
  • undeploy
  • update_dependencies
  • install_dependencies
  • update_custom_cookbooks
  • execute_recipes

Parameters:
type The command type:
  • deploy
  • rollback
  • start
  • stop
  • restart
  • undeploy
  • update_dependencies
  • install_dependencies
  • update_custom_cookbooks
  • execute_recipes
    public void setType(String type) {
        this. = type;
    }
    
    
The command type:
  • deploy
  • rollback
  • start
  • stop
  • restart
  • undeploy
  • update_dependencies
  • install_dependencies
  • update_custom_cookbooks
  • execute_recipes

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

Parameters:
type The command type:
  • deploy
  • rollback
  • start
  • stop
  • restart
  • undeploy
  • update_dependencies
  • install_dependencies
  • update_custom_cookbooks
  • execute_recipes
Returns:
A reference to this updated object so that method calls can be chained together.
    public Command withType(String type) {
        this. = type;
        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 (getCommandId() != nullsb.append("CommandId: " + getCommandId() + ",");
        if (getInstanceId() != nullsb.append("InstanceId: " + getInstanceId() + ",");
        if (getDeploymentId() != nullsb.append("DeploymentId: " + getDeploymentId() + ",");
        if (getCreatedAt() != nullsb.append("CreatedAt: " + getCreatedAt() + ",");
        if (getAcknowledgedAt() != nullsb.append("AcknowledgedAt: " + getAcknowledgedAt() + ",");
        if (getCompletedAt() != nullsb.append("CompletedAt: " + getCompletedAt() + ",");
        if (getStatus() != nullsb.append("Status: " + getStatus() + ",");
        if (getExitCode() != nullsb.append("ExitCode: " + getExitCode() + ",");
        if (getLogUrl() != nullsb.append("LogUrl: " + getLogUrl() + ",");
        if (getType() != nullsb.append("Type: " + getType() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getCommandId() == null) ? 0 : getCommandId().hashCode()); 
        hashCode = prime * hashCode + ((getInstanceId() == null) ? 0 : getInstanceId().hashCode()); 
        hashCode = prime * hashCode + ((getDeploymentId() == null) ? 0 : getDeploymentId().hashCode()); 
        hashCode = prime * hashCode + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode()); 
        hashCode = prime * hashCode + ((getAcknowledgedAt() == null) ? 0 : getAcknowledgedAt().hashCode()); 
        hashCode = prime * hashCode + ((getCompletedAt() == null) ? 0 : getCompletedAt().hashCode()); 
        hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); 
        hashCode = prime * hashCode + ((getExitCode() == null) ? 0 : getExitCode().hashCode()); 
        hashCode = prime * hashCode + ((getLogUrl() == null) ? 0 : getLogUrl().hashCode()); 
        hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof Command == falsereturn false;
        Command other = (Command)obj;
        
        if (other.getCommandId() == null ^ this.getCommandId() == nullreturn false;
        if (other.getCommandId() != null && other.getCommandId().equals(this.getCommandId()) == falsereturn false
        if (other.getInstanceId() == null ^ this.getInstanceId() == nullreturn false;
        if (other.getInstanceId() != null && other.getInstanceId().equals(this.getInstanceId()) == falsereturn false
        if (other.getDeploymentId() == null ^ this.getDeploymentId() == nullreturn false;
        if (other.getDeploymentId() != null && other.getDeploymentId().equals(this.getDeploymentId()) == falsereturn false
        if (other.getCreatedAt() == null ^ this.getCreatedAt() == nullreturn false;
        if (other.getCreatedAt() != null && other.getCreatedAt().equals(this.getCreatedAt()) == falsereturn false
        if (other.getAcknowledgedAt() == null ^ this.getAcknowledgedAt() == nullreturn false;
        if (other.getAcknowledgedAt() != null && other.getAcknowledgedAt().equals(this.getAcknowledgedAt()) == falsereturn false
        if (other.getCompletedAt() == null ^ this.getCompletedAt() == nullreturn false;
        if (other.getCompletedAt() != null && other.getCompletedAt().equals(this.getCompletedAt()) == falsereturn false
        if (other.getStatus() == null ^ this.getStatus() == nullreturn false;
        if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == falsereturn false
        if (other.getExitCode() == null ^ this.getExitCode() == nullreturn false;
        if (other.getExitCode() != null && other.getExitCode().equals(this.getExitCode()) == falsereturn false
        if (other.getLogUrl() == null ^ this.getLogUrl() == nullreturn false;
        if (other.getLogUrl() != null && other.getLogUrl().equals(this.getLogUrl()) == falsereturn false
        if (other.getType() == null ^ this.getType() == nullreturn false;
        if (other.getType() != null && other.getType().equals(this.getType()) == falsereturn false
        return true;
    }
    
    @Override
    public Command clone() {
        try {
            return (Commandsuper.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