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

Information about an instance in a deployment.

 
 public class InstanceSummary implements SerializableCloneable {

    
The deployment ID.
 
     private String deploymentId;

    
The instance ID.
 
     private String instanceId;

    
The deployment status for this instance:
  • Pending: The deployment is pending for this instance.
  • In Progress: The deployment is in progress for this instance.
  • Succeeded: The deployment has succeeded for this instance.
  • Failed: The deployment has failed for this instance.
  • Skipped: The deployment has been skipped for this instance.
  • Unknown: The deployment status is unknown for this instance.

Constraints:
Allowed Values: Pending, InProgress, Succeeded, Failed, Skipped, Unknown

 
     private String status;

    
A timestamp indicating when the instance information was last updated.
 
     private java.util.Date lastUpdatedAt;

    
A list of lifecycle events for this instance.
 
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 InstanceSummary withDeploymentId(String deploymentId) {
         this. = deploymentId;
         return this;
     }

    
The instance ID.

Returns:
The instance ID.
 
     public String getInstanceId() {
         return ;
    }
    
    
The instance ID.

Parameters:
instanceId The instance ID.
    public void setInstanceId(String instanceId) {
        this. = instanceId;
    }
    
    
The instance ID.

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

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

    
The deployment status for this instance:
  • Pending: The deployment is pending for this instance.
  • In Progress: The deployment is in progress for this instance.
  • Succeeded: The deployment has succeeded for this instance.
  • Failed: The deployment has failed for this instance.
  • Skipped: The deployment has been skipped for this instance.
  • Unknown: The deployment status is unknown for this instance.

Constraints:
Allowed Values: Pending, InProgress, Succeeded, Failed, Skipped, Unknown

Returns:
The deployment status for this instance:
  • Pending: The deployment is pending for this instance.
  • In Progress: The deployment is in progress for this instance.
  • Succeeded: The deployment has succeeded for this instance.
  • Failed: The deployment has failed for this instance.
  • Skipped: The deployment has been skipped for this instance.
  • Unknown: The deployment status is unknown for this instance.
See also:
InstanceStatus
    public String getStatus() {
        return ;
    }
    
    
The deployment status for this instance:
  • Pending: The deployment is pending for this instance.
  • In Progress: The deployment is in progress for this instance.
  • Succeeded: The deployment has succeeded for this instance.
  • Failed: The deployment has failed for this instance.
  • Skipped: The deployment has been skipped for this instance.
  • Unknown: The deployment status is unknown for this instance.

Constraints:
Allowed Values: Pending, InProgress, Succeeded, Failed, Skipped, Unknown

Parameters:
status The deployment status for this instance:
  • Pending: The deployment is pending for this instance.
  • In Progress: The deployment is in progress for this instance.
  • Succeeded: The deployment has succeeded for this instance.
  • Failed: The deployment has failed for this instance.
  • Skipped: The deployment has been skipped for this instance.
  • Unknown: The deployment status is unknown for this instance.
See also:
InstanceStatus
    public void setStatus(String status) {
        this. = status;
    }
    
    
The deployment status for this instance:
  • Pending: The deployment is pending for this instance.
  • In Progress: The deployment is in progress for this instance.
  • Succeeded: The deployment has succeeded for this instance.
  • Failed: The deployment has failed for this instance.
  • Skipped: The deployment has been skipped for this instance.
  • Unknown: The deployment status is unknown for this instance.

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

Constraints:
Allowed Values: Pending, InProgress, Succeeded, Failed, Skipped, Unknown

Parameters:
status The deployment status for this instance:
  • Pending: The deployment is pending for this instance.
  • In Progress: The deployment is in progress for this instance.
  • Succeeded: The deployment has succeeded for this instance.
  • Failed: The deployment has failed for this instance.
  • Skipped: The deployment has been skipped for this instance.
  • Unknown: The deployment status is unknown for this instance.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
InstanceStatus
    public InstanceSummary withStatus(String status) {
        this. = status;
        return this;
    }

    
The deployment status for this instance:
  • Pending: The deployment is pending for this instance.
  • In Progress: The deployment is in progress for this instance.
  • Succeeded: The deployment has succeeded for this instance.
  • Failed: The deployment has failed for this instance.
  • Skipped: The deployment has been skipped for this instance.
  • Unknown: The deployment status is unknown for this instance.

Constraints:
Allowed Values: Pending, InProgress, Succeeded, Failed, Skipped, Unknown

Parameters:
status The deployment status for this instance:
  • Pending: The deployment is pending for this instance.
  • In Progress: The deployment is in progress for this instance.
  • Succeeded: The deployment has succeeded for this instance.
  • Failed: The deployment has failed for this instance.
  • Skipped: The deployment has been skipped for this instance.
  • Unknown: The deployment status is unknown for this instance.
See also:
InstanceStatus
    public void setStatus(InstanceStatus status) {
        this. = status.toString();
    }
    
    
The deployment status for this instance:
  • Pending: The deployment is pending for this instance.
  • In Progress: The deployment is in progress for this instance.
  • Succeeded: The deployment has succeeded for this instance.
  • Failed: The deployment has failed for this instance.
  • Skipped: The deployment has been skipped for this instance.
  • Unknown: The deployment status is unknown for this instance.

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

Constraints:
Allowed Values: Pending, InProgress, Succeeded, Failed, Skipped, Unknown

Parameters:
status The deployment status for this instance:
  • Pending: The deployment is pending for this instance.
  • In Progress: The deployment is in progress for this instance.
  • Succeeded: The deployment has succeeded for this instance.
  • Failed: The deployment has failed for this instance.
  • Skipped: The deployment has been skipped for this instance.
  • Unknown: The deployment status is unknown for this instance.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
InstanceStatus
    public InstanceSummary withStatus(InstanceStatus status) {
        this. = status.toString();
        return this;
    }

    
A timestamp indicating when the instance information was last updated.

Returns:
A timestamp indicating when the instance information was last updated.
    public java.util.Date getLastUpdatedAt() {
        return ;
    }
    
    
A timestamp indicating when the instance information was last updated.

Parameters:
lastUpdatedAt A timestamp indicating when the instance information was last updated.
    public void setLastUpdatedAt(java.util.Date lastUpdatedAt) {
        this. = lastUpdatedAt;
    }
    
    
A timestamp indicating when the instance information was last updated.

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

Parameters:
lastUpdatedAt A timestamp indicating when the instance information was last updated.
Returns:
A reference to this updated object so that method calls can be chained together.
    public InstanceSummary withLastUpdatedAt(java.util.Date lastUpdatedAt) {
        this. = lastUpdatedAt;
        return this;
    }

    
A list of lifecycle events for this instance.

Returns:
A list of lifecycle events for this instance.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
A list of lifecycle events for this instance.

Parameters:
lifecycleEvents A list of lifecycle events for this instance.
    public void setLifecycleEvents(java.util.Collection<LifecycleEventlifecycleEvents) {
        if (lifecycleEvents == null) {
            this. = null;
            return;
        }
        lifecycleEventsCopy.addAll(lifecycleEvents);
        this. = lifecycleEventsCopy;
    }
    
    
A list of lifecycle events for this instance.

NOTE: This method appends the values to the existing list (if any). Use setLifecycleEvents(java.util.Collection) or withLifecycleEvents(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:
lifecycleEvents A list of lifecycle events for this instance.
Returns:
A reference to this updated object so that method calls can be chained together.
    public InstanceSummary withLifecycleEvents(LifecycleEvent... lifecycleEvents) {
        if (getLifecycleEvents() == nullsetLifecycleEvents(new java.util.ArrayList<LifecycleEvent>(lifecycleEvents.length));
        for (LifecycleEvent value : lifecycleEvents) {
            getLifecycleEvents().add(value);
        }
        return this;
    }
    
    
A list of lifecycle events for this instance.

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

Parameters:
lifecycleEvents A list of lifecycle events for this instance.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (lifecycleEvents == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<LifecycleEventlifecycleEventsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<LifecycleEvent>(lifecycleEvents.size());
            lifecycleEventsCopy.addAll(lifecycleEvents);
            this. = lifecycleEventsCopy;
        }
        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 (getInstanceId() != nullsb.append("InstanceId: " + getInstanceId() + ",");
        if (getStatus() != nullsb.append("Status: " + getStatus() + ",");
        if (getLastUpdatedAt() != nullsb.append("LastUpdatedAt: " + getLastUpdatedAt() + ",");
        if (getLifecycleEvents() != nullsb.append("LifecycleEvents: " + getLifecycleEvents() );
        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 + ((getInstanceId() == null) ? 0 : getInstanceId().hashCode()); 
        hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); 
        hashCode = prime * hashCode + ((getLastUpdatedAt() == null) ? 0 : getLastUpdatedAt().hashCode()); 
        hashCode = prime * hashCode + ((getLifecycleEvents() == null) ? 0 : getLifecycleEvents().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof InstanceSummary == falsereturn false;
        InstanceSummary other = (InstanceSummary)obj;
        
        if (other.getDeploymentId() == null ^ this.getDeploymentId() == nullreturn false;
        if (other.getDeploymentId() != null && other.getDeploymentId().equals(this.getDeploymentId()) == falsereturn false
        if (other.getInstanceId() == null ^ this.getInstanceId() == nullreturn false;
        if (other.getInstanceId() != null && other.getInstanceId().equals(this.getInstanceId()) == falsereturn false
        if (other.getStatus() == null ^ this.getStatus() == nullreturn false;
        if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == falsereturn false
        if (other.getLastUpdatedAt() == null ^ this.getLastUpdatedAt() == nullreturn false;
        if (other.getLastUpdatedAt() != null && other.getLastUpdatedAt().equals(this.getLastUpdatedAt()) == falsereturn false
        if (other.getLifecycleEvents() == null ^ this.getLifecycleEvents() == nullreturn false;
        if (other.getLifecycleEvents() != null && other.getLifecycleEvents().equals(this.getLifecycleEvents()) == falsereturn false
        return true;
    }
    
    @Override
    public InstanceSummary clone() {
        try {
            return (InstanceSummarysuper.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