Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2014 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 an Availability Zone.

 
 public class AvailabilityZone implements Serializable {

    
The name of the Availability Zone.
 
     private String zoneName;

    
The state of the Availability Zone.

Constraints:
Allowed Values: available

 
     private String state;

    
The name of the region.
 
     private String regionName;

    
Any messages about the Availability Zone.
 
The name of the Availability Zone.

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

Parameters:
zoneName The name of the Availability Zone.
 
     public void setZoneName(String zoneName) {
         this. = zoneName;
     }
    
    
The name of the Availability Zone.

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

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

    
The state of the Availability Zone.

Constraints:
Allowed Values: available

Returns:
The state of the Availability Zone.
See also:
AvailabilityZoneState
 
     public String getState() {
         return ;
     }
    
    
The state of the Availability Zone.

Constraints:
Allowed Values: available

Parameters:
state The state of the Availability Zone.
See also:
AvailabilityZoneState
    public void setState(String state) {
        this. = state;
    }
    
    
The state of the Availability Zone.

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

Constraints:
Allowed Values: available

Parameters:
state The state of the Availability Zone.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
AvailabilityZoneState
    public AvailabilityZone withState(String state) {
        this. = state;
        return this;
    }

    
The state of the Availability Zone.

Constraints:
Allowed Values: available

Parameters:
state The state of the Availability Zone.
See also:
AvailabilityZoneState
    public void setState(AvailabilityZoneState state) {
        this. = state.toString();
    }
    
    
The state of the Availability Zone.

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

Constraints:
Allowed Values: available

Parameters:
state The state of the Availability Zone.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
AvailabilityZoneState
        this. = state.toString();
        return this;
    }

    
The name of the region.

Returns:
The name of the region.
    public String getRegionName() {
        return ;
    }
    
    
The name of the region.

Parameters:
regionName The name of the region.
    public void setRegionName(String regionName) {
        this. = regionName;
    }
    
    
The name of the region.

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

Parameters:
regionName The name of the region.
Returns:
A reference to this updated object so that method calls can be chained together.
    public AvailabilityZone withRegionName(String regionName) {
        this. = regionName;
        return this;
    }

    
Any messages about the Availability Zone.

Returns:
Any messages about the Availability Zone.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
Any messages about the Availability Zone.

Parameters:
messages Any messages about the Availability Zone.
    public void setMessages(java.util.Collection<AvailabilityZoneMessagemessages) {
        if (messages == null) {
            this. = null;
            return;
        }
        messagesCopy.addAll(messages);
        this. = messagesCopy;
    }
    
    
Any messages about the Availability Zone.

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

Parameters:
messages Any messages about the Availability Zone.
Returns:
A reference to this updated object so that method calls can be chained together.
    public AvailabilityZone withMessages(AvailabilityZoneMessage... messages) {
        if (getMessages() == nullsetMessages(new java.util.ArrayList<AvailabilityZoneMessage>(messages.length));
        for (AvailabilityZoneMessage value : messages) {
            getMessages().add(value);
        }
        return this;
    }
    
    
Any messages about the Availability Zone.

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

Parameters:
messages Any messages about the Availability Zone.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (messages == null) {
            this. = null;
        } else {
            messagesCopy.addAll(messages);
            this. = messagesCopy;
        }
        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 (getZoneName() != nullsb.append("ZoneName: " + getZoneName() + ",");
        if (getState() != nullsb.append("State: " + getState() + ",");
        if (getRegionName() != nullsb.append("RegionName: " + getRegionName() + ",");
        if (getMessages() != nullsb.append("Messages: " + getMessages() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getZoneName() == null) ? 0 : getZoneName().hashCode()); 
        hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode()); 
        hashCode = prime * hashCode + ((getRegionName() == null) ? 0 : getRegionName().hashCode()); 
        hashCode = prime * hashCode + ((getMessages() == null) ? 0 : getMessages().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof AvailabilityZone == falsereturn false;
        AvailabilityZone other = (AvailabilityZone)obj;
        
        if (other.getZoneName() == null ^ this.getZoneName() == nullreturn false;
        if (other.getZoneName() != null && other.getZoneName().equals(this.getZoneName()) == falsereturn false
        if (other.getState() == null ^ this.getState() == nullreturn false;
        if (other.getState() != null && other.getState().equals(this.getState()) == falsereturn false
        if (other.getRegionName() == null ^ this.getRegionName() == nullreturn false;
        if (other.getRegionName() != null && other.getRegionName().equals(this.getRegionName()) == falsereturn false
        if (other.getMessages() == null ^ this.getMessages() == nullreturn false;
        if (other.getMessages() != null && other.getMessages().equals(this.getMessages()) == falsereturn false
        return true;
    }
    
}
    
New to GrepCode? Check out our FAQ X