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 group.

 
 public class ClusterSubnetGroup implements SerializableCloneable {

    
The name of the cluster subnet group.
 
     private String clusterSubnetGroupName;

    
The description of the cluster subnet group.
 
     private String description;

    
The VPC ID of the cluster subnet group.
 
     private String vpcId;

    
The status of the cluster subnet group. Possible values are Complete, Incomplete and Invalid.
 
     private String subnetGroupStatus;

    
A list of the VPC Subnet elements.
 
The list of tags for the cluster subnet group.
 
The name of the cluster subnet group.

Returns:
The name of the cluster subnet group.
 
     public String getClusterSubnetGroupName() {
         return ;
     }
    
    
The name of the cluster subnet group.

Parameters:
clusterSubnetGroupName The name of the cluster subnet group.
 
     public void setClusterSubnetGroupName(String clusterSubnetGroupName) {
         this. = clusterSubnetGroupName;
     }
    
    
The name of the cluster subnet group.

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

Parameters:
clusterSubnetGroupName The name of the cluster subnet group.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public ClusterSubnetGroup withClusterSubnetGroupName(String clusterSubnetGroupName) {
         this. = clusterSubnetGroupName;
         return this;
     }

    
The description of the cluster subnet group.

Returns:
The description of the cluster subnet group.
 
     public String getDescription() {
         return ;
     }
    
    
The description of the cluster subnet group.

Parameters:
description The description of the cluster subnet group.
    public void setDescription(String description) {
        this. = description;
    }
    
    
The description of the cluster subnet group.

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

Parameters:
description The description of the cluster subnet group.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ClusterSubnetGroup withDescription(String description) {
        this. = description;
        return this;
    }

    
The VPC ID of the cluster subnet group.

Returns:
The VPC ID of the cluster subnet group.
    public String getVpcId() {
        return ;
    }
    
    
The VPC ID of the cluster subnet group.

Parameters:
vpcId The VPC ID of the cluster subnet group.
    public void setVpcId(String vpcId) {
        this. = vpcId;
    }
    
    
The VPC ID of the cluster subnet group.

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

Parameters:
vpcId The VPC ID of the cluster subnet group.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ClusterSubnetGroup withVpcId(String vpcId) {
        this. = vpcId;
        return this;
    }

    
The status of the cluster subnet group. Possible values are Complete, Incomplete and Invalid.

Returns:
The status of the cluster subnet group. Possible values are Complete, Incomplete and Invalid.
    public String getSubnetGroupStatus() {
        return ;
    }
    
    
The status of the cluster subnet group. Possible values are Complete, Incomplete and Invalid.

Parameters:
subnetGroupStatus The status of the cluster subnet group. Possible values are Complete, Incomplete and Invalid.
    public void setSubnetGroupStatus(String subnetGroupStatus) {
        this. = subnetGroupStatus;
    }
    
    
The status of the cluster subnet group. Possible values are Complete, Incomplete and Invalid.

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

Parameters:
subnetGroupStatus The status of the cluster subnet group. Possible values are Complete, Incomplete and Invalid.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ClusterSubnetGroup withSubnetGroupStatus(String subnetGroupStatus) {
        this. = subnetGroupStatus;
        return this;
    }

    
A list of the VPC Subnet elements.

Returns:
A list of the VPC Subnet elements.
    public java.util.List<SubnetgetSubnets() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<Subnet>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
A list of the VPC Subnet elements.

Parameters:
subnets A list of the VPC Subnet elements.
    public void setSubnets(java.util.Collection<Subnetsubnets) {
        if (subnets == null) {
            this. = null;
            return;
        }
        subnetsCopy.addAll(subnets);
        this. = subnetsCopy;
    }
    
    
A list of the VPC Subnet elements.

NOTE: This method appends the values to the existing list (if any). Use setSubnets(java.util.Collection) or withSubnets(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:
subnets A list of the VPC Subnet elements.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ClusterSubnetGroup withSubnets(Subnet... subnets) {
        if (getSubnets() == nullsetSubnets(new java.util.ArrayList<Subnet>(subnets.length));
        for (Subnet value : subnets) {
            getSubnets().add(value);
        }
        return this;
    }
    
    
A list of the VPC Subnet elements.

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

Parameters:
subnets A list of the VPC Subnet elements.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (subnets == null) {
            this. = null;
        } else {
            subnetsCopy.addAll(subnets);
            this. = subnetsCopy;
        }
        return this;
    }

    
The list of tags for the cluster subnet group.

Returns:
The list of tags for the cluster subnet group.
    public java.util.List<TaggetTags() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<Tag>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
The list of tags for the cluster subnet group.

Parameters:
tags The list of tags for the cluster subnet group.
    public void setTags(java.util.Collection<Tagtags) {
        if (tags == null) {
            this. = null;
            return;
        }
        tagsCopy.addAll(tags);
        this. = tagsCopy;
    }
    
    
The list of tags for the cluster subnet group.

NOTE: This method appends the values to the existing list (if any). Use setTags(java.util.Collection) or withTags(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:
tags The list of tags for the cluster subnet group.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ClusterSubnetGroup withTags(Tag... tags) {
        if (getTags() == nullsetTags(new java.util.ArrayList<Tag>(tags.length));
        for (Tag value : tags) {
            getTags().add(value);
        }
        return this;
    }
    
    
The list of tags for the cluster subnet group.

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

Parameters:
tags The list of tags for the cluster subnet group.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (tags == null) {
            this. = null;
        } else {
            tagsCopy.addAll(tags);
            this. = tagsCopy;
        }
        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 (getClusterSubnetGroupName() != nullsb.append("ClusterSubnetGroupName: " + getClusterSubnetGroupName() + ",");
        if (getDescription() != nullsb.append("Description: " + getDescription() + ",");
        if (getVpcId() != nullsb.append("VpcId: " + getVpcId() + ",");
        if (getSubnetGroupStatus() != nullsb.append("SubnetGroupStatus: " + getSubnetGroupStatus() + ",");
        if (getSubnets() != nullsb.append("Subnets: " + getSubnets() + ",");
        if (getTags() != nullsb.append("Tags: " + getTags() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getClusterSubnetGroupName() == null) ? 0 : getClusterSubnetGroupName().hashCode()); 
        hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); 
        hashCode = prime * hashCode + ((getVpcId() == null) ? 0 : getVpcId().hashCode()); 
        hashCode = prime * hashCode + ((getSubnetGroupStatus() == null) ? 0 : getSubnetGroupStatus().hashCode()); 
        hashCode = prime * hashCode + ((getSubnets() == null) ? 0 : getSubnets().hashCode()); 
        hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof ClusterSubnetGroup == falsereturn false;
        ClusterSubnetGroup other = (ClusterSubnetGroup)obj;
        
        if (other.getClusterSubnetGroupName() == null ^ this.getClusterSubnetGroupName() == nullreturn false;
        if (other.getClusterSubnetGroupName() != null && other.getClusterSubnetGroupName().equals(this.getClusterSubnetGroupName()) == falsereturn false
        if (other.getDescription() == null ^ this.getDescription() == nullreturn false;
        if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == falsereturn false
        if (other.getVpcId() == null ^ this.getVpcId() == nullreturn false;
        if (other.getVpcId() != null && other.getVpcId().equals(this.getVpcId()) == falsereturn false
        if (other.getSubnetGroupStatus() == null ^ this.getSubnetGroupStatus() == nullreturn false;
        if (other.getSubnetGroupStatus() != null && other.getSubnetGroupStatus().equals(this.getSubnetGroupStatus()) == falsereturn false
        if (other.getSubnets() == null ^ this.getSubnets() == nullreturn false;
        if (other.getSubnets() != null && other.getSubnets().equals(this.getSubnets()) == falsereturn false
        if (other.getTags() == null ^ this.getTags() == nullreturn false;
        if (other.getTags() != null && other.getTags().equals(this.getTags()) == falsereturn false
        return true;
    }
    
    @Override
    public ClusterSubnetGroup clone() {
        try {
            return (ClusterSubnetGroupsuper.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