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 associated with an Auto Scaling group.

 
 public class AutoScalingInstanceDetails 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 name of the Auto Scaling group associated with the instance.

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

 
     private String autoScalingGroupName;

    
The Availability Zone for the instance.

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

 
     private String availabilityZone;

    
The lifecycle state for the instance. For more information, see Auto Scaling Instance States in the Auto Scaling Developer Guide.

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

 
     private String lifecycleState;

    
The health status of this instance. "Healthy" means that the instance is healthy and should remain in service. "Unhealthy" means that the instance is unhealthy and Auto Scaling should terminate and replace it.

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 AutoScalingInstanceDetails withInstanceId(String instanceId) {
        this. = instanceId;
        return this;
    }

    
The name of the Auto Scaling group associated with the instance.

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

Returns:
The name of the Auto Scaling group associated with the instance.
    public String getAutoScalingGroupName() {
        return ;
    }
    
    
The name of the Auto Scaling group associated with the instance.

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

Parameters:
autoScalingGroupName The name of the Auto Scaling group associated with the instance.
    public void setAutoScalingGroupName(String autoScalingGroupName) {
        this. = autoScalingGroupName;
    }
    
    
The name of the Auto Scaling group 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:
autoScalingGroupName The name of the Auto Scaling group associated with the instance.
Returns:
A reference to this updated object so that method calls can be chained together.
    public AutoScalingInstanceDetails withAutoScalingGroupName(String autoScalingGroupName) {
        this. = autoScalingGroupName;
        return this;
    }

    
The Availability Zone for the instance.

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

Returns:
The Availability Zone for the instance.
    public String getAvailabilityZone() {
        return ;
    }
    
    
The Availability Zone for the instance.

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

Parameters:
availabilityZone The Availability Zone for the instance.
    public void setAvailabilityZone(String availabilityZone) {
        this. = availabilityZone;
    }
    
    
The Availability Zone for 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:
availabilityZone The Availability Zone for the instance.
Returns:
A reference to this updated object so that method calls can be chained together.
    public AutoScalingInstanceDetails withAvailabilityZone(String availabilityZone) {
        this. = availabilityZone;
        return this;
    }

    
The lifecycle state for the instance. For more information, see Auto Scaling Instance States in the Auto Scaling Developer Guide.

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

Returns:
The lifecycle state for the instance. For more information, see Auto Scaling Instance States in the Auto Scaling Developer Guide.
    public String getLifecycleState() {
        return ;
    }
    
    
The lifecycle state for the instance. For more information, see Auto Scaling Instance States in the Auto Scaling Developer Guide.

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

Parameters:
lifecycleState The lifecycle state for the instance. For more information, see Auto Scaling Instance States in the Auto Scaling Developer Guide.
    public void setLifecycleState(String lifecycleState) {
        this. = lifecycleState;
    }
    
    
The lifecycle state for the instance. For more information, see Auto Scaling Instance States in the Auto Scaling Developer Guide.

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:
lifecycleState The lifecycle state for the instance. For more information, see Auto Scaling Instance States in the Auto Scaling Developer Guide.
Returns:
A reference to this updated object so that method calls can be chained together.
    public AutoScalingInstanceDetails withLifecycleState(String lifecycleState) {
        this. = lifecycleState;
        return this;
    }

    
The health status of this instance. "Healthy" means that the instance is healthy and should remain in service. "Unhealthy" means that the instance is unhealthy and Auto Scaling should terminate and replace it.

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

Returns:
The health status of this instance. "Healthy" means that the instance is healthy and should remain in service. "Unhealthy" means that the instance is unhealthy and Auto Scaling should terminate and replace it.
    public String getHealthStatus() {
        return ;
    }
    
    
The health status of this instance. "Healthy" means that the instance is healthy and should remain in service. "Unhealthy" means that the instance is unhealthy and Auto Scaling should terminate and replace it.

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

Parameters:
healthStatus The health status of this instance. "Healthy" means that the instance is healthy and should remain in service. "Unhealthy" means that the instance is unhealthy and Auto Scaling should terminate and replace it.
    public void setHealthStatus(String healthStatus) {
        this. = healthStatus;
    }
    
    
The health status of this instance. "Healthy" means that the instance is healthy and should remain in service. "Unhealthy" means that the instance is unhealthy and Auto Scaling should terminate and replace it.

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 this instance. "Healthy" means that the instance is healthy and should remain in service. "Unhealthy" means that the instance is unhealthy and Auto Scaling should terminate and replace it.
Returns:
A reference to this updated object so that method calls can be chained together.
    public AutoScalingInstanceDetails 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 AutoScalingInstanceDetails 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 (getAutoScalingGroupName() != nullsb.append("AutoScalingGroupName: " + getAutoScalingGroupName() + ",");
        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 + ((getAutoScalingGroupName() == null) ? 0 : getAutoScalingGroupName().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 AutoScalingInstanceDetails == falsereturn false;
        
        if (other.getInstanceId() == null ^ this.getInstanceId() == nullreturn false;
        if (other.getInstanceId() != null && other.getInstanceId().equals(this.getInstanceId()) == falsereturn false
        if (other.getAutoScalingGroupName() == null ^ this.getAutoScalingGroupName() == nullreturn false;
        if (other.getAutoScalingGroupName() != null && other.getAutoScalingGroupName().equals(this.getAutoScalingGroupName()) == 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 AutoScalingInstanceDetails clone() {
        try {
            return (AutoScalingInstanceDetailssuper.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