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

Describes the status of an instance.

 
 public class InstanceStatus implements SerializableCloneable {

    
The ID of the instance.
 
     private String instanceId;

    
The Availability Zone of the instance.
 
     private String availabilityZone;

    
Extra information regarding events associated with the instance.
 
The intended state of the instance. DescribeInstanceStatus requires that an instance be in the running state.
 
     private InstanceState instanceState;

    
Reports impaired functionality that stems from issues related to the systems that support an instance, such as hardware failures and network connectivity problems.
 
     private InstanceStatusSummary systemStatus;

    
Reports impaired functionality that stems from issues internal to the instance, such as impaired reachability.
 
     private InstanceStatusSummary instanceStatus;

    
The ID of the instance.

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

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.

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

    
The Availability Zone of the instance.

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

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

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

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

    
Extra information regarding events associated with the instance.

Returns:
Extra information regarding events associated with the instance.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
Extra information regarding events associated with the instance.

Parameters:
events Extra information regarding events associated with the instance.
    public void setEvents(java.util.Collection<InstanceStatusEventevents) {
        if (events == null) {
            this. = null;
            return;
        }
        eventsCopy.addAll(events);
        this. = eventsCopy;
    }
    
    
Extra information regarding events associated with the instance.

NOTE: This method appends the values to the existing list (if any). Use setEvents(java.util.Collection) or withEvents(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:
events Extra information regarding events associated with the instance.
Returns:
A reference to this updated object so that method calls can be chained together.
    public InstanceStatus withEvents(InstanceStatusEvent... events) {
        if (getEvents() == nullsetEvents(new java.util.ArrayList<InstanceStatusEvent>(events.length));
        for (InstanceStatusEvent value : events) {
            getEvents().add(value);
        }
        return this;
    }
    
    
Extra information regarding events associated with the instance.

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

Parameters:
events Extra information regarding events associated with the instance.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (events == null) {
            this. = null;
        } else {
            eventsCopy.addAll(events);
            this. = eventsCopy;
        }
        return this;
    }

    
The intended state of the instance. DescribeInstanceStatus requires that an instance be in the running state.

Returns:
The intended state of the instance. DescribeInstanceStatus requires that an instance be in the running state.
    public InstanceState getInstanceState() {
        return ;
    }
    
    
The intended state of the instance. DescribeInstanceStatus requires that an instance be in the running state.

Parameters:
instanceState The intended state of the instance. DescribeInstanceStatus requires that an instance be in the running state.
    public void setInstanceState(InstanceState instanceState) {
        this. = instanceState;
    }
    
    
The intended state of the instance. DescribeInstanceStatus requires that an instance be in the running state.

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

Parameters:
instanceState The intended state of the instance. DescribeInstanceStatus requires that an instance be in the running state.
Returns:
A reference to this updated object so that method calls can be chained together.
    public InstanceStatus withInstanceState(InstanceState instanceState) {
        this. = instanceState;
        return this;
    }

    
Reports impaired functionality that stems from issues related to the systems that support an instance, such as hardware failures and network connectivity problems.

Returns:
Reports impaired functionality that stems from issues related to the systems that support an instance, such as hardware failures and network connectivity problems.
        return ;
    }
    
    
Reports impaired functionality that stems from issues related to the systems that support an instance, such as hardware failures and network connectivity problems.

Parameters:
systemStatus Reports impaired functionality that stems from issues related to the systems that support an instance, such as hardware failures and network connectivity problems.
    public void setSystemStatus(InstanceStatusSummary systemStatus) {
        this. = systemStatus;
    }
    
    
Reports impaired functionality that stems from issues related to the systems that support an instance, such as hardware failures and network connectivity problems.

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

Parameters:
systemStatus Reports impaired functionality that stems from issues related to the systems that support an instance, such as hardware failures and network connectivity problems.
Returns:
A reference to this updated object so that method calls can be chained together.
    public InstanceStatus withSystemStatus(InstanceStatusSummary systemStatus) {
        this. = systemStatus;
        return this;
    }

    
Reports impaired functionality that stems from issues internal to the instance, such as impaired reachability.

Returns:
Reports impaired functionality that stems from issues internal to the instance, such as impaired reachability.
        return ;
    }
    
    
Reports impaired functionality that stems from issues internal to the instance, such as impaired reachability.

Parameters:
instanceStatus Reports impaired functionality that stems from issues internal to the instance, such as impaired reachability.
    public void setInstanceStatus(InstanceStatusSummary instanceStatus) {
        this. = instanceStatus;
    }
    
    
Reports impaired functionality that stems from issues internal to the instance, such as impaired reachability.

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

Parameters:
instanceStatus Reports impaired functionality that stems from issues internal to the instance, such as impaired reachability.
Returns:
A reference to this updated object so that method calls can be chained together.
    public InstanceStatus withInstanceStatus(InstanceStatusSummary instanceStatus) {
        this. = instanceStatus;
        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 (getEvents() != nullsb.append("Events: " + getEvents() + ",");
        if (getInstanceState() != nullsb.append("InstanceState: " + getInstanceState() + ",");
        if (getSystemStatus() != nullsb.append("SystemStatus: " + getSystemStatus() + ",");
        if (getInstanceStatus() != nullsb.append("InstanceStatus: " + getInstanceStatus() );
        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 + ((getEvents() == null) ? 0 : getEvents().hashCode()); 
        hashCode = prime * hashCode + ((getInstanceState() == null) ? 0 : getInstanceState().hashCode()); 
        hashCode = prime * hashCode + ((getSystemStatus() == null) ? 0 : getSystemStatus().hashCode()); 
        hashCode = prime * hashCode + ((getInstanceStatus() == null) ? 0 : getInstanceStatus().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof InstanceStatus == falsereturn false;
        InstanceStatus other = (InstanceStatus)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.getEvents() == null ^ this.getEvents() == nullreturn false;
        if (other.getEvents() != null && other.getEvents().equals(this.getEvents()) == falsereturn false
        if (other.getInstanceState() == null ^ this.getInstanceState() == nullreturn false;
        if (other.getInstanceState() != null && other.getInstanceState().equals(this.getInstanceState()) == falsereturn false
        if (other.getSystemStatus() == null ^ this.getSystemStatus() == nullreturn false;
        if (other.getSystemStatus() != null && other.getSystemStatus().equals(this.getSystemStatus()) == falsereturn false
        if (other.getInstanceStatus() == null ^ this.getInstanceStatus() == nullreturn false;
        if (other.getInstanceStatus() != null && other.getInstanceStatus().equals(this.getInstanceStatus()) == falsereturn false
        return true;
    }
    
    @Override
    public InstanceStatus clone() {
        try {
            return (InstanceStatussuper.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