com.amazonaws.services.redshift.model.ClusterSubnetGroup Maven / Gradle / Ivy
Show all versions of aws-java-sdk-redshift Show documentation
/*
* Copyright 2010-2016 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;
import java.io.Serializable;
/**
*
* Describes a subnet group.
*
*/
public class ClusterSubnetGroup implements Serializable, Cloneable {
/**
*
* 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.
*
*/
private com.amazonaws.internal.SdkInternalList subnets;
/**
*
* The list of tags for the cluster subnet group.
*
*/
private com.amazonaws.internal.SdkInternalList tags;
/**
*
* The name of the cluster subnet group.
*
*
* @param clusterSubnetGroupName
* The name of the cluster subnet group.
*/
public void setClusterSubnetGroupName(String clusterSubnetGroupName) {
this.clusterSubnetGroupName = clusterSubnetGroupName;
}
/**
*
* The name of the cluster subnet group.
*
*
* @return The name of the cluster subnet group.
*/
public String getClusterSubnetGroupName() {
return this.clusterSubnetGroupName;
}
/**
*
* The name of the cluster subnet group.
*
*
* @param clusterSubnetGroupName
* The name of the cluster subnet group.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public ClusterSubnetGroup withClusterSubnetGroupName(
String clusterSubnetGroupName) {
setClusterSubnetGroupName(clusterSubnetGroupName);
return this;
}
/**
*
* The description of the cluster subnet group.
*
*
* @param description
* The description of the cluster subnet group.
*/
public void setDescription(String description) {
this.description = description;
}
/**
*
* The description of the cluster subnet group.
*
*
* @return The description of the cluster subnet group.
*/
public String getDescription() {
return this.description;
}
/**
*
* The description of the cluster subnet group.
*
*
* @param description
* The description of the cluster subnet group.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public ClusterSubnetGroup withDescription(String description) {
setDescription(description);
return this;
}
/**
*
* The VPC ID of the cluster subnet group.
*
*
* @param vpcId
* The VPC ID of the cluster subnet group.
*/
public void setVpcId(String vpcId) {
this.vpcId = vpcId;
}
/**
*
* The VPC ID of the cluster subnet group.
*
*
* @return The VPC ID of the cluster subnet group.
*/
public String getVpcId() {
return this.vpcId;
}
/**
*
* The VPC ID of the cluster subnet group.
*
*
* @param vpcId
* The VPC ID of the cluster subnet group.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public ClusterSubnetGroup withVpcId(String vpcId) {
setVpcId(vpcId);
return this;
}
/**
*
* The status of the cluster subnet group. Possible values are
* Complete
, Incomplete
and Invalid
.
*
*
* @param subnetGroupStatus
* The status of the cluster subnet group. Possible values are
* Complete
, Incomplete
and
* Invalid
.
*/
public void setSubnetGroupStatus(String subnetGroupStatus) {
this.subnetGroupStatus = subnetGroupStatus;
}
/**
*
* The status of the cluster subnet group. Possible values are
* Complete
, Incomplete
and Invalid
.
*
*
* @return The status of the cluster subnet group. Possible values are
* Complete
, Incomplete
and
* Invalid
.
*/
public String getSubnetGroupStatus() {
return this.subnetGroupStatus;
}
/**
*
* The status of the cluster subnet group. Possible values are
* Complete
, Incomplete
and Invalid
.
*
*
* @param subnetGroupStatus
* The status of the cluster subnet group. Possible values are
* Complete
, Incomplete
and
* Invalid
.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public ClusterSubnetGroup withSubnetGroupStatus(String subnetGroupStatus) {
setSubnetGroupStatus(subnetGroupStatus);
return this;
}
/**
*
* A list of the VPC Subnet elements.
*
*
* @return A list of the VPC Subnet elements.
*/
public java.util.List getSubnets() {
if (subnets == null) {
subnets = new com.amazonaws.internal.SdkInternalList();
}
return subnets;
}
/**
*
* A list of the VPC Subnet elements.
*
*
* @param subnets
* A list of the VPC Subnet elements.
*/
public void setSubnets(java.util.Collection subnets) {
if (subnets == null) {
this.subnets = null;
return;
}
this.subnets = new com.amazonaws.internal.SdkInternalList(
subnets);
}
/**
*
* A list of the VPC Subnet elements.
*
*
* NOTE: This method appends the values to the existing list (if
* any). Use {@link #setSubnets(java.util.Collection)} or
* {@link #withSubnets(java.util.Collection)} if you want to override the
* existing values.
*
*
* @param subnets
* A list of the VPC Subnet elements.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public ClusterSubnetGroup withSubnets(Subnet... subnets) {
if (this.subnets == null) {
setSubnets(new com.amazonaws.internal.SdkInternalList(
subnets.length));
}
for (Subnet ele : subnets) {
this.subnets.add(ele);
}
return this;
}
/**
*
* A list of the VPC Subnet elements.
*
*
* @param subnets
* A list of the VPC Subnet elements.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public ClusterSubnetGroup withSubnets(java.util.Collection subnets) {
setSubnets(subnets);
return this;
}
/**
*
* The list of tags for the cluster subnet group.
*
*
* @return The list of tags for the cluster subnet group.
*/
public java.util.List getTags() {
if (tags == null) {
tags = new com.amazonaws.internal.SdkInternalList();
}
return tags;
}
/**
*
* The list of tags for the cluster subnet group.
*
*
* @param tags
* The list of tags for the cluster subnet group.
*/
public void setTags(java.util.Collection tags) {
if (tags == null) {
this.tags = null;
return;
}
this.tags = new com.amazonaws.internal.SdkInternalList(tags);
}
/**
*
* The list of tags for the cluster subnet group.
*
*
* NOTE: This method appends the values to the existing list (if
* any). Use {@link #setTags(java.util.Collection)} or
* {@link #withTags(java.util.Collection)} if you want to override the
* existing values.
*
*
* @param tags
* The list of tags for the cluster subnet group.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public ClusterSubnetGroup withTags(Tag... tags) {
if (this.tags == null) {
setTags(new com.amazonaws.internal.SdkInternalList(tags.length));
}
for (Tag ele : tags) {
this.tags.add(ele);
}
return this;
}
/**
*
* The list of tags for the cluster subnet group.
*
*
* @param tags
* The list of tags for the cluster subnet group.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public ClusterSubnetGroup withTags(java.util.Collection tags) {
setTags(tags);
return this;
}
/**
* Returns a string representation of this object; useful for testing and
* debugging.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getClusterSubnetGroupName() != null)
sb.append("ClusterSubnetGroupName: " + getClusterSubnetGroupName()
+ ",");
if (getDescription() != null)
sb.append("Description: " + getDescription() + ",");
if (getVpcId() != null)
sb.append("VpcId: " + getVpcId() + ",");
if (getSubnetGroupStatus() != null)
sb.append("SubnetGroupStatus: " + getSubnetGroupStatus() + ",");
if (getSubnets() != null)
sb.append("Subnets: " + getSubnets() + ",");
if (getTags() != null)
sb.append("Tags: " + getTags());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ClusterSubnetGroup == false)
return false;
ClusterSubnetGroup other = (ClusterSubnetGroup) obj;
if (other.getClusterSubnetGroupName() == null
^ this.getClusterSubnetGroupName() == null)
return false;
if (other.getClusterSubnetGroupName() != null
&& other.getClusterSubnetGroupName().equals(
this.getClusterSubnetGroupName()) == false)
return false;
if (other.getDescription() == null ^ this.getDescription() == null)
return false;
if (other.getDescription() != null
&& other.getDescription().equals(this.getDescription()) == false)
return false;
if (other.getVpcId() == null ^ this.getVpcId() == null)
return false;
if (other.getVpcId() != null
&& other.getVpcId().equals(this.getVpcId()) == false)
return false;
if (other.getSubnetGroupStatus() == null
^ this.getSubnetGroupStatus() == null)
return false;
if (other.getSubnetGroupStatus() != null
&& other.getSubnetGroupStatus().equals(
this.getSubnetGroupStatus()) == false)
return false;
if (other.getSubnets() == null ^ this.getSubnets() == null)
return false;
if (other.getSubnets() != null
&& other.getSubnets().equals(this.getSubnets()) == false)
return false;
if (other.getTags() == null ^ this.getTags() == null)
return false;
if (other.getTags() != null
&& other.getTags().equals(this.getTags()) == false)
return false;
return true;
}
@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 ClusterSubnetGroup clone() {
try {
return (ClusterSubnetGroup) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException(
"Got a CloneNotSupportedException from Object.clone() "
+ "even though we're Cloneable!", e);
}
}
}