
com.amazonaws.services.kafka.model.DescribeVpcConnectionResult Maven / Gradle / Ivy
/*
* Copyright 2019-2024 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.kafka.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DescribeVpcConnectionResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable {
/**
*
* The Amazon Resource Name (ARN) that uniquely identifies a MSK VPC connection.
*
*/
private String vpcConnectionArn;
/**
*
* The Amazon Resource Name (ARN) that uniquely identifies an MSK cluster.
*
*/
private String targetClusterArn;
/**
*
* The state of VPC connection.
*
*/
private String state;
/**
*
* The authentication type of VPC connection.
*
*/
private String authentication;
/**
*
* The VPC Id for the VPC connection.
*
*/
private String vpcId;
/**
*
* The list of subnets for the VPC connection.
*
*/
private java.util.List subnets;
/**
*
* The list of security groups for the VPC connection.
*
*/
private java.util.List securityGroups;
/**
*
* The creation time of the VPC connection.
*
*/
private java.util.Date creationTime;
/**
*
* A map of tags for the VPC connection.
*
*/
private java.util.Map tags;
/**
*
* The Amazon Resource Name (ARN) that uniquely identifies a MSK VPC connection.
*
*
* @param vpcConnectionArn
*
* The Amazon Resource Name (ARN) that uniquely identifies a MSK VPC connection.
*
*/
public void setVpcConnectionArn(String vpcConnectionArn) {
this.vpcConnectionArn = vpcConnectionArn;
}
/**
*
* The Amazon Resource Name (ARN) that uniquely identifies a MSK VPC connection.
*
*
* @return
* The Amazon Resource Name (ARN) that uniquely identifies a MSK VPC connection.
*
*/
public String getVpcConnectionArn() {
return this.vpcConnectionArn;
}
/**
*
* The Amazon Resource Name (ARN) that uniquely identifies a MSK VPC connection.
*
*
* @param vpcConnectionArn
*
* The Amazon Resource Name (ARN) that uniquely identifies a MSK VPC connection.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeVpcConnectionResult withVpcConnectionArn(String vpcConnectionArn) {
setVpcConnectionArn(vpcConnectionArn);
return this;
}
/**
*
* The Amazon Resource Name (ARN) that uniquely identifies an MSK cluster.
*
*
* @param targetClusterArn
*
* The Amazon Resource Name (ARN) that uniquely identifies an MSK cluster.
*
*/
public void setTargetClusterArn(String targetClusterArn) {
this.targetClusterArn = targetClusterArn;
}
/**
*
* The Amazon Resource Name (ARN) that uniquely identifies an MSK cluster.
*
*
* @return
* The Amazon Resource Name (ARN) that uniquely identifies an MSK cluster.
*
*/
public String getTargetClusterArn() {
return this.targetClusterArn;
}
/**
*
* The Amazon Resource Name (ARN) that uniquely identifies an MSK cluster.
*
*
* @param targetClusterArn
*
* The Amazon Resource Name (ARN) that uniquely identifies an MSK cluster.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeVpcConnectionResult withTargetClusterArn(String targetClusterArn) {
setTargetClusterArn(targetClusterArn);
return this;
}
/**
*
* The state of VPC connection.
*
*
* @param state
*
* The state of VPC connection.
*
* @see VpcConnectionState
*/
public void setState(String state) {
this.state = state;
}
/**
*
* The state of VPC connection.
*
*
* @return
* The state of VPC connection.
*
* @see VpcConnectionState
*/
public String getState() {
return this.state;
}
/**
*
* The state of VPC connection.
*
*
* @param state
*
* The state of VPC connection.
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see VpcConnectionState
*/
public DescribeVpcConnectionResult withState(String state) {
setState(state);
return this;
}
/**
*
* The state of VPC connection.
*
*
* @param state
*
* The state of VPC connection.
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see VpcConnectionState
*/
public DescribeVpcConnectionResult withState(VpcConnectionState state) {
this.state = state.toString();
return this;
}
/**
*
* The authentication type of VPC connection.
*
*
* @param authentication
*
* The authentication type of VPC connection.
*
*/
public void setAuthentication(String authentication) {
this.authentication = authentication;
}
/**
*
* The authentication type of VPC connection.
*
*
* @return
* The authentication type of VPC connection.
*
*/
public String getAuthentication() {
return this.authentication;
}
/**
*
* The authentication type of VPC connection.
*
*
* @param authentication
*
* The authentication type of VPC connection.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeVpcConnectionResult withAuthentication(String authentication) {
setAuthentication(authentication);
return this;
}
/**
*
* The VPC Id for the VPC connection.
*
*
* @param vpcId
*
* The VPC Id for the VPC connection.
*
*/
public void setVpcId(String vpcId) {
this.vpcId = vpcId;
}
/**
*
* The VPC Id for the VPC connection.
*
*
* @return
* The VPC Id for the VPC connection.
*
*/
public String getVpcId() {
return this.vpcId;
}
/**
*
* The VPC Id for the VPC connection.
*
*
* @param vpcId
*
* The VPC Id for the VPC connection.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeVpcConnectionResult withVpcId(String vpcId) {
setVpcId(vpcId);
return this;
}
/**
*
* The list of subnets for the VPC connection.
*
*
* @return
* The list of subnets for the VPC connection.
*
*/
public java.util.List getSubnets() {
return subnets;
}
/**
*
* The list of subnets for the VPC connection.
*
*
* @param subnets
*
* The list of subnets for the VPC connection.
*
*/
public void setSubnets(java.util.Collection subnets) {
if (subnets == null) {
this.subnets = null;
return;
}
this.subnets = new java.util.ArrayList(subnets);
}
/**
*
* The list of subnets for the VPC connection.
*
*
*
* 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
*
* The list of subnets for the VPC connection.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeVpcConnectionResult withSubnets(String... subnets) {
if (this.subnets == null) {
setSubnets(new java.util.ArrayList(subnets.length));
}
for (String ele : subnets) {
this.subnets.add(ele);
}
return this;
}
/**
*
* The list of subnets for the VPC connection.
*
*
* @param subnets
*
* The list of subnets for the VPC connection.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeVpcConnectionResult withSubnets(java.util.Collection subnets) {
setSubnets(subnets);
return this;
}
/**
*
* The list of security groups for the VPC connection.
*
*
* @return
* The list of security groups for the VPC connection.
*
*/
public java.util.List getSecurityGroups() {
return securityGroups;
}
/**
*
* The list of security groups for the VPC connection.
*
*
* @param securityGroups
*
* The list of security groups for the VPC connection.
*
*/
public void setSecurityGroups(java.util.Collection securityGroups) {
if (securityGroups == null) {
this.securityGroups = null;
return;
}
this.securityGroups = new java.util.ArrayList(securityGroups);
}
/**
*
* The list of security groups for the VPC connection.
*
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setSecurityGroups(java.util.Collection)} or {@link #withSecurityGroups(java.util.Collection)} if you want
* to override the existing values.
*
*
* @param securityGroups
*
* The list of security groups for the VPC connection.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeVpcConnectionResult withSecurityGroups(String... securityGroups) {
if (this.securityGroups == null) {
setSecurityGroups(new java.util.ArrayList(securityGroups.length));
}
for (String ele : securityGroups) {
this.securityGroups.add(ele);
}
return this;
}
/**
*
* The list of security groups for the VPC connection.
*
*
* @param securityGroups
*
* The list of security groups for the VPC connection.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeVpcConnectionResult withSecurityGroups(java.util.Collection securityGroups) {
setSecurityGroups(securityGroups);
return this;
}
/**
*
* The creation time of the VPC connection.
*
*
* @param creationTime
*
* The creation time of the VPC connection.
*
*/
public void setCreationTime(java.util.Date creationTime) {
this.creationTime = creationTime;
}
/**
*
* The creation time of the VPC connection.
*
*
* @return
* The creation time of the VPC connection.
*
*/
public java.util.Date getCreationTime() {
return this.creationTime;
}
/**
*
* The creation time of the VPC connection.
*
*
* @param creationTime
*
* The creation time of the VPC connection.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeVpcConnectionResult withCreationTime(java.util.Date creationTime) {
setCreationTime(creationTime);
return this;
}
/**
*
* A map of tags for the VPC connection.
*
*
* @return
* A map of tags for the VPC connection.
*
*/
public java.util.Map getTags() {
return tags;
}
/**
*
* A map of tags for the VPC connection.
*
*
* @param tags
*
* A map of tags for the VPC connection.
*
*/
public void setTags(java.util.Map tags) {
this.tags = tags;
}
/**
*
* A map of tags for the VPC connection.
*
*
* @param tags
*
* A map of tags for the VPC connection.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeVpcConnectionResult withTags(java.util.Map tags) {
setTags(tags);
return this;
}
/**
* Add a single Tags entry
*
* @see DescribeVpcConnectionResult#withTags
* @returns a reference to this object so that method calls can be chained together.
*/
public DescribeVpcConnectionResult addTagsEntry(String key, String value) {
if (null == this.tags) {
this.tags = new java.util.HashMap();
}
if (this.tags.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.tags.put(key, value);
return this;
}
/**
* Removes all the entries added into Tags.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribeVpcConnectionResult clearTagsEntries() {
this.tags = null;
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getVpcConnectionArn() != null)
sb.append("VpcConnectionArn: ").append(getVpcConnectionArn()).append(",");
if (getTargetClusterArn() != null)
sb.append("TargetClusterArn: ").append(getTargetClusterArn()).append(",");
if (getState() != null)
sb.append("State: ").append(getState()).append(",");
if (getAuthentication() != null)
sb.append("Authentication: ").append(getAuthentication()).append(",");
if (getVpcId() != null)
sb.append("VpcId: ").append(getVpcId()).append(",");
if (getSubnets() != null)
sb.append("Subnets: ").append(getSubnets()).append(",");
if (getSecurityGroups() != null)
sb.append("SecurityGroups: ").append(getSecurityGroups()).append(",");
if (getCreationTime() != null)
sb.append("CreationTime: ").append(getCreationTime()).append(",");
if (getTags() != null)
sb.append("Tags: ").append(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 DescribeVpcConnectionResult == false)
return false;
DescribeVpcConnectionResult other = (DescribeVpcConnectionResult) obj;
if (other.getVpcConnectionArn() == null ^ this.getVpcConnectionArn() == null)
return false;
if (other.getVpcConnectionArn() != null && other.getVpcConnectionArn().equals(this.getVpcConnectionArn()) == false)
return false;
if (other.getTargetClusterArn() == null ^ this.getTargetClusterArn() == null)
return false;
if (other.getTargetClusterArn() != null && other.getTargetClusterArn().equals(this.getTargetClusterArn()) == false)
return false;
if (other.getState() == null ^ this.getState() == null)
return false;
if (other.getState() != null && other.getState().equals(this.getState()) == false)
return false;
if (other.getAuthentication() == null ^ this.getAuthentication() == null)
return false;
if (other.getAuthentication() != null && other.getAuthentication().equals(this.getAuthentication()) == 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.getSubnets() == null ^ this.getSubnets() == null)
return false;
if (other.getSubnets() != null && other.getSubnets().equals(this.getSubnets()) == false)
return false;
if (other.getSecurityGroups() == null ^ this.getSecurityGroups() == null)
return false;
if (other.getSecurityGroups() != null && other.getSecurityGroups().equals(this.getSecurityGroups()) == false)
return false;
if (other.getCreationTime() == null ^ this.getCreationTime() == null)
return false;
if (other.getCreationTime() != null && other.getCreationTime().equals(this.getCreationTime()) == 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 + ((getVpcConnectionArn() == null) ? 0 : getVpcConnectionArn().hashCode());
hashCode = prime * hashCode + ((getTargetClusterArn() == null) ? 0 : getTargetClusterArn().hashCode());
hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode());
hashCode = prime * hashCode + ((getAuthentication() == null) ? 0 : getAuthentication().hashCode());
hashCode = prime * hashCode + ((getVpcId() == null) ? 0 : getVpcId().hashCode());
hashCode = prime * hashCode + ((getSubnets() == null) ? 0 : getSubnets().hashCode());
hashCode = prime * hashCode + ((getSecurityGroups() == null) ? 0 : getSecurityGroups().hashCode());
hashCode = prime * hashCode + ((getCreationTime() == null) ? 0 : getCreationTime().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
return hashCode;
}
@Override
public DescribeVpcConnectionResult clone() {
try {
return (DescribeVpcConnectionResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}