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

Describes an EC2 instance.

 
 public class Instance implements SerializableCloneable {

    
The ID of the instance.

Constraints:
Length: 1 - 16
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

 
     private String instanceId;

    
The Availability Zone in which the instance is running.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

 
     private String availabilityZone;

    
A description of the current lifecycle state. Note that the Quarantined state is not used.

Constraints:
Allowed Values: Pending, Pending:Wait, Pending:Proceed, Quarantined, InService, Terminating, Terminating:Wait, Terminating:Proceed, Terminated, Detaching, Detached, EnteringStandby, Standby

 
     private String lifecycleState;

    
The health status of the instance.

Constraints:
Length: 1 - 32
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

 
     private String healthStatus;

    
The launch configuration associated with the instance.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

 
     private String launchConfigurationName;

    
The ID of the instance.

Constraints:
Length: 1 - 16
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

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

Constraints:
Length: 1 - 16
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

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

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

Constraints:
Length: 1 - 16
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

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

    
The Availability Zone in which the instance is running.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Returns:
The Availability Zone in which the instance is running.
    public String getAvailabilityZone() {
        return ;
    }
    
    
The Availability Zone in which the instance is running.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
availabilityZone The Availability Zone in which the instance is running.
    public void setAvailabilityZone(String availabilityZone) {
        this. = availabilityZone;
    }
    
    
The Availability Zone in which the instance is running.

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

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
availabilityZone The Availability Zone in which the instance is running.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Instance withAvailabilityZone(String availabilityZone) {
        this. = availabilityZone;
        return this;
    }

    
A description of the current lifecycle state. Note that the Quarantined state is not used.

Constraints:
Allowed Values: Pending, Pending:Wait, Pending:Proceed, Quarantined, InService, Terminating, Terminating:Wait, Terminating:Proceed, Terminated, Detaching, Detached, EnteringStandby, Standby

Returns:
A description of the current lifecycle state. Note that the Quarantined state is not used.
See also:
LifecycleState
    public String getLifecycleState() {
        return ;
    }
    
    
A description of the current lifecycle state. Note that the Quarantined state is not used.

Constraints:
Allowed Values: Pending, Pending:Wait, Pending:Proceed, Quarantined, InService, Terminating, Terminating:Wait, Terminating:Proceed, Terminated, Detaching, Detached, EnteringStandby, Standby

Parameters:
lifecycleState A description of the current lifecycle state. Note that the Quarantined state is not used.
See also:
LifecycleState
    public void setLifecycleState(String lifecycleState) {
        this. = lifecycleState;
    }
    
    
A description of the current lifecycle state. Note that the Quarantined state is not used.

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

Constraints:
Allowed Values: Pending, Pending:Wait, Pending:Proceed, Quarantined, InService, Terminating, Terminating:Wait, Terminating:Proceed, Terminated, Detaching, Detached, EnteringStandby, Standby

Parameters:
lifecycleState A description of the current lifecycle state. Note that the Quarantined state is not used.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
LifecycleState
    public Instance withLifecycleState(String lifecycleState) {
        this. = lifecycleState;
        return this;
    }

    
A description of the current lifecycle state. Note that the Quarantined state is not used.

Constraints:
Allowed Values: Pending, Pending:Wait, Pending:Proceed, Quarantined, InService, Terminating, Terminating:Wait, Terminating:Proceed, Terminated, Detaching, Detached, EnteringStandby, Standby

Parameters:
lifecycleState A description of the current lifecycle state. Note that the Quarantined state is not used.
See also:
LifecycleState
    public void setLifecycleState(LifecycleState lifecycleState) {
        this. = lifecycleState.toString();
    }
    
    
A description of the current lifecycle state. Note that the Quarantined state is not used.

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

Constraints:
Allowed Values: Pending, Pending:Wait, Pending:Proceed, Quarantined, InService, Terminating, Terminating:Wait, Terminating:Proceed, Terminated, Detaching, Detached, EnteringStandby, Standby

Parameters:
lifecycleState A description of the current lifecycle state. Note that the Quarantined state is not used.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
LifecycleState
    public Instance withLifecycleState(LifecycleState lifecycleState) {
        this. = lifecycleState.toString();
        return this;
    }

    
The health status of the instance.

Constraints:
Length: 1 - 32
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Returns:
The health status of the instance.
    public String getHealthStatus() {
        return ;
    }
    
    
The health status of the instance.

Constraints:
Length: 1 - 32
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
healthStatus The health status of the instance.
    public void setHealthStatus(String healthStatus) {
        this. = healthStatus;
    }
    
    
The health status of the instance.

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

Constraints:
Length: 1 - 32
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
healthStatus The health status of the instance.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Instance withHealthStatus(String healthStatus) {
        this. = healthStatus;
        return this;
    }

    
The launch configuration associated with the instance.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Returns:
The launch configuration associated with the instance.
        return ;
    }
    
    
The launch configuration associated with the instance.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
launchConfigurationName The launch configuration associated with the instance.
    public void setLaunchConfigurationName(String launchConfigurationName) {
        this. = launchConfigurationName;
    }
    
    
The launch configuration associated with the instance.

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

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
launchConfigurationName The launch configuration associated with the instance.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Instance withLaunchConfigurationName(String launchConfigurationName) {
        this. = launchConfigurationName;
        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 (getInstanceId() != nullsb.append("InstanceId: " + getInstanceId() + ",");
        if (getAvailabilityZone() != nullsb.append("AvailabilityZone: " + getAvailabilityZone() + ",");
        if (getLifecycleState() != nullsb.append("LifecycleState: " + getLifecycleState() + ",");
        if (getHealthStatus() != nullsb.append("HealthStatus: " + getHealthStatus() + ",");
        if (getLaunchConfigurationName() != nullsb.append("LaunchConfigurationName: " + getLaunchConfigurationName() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getInstanceId() == null) ? 0 : getInstanceId().hashCode()); 
        hashCode = prime * hashCode + ((getAvailabilityZone() == null) ? 0 : getAvailabilityZone().hashCode()); 
        hashCode = prime * hashCode + ((getLifecycleState() == null) ? 0 : getLifecycleState().hashCode()); 
        hashCode = prime * hashCode + ((getHealthStatus() == null) ? 0 : getHealthStatus().hashCode()); 
        hashCode = prime * hashCode + ((getLaunchConfigurationName() == null) ? 0 : getLaunchConfigurationName().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof Instance == falsereturn false;
        Instance other = (Instance)obj;
        
        if (other.getInstanceId() == null ^ this.getInstanceId() == nullreturn false;
        if (other.getInstanceId() != null && other.getInstanceId().equals(this.getInstanceId()) == falsereturn false
        if (other.getAvailabilityZone() == null ^ this.getAvailabilityZone() == nullreturn false;
        if (other.getAvailabilityZone() != null && other.getAvailabilityZone().equals(this.getAvailabilityZone()) == falsereturn false
        if (other.getLifecycleState() == null ^ this.getLifecycleState() == nullreturn false;
        if (other.getLifecycleState() != null && other.getLifecycleState().equals(this.getLifecycleState()) == falsereturn false
        if (other.getHealthStatus() == null ^ this.getHealthStatus() == nullreturn false;
        if (other.getHealthStatus() != null && other.getHealthStatus().equals(this.getHealthStatus()) == falsereturn false
        if (other.getLaunchConfigurationName() == null ^ this.getLaunchConfigurationName() == nullreturn false;
        if (other.getLaunchConfigurationName() != null && other.getLaunchConfigurationName().equals(this.getLaunchConfigurationName()) == falsereturn false
        return true;
    }
    
    @Override
    public Instance clone() {
        try {
            return (Instancesuper.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