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

Describes a subnet.

 
 public class Subnet implements SerializableCloneable {

    
The identifier of the subnet.
 
     private String subnetIdentifier;

    
Describes an availability zone.
 
     private AvailabilityZone subnetAvailabilityZone;

    
The status of the subnet.
 
     private String subnetStatus;

    
The identifier of the subnet.

Returns:
The identifier of the subnet.
 
     public String getSubnetIdentifier() {
         return ;
     }
    
    
The identifier of the subnet.

Parameters:
subnetIdentifier The identifier of the subnet.
 
     public void setSubnetIdentifier(String subnetIdentifier) {
         this. = subnetIdentifier;
     }
    
    
The identifier of the subnet.

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

Parameters:
subnetIdentifier The identifier of the subnet.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public Subnet withSubnetIdentifier(String subnetIdentifier) {
         this. = subnetIdentifier;
         return this;
     }

    
Describes an availability zone.

Returns:
Describes an availability zone.
 
         return ;
     }
    
    
Describes an availability zone.

Parameters:
subnetAvailabilityZone Describes an availability zone.
 
     public void setSubnetAvailabilityZone(AvailabilityZone subnetAvailabilityZone) {
         this. = subnetAvailabilityZone;
     }
    
    
Describes an availability zone.

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

Parameters:
subnetAvailabilityZone Describes an availability zone.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Subnet withSubnetAvailabilityZone(AvailabilityZone subnetAvailabilityZone) {
        this. = subnetAvailabilityZone;
        return this;
    }

    
The status of the subnet.

Returns:
The status of the subnet.
    public String getSubnetStatus() {
        return ;
    }
    
    
The status of the subnet.

Parameters:
subnetStatus The status of the subnet.
    public void setSubnetStatus(String subnetStatus) {
        this. = subnetStatus;
    }
    
    
The status of the subnet.

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

Parameters:
subnetStatus The status of the subnet.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Subnet withSubnetStatus(String subnetStatus) {
        this. = subnetStatus;
        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 (getSubnetIdentifier() != nullsb.append("SubnetIdentifier: " + getSubnetIdentifier() + ",");
        if (getSubnetAvailabilityZone() != nullsb.append("SubnetAvailabilityZone: " + getSubnetAvailabilityZone() + ",");
        if (getSubnetStatus() != nullsb.append("SubnetStatus: " + getSubnetStatus() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getSubnetIdentifier() == null) ? 0 : getSubnetIdentifier().hashCode()); 
        hashCode = prime * hashCode + ((getSubnetAvailabilityZone() == null) ? 0 : getSubnetAvailabilityZone().hashCode()); 
        hashCode = prime * hashCode + ((getSubnetStatus() == null) ? 0 : getSubnetStatus().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof Subnet == falsereturn false;
        Subnet other = (Subnet)obj;
        
        if (other.getSubnetIdentifier() == null ^ this.getSubnetIdentifier() == nullreturn false;
        if (other.getSubnetIdentifier() != null && other.getSubnetIdentifier().equals(this.getSubnetIdentifier()) == falsereturn false
        if (other.getSubnetAvailabilityZone() == null ^ this.getSubnetAvailabilityZone() == nullreturn false;
        if (other.getSubnetAvailabilityZone() != null && other.getSubnetAvailabilityZone().equals(this.getSubnetAvailabilityZone()) == falsereturn false
        if (other.getSubnetStatus() == null ^ this.getSubnetStatus() == nullreturn false;
        if (other.getSubnetStatus() != null && other.getSubnetStatus().equals(this.getSubnetStatus()) == falsereturn false
        return true;
    }
    
    @Override
    public Subnet clone() {
        try {
            return (Subnetsuper.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