com.amazonaws.services.ec2.model.VpcPeeringConnectionVpcInfo Maven / Gradle / Ivy
Show all versions of aws-java-sdk-ec2 Show documentation
/*
* Copyright 2018-2023 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;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* Describes a VPC in a VPC peering connection.
*
*
* @see AWS
* API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class VpcPeeringConnectionVpcInfo implements Serializable, Cloneable {
/**
*
* The IPv4 CIDR block for the VPC.
*
*/
private String cidrBlock;
/**
*
* The IPv6 CIDR block for the VPC.
*
*/
private com.amazonaws.internal.SdkInternalList ipv6CidrBlockSet;
/**
*
* Information about the IPv4 CIDR blocks for the VPC.
*
*/
private com.amazonaws.internal.SdkInternalList cidrBlockSet;
/**
*
* The ID of the Amazon Web Services account that owns the VPC.
*
*/
private String ownerId;
/**
*
* Information about the VPC peering connection options for the accepter or requester VPC.
*
*/
private VpcPeeringConnectionOptionsDescription peeringOptions;
/**
*
* The ID of the VPC.
*
*/
private String vpcId;
/**
*
* The Region in which the VPC is located.
*
*/
private String region;
/**
*
* The IPv4 CIDR block for the VPC.
*
*
* @param cidrBlock
* The IPv4 CIDR block for the VPC.
*/
public void setCidrBlock(String cidrBlock) {
this.cidrBlock = cidrBlock;
}
/**
*
* The IPv4 CIDR block for the VPC.
*
*
* @return The IPv4 CIDR block for the VPC.
*/
public String getCidrBlock() {
return this.cidrBlock;
}
/**
*
* The IPv4 CIDR block for the VPC.
*
*
* @param cidrBlock
* The IPv4 CIDR block for the VPC.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VpcPeeringConnectionVpcInfo withCidrBlock(String cidrBlock) {
setCidrBlock(cidrBlock);
return this;
}
/**
*
* The IPv6 CIDR block for the VPC.
*
*
* @return The IPv6 CIDR block for the VPC.
*/
public java.util.List getIpv6CidrBlockSet() {
if (ipv6CidrBlockSet == null) {
ipv6CidrBlockSet = new com.amazonaws.internal.SdkInternalList();
}
return ipv6CidrBlockSet;
}
/**
*
* The IPv6 CIDR block for the VPC.
*
*
* @param ipv6CidrBlockSet
* The IPv6 CIDR block for the VPC.
*/
public void setIpv6CidrBlockSet(java.util.Collection ipv6CidrBlockSet) {
if (ipv6CidrBlockSet == null) {
this.ipv6CidrBlockSet = null;
return;
}
this.ipv6CidrBlockSet = new com.amazonaws.internal.SdkInternalList(ipv6CidrBlockSet);
}
/**
*
* The IPv6 CIDR block for the VPC.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setIpv6CidrBlockSet(java.util.Collection)} or {@link #withIpv6CidrBlockSet(java.util.Collection)} if you
* want to override the existing values.
*
*
* @param ipv6CidrBlockSet
* The IPv6 CIDR block for the VPC.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VpcPeeringConnectionVpcInfo withIpv6CidrBlockSet(Ipv6CidrBlock... ipv6CidrBlockSet) {
if (this.ipv6CidrBlockSet == null) {
setIpv6CidrBlockSet(new com.amazonaws.internal.SdkInternalList(ipv6CidrBlockSet.length));
}
for (Ipv6CidrBlock ele : ipv6CidrBlockSet) {
this.ipv6CidrBlockSet.add(ele);
}
return this;
}
/**
*
* The IPv6 CIDR block for the VPC.
*
*
* @param ipv6CidrBlockSet
* The IPv6 CIDR block for the VPC.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VpcPeeringConnectionVpcInfo withIpv6CidrBlockSet(java.util.Collection ipv6CidrBlockSet) {
setIpv6CidrBlockSet(ipv6CidrBlockSet);
return this;
}
/**
*
* Information about the IPv4 CIDR blocks for the VPC.
*
*
* @return Information about the IPv4 CIDR blocks for the VPC.
*/
public java.util.List getCidrBlockSet() {
if (cidrBlockSet == null) {
cidrBlockSet = new com.amazonaws.internal.SdkInternalList();
}
return cidrBlockSet;
}
/**
*
* Information about the IPv4 CIDR blocks for the VPC.
*
*
* @param cidrBlockSet
* Information about the IPv4 CIDR blocks for the VPC.
*/
public void setCidrBlockSet(java.util.Collection cidrBlockSet) {
if (cidrBlockSet == null) {
this.cidrBlockSet = null;
return;
}
this.cidrBlockSet = new com.amazonaws.internal.SdkInternalList(cidrBlockSet);
}
/**
*
* Information about the IPv4 CIDR blocks for the VPC.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setCidrBlockSet(java.util.Collection)} or {@link #withCidrBlockSet(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param cidrBlockSet
* Information about the IPv4 CIDR blocks for the VPC.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VpcPeeringConnectionVpcInfo withCidrBlockSet(CidrBlock... cidrBlockSet) {
if (this.cidrBlockSet == null) {
setCidrBlockSet(new com.amazonaws.internal.SdkInternalList(cidrBlockSet.length));
}
for (CidrBlock ele : cidrBlockSet) {
this.cidrBlockSet.add(ele);
}
return this;
}
/**
*
* Information about the IPv4 CIDR blocks for the VPC.
*
*
* @param cidrBlockSet
* Information about the IPv4 CIDR blocks for the VPC.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VpcPeeringConnectionVpcInfo withCidrBlockSet(java.util.Collection cidrBlockSet) {
setCidrBlockSet(cidrBlockSet);
return this;
}
/**
*
* The ID of the Amazon Web Services account that owns the VPC.
*
*
* @param ownerId
* The ID of the Amazon Web Services account that owns the VPC.
*/
public void setOwnerId(String ownerId) {
this.ownerId = ownerId;
}
/**
*
* The ID of the Amazon Web Services account that owns the VPC.
*
*
* @return The ID of the Amazon Web Services account that owns the VPC.
*/
public String getOwnerId() {
return this.ownerId;
}
/**
*
* The ID of the Amazon Web Services account that owns the VPC.
*
*
* @param ownerId
* The ID of the Amazon Web Services account that owns the VPC.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VpcPeeringConnectionVpcInfo withOwnerId(String ownerId) {
setOwnerId(ownerId);
return this;
}
/**
*
* Information about the VPC peering connection options for the accepter or requester VPC.
*
*
* @param peeringOptions
* Information about the VPC peering connection options for the accepter or requester VPC.
*/
public void setPeeringOptions(VpcPeeringConnectionOptionsDescription peeringOptions) {
this.peeringOptions = peeringOptions;
}
/**
*
* Information about the VPC peering connection options for the accepter or requester VPC.
*
*
* @return Information about the VPC peering connection options for the accepter or requester VPC.
*/
public VpcPeeringConnectionOptionsDescription getPeeringOptions() {
return this.peeringOptions;
}
/**
*
* Information about the VPC peering connection options for the accepter or requester VPC.
*
*
* @param peeringOptions
* Information about the VPC peering connection options for the accepter or requester VPC.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VpcPeeringConnectionVpcInfo withPeeringOptions(VpcPeeringConnectionOptionsDescription peeringOptions) {
setPeeringOptions(peeringOptions);
return this;
}
/**
*
* The ID of the VPC.
*
*
* @param vpcId
* The ID of the VPC.
*/
public void setVpcId(String vpcId) {
this.vpcId = vpcId;
}
/**
*
* The ID of the VPC.
*
*
* @return The ID of the VPC.
*/
public String getVpcId() {
return this.vpcId;
}
/**
*
* The ID of the VPC.
*
*
* @param vpcId
* The ID of the VPC.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VpcPeeringConnectionVpcInfo withVpcId(String vpcId) {
setVpcId(vpcId);
return this;
}
/**
*
* The Region in which the VPC is located.
*
*
* @param region
* The Region in which the VPC is located.
*/
public void setRegion(String region) {
this.region = region;
}
/**
*
* The Region in which the VPC is located.
*
*
* @return The Region in which the VPC is located.
*/
public String getRegion() {
return this.region;
}
/**
*
* The Region in which the VPC is located.
*
*
* @param region
* The Region in which the VPC is located.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VpcPeeringConnectionVpcInfo withRegion(String region) {
setRegion(region);
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 (getCidrBlock() != null)
sb.append("CidrBlock: ").append(getCidrBlock()).append(",");
if (getIpv6CidrBlockSet() != null)
sb.append("Ipv6CidrBlockSet: ").append(getIpv6CidrBlockSet()).append(",");
if (getCidrBlockSet() != null)
sb.append("CidrBlockSet: ").append(getCidrBlockSet()).append(",");
if (getOwnerId() != null)
sb.append("OwnerId: ").append(getOwnerId()).append(",");
if (getPeeringOptions() != null)
sb.append("PeeringOptions: ").append(getPeeringOptions()).append(",");
if (getVpcId() != null)
sb.append("VpcId: ").append(getVpcId()).append(",");
if (getRegion() != null)
sb.append("Region: ").append(getRegion());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof VpcPeeringConnectionVpcInfo == false)
return false;
VpcPeeringConnectionVpcInfo other = (VpcPeeringConnectionVpcInfo) obj;
if (other.getCidrBlock() == null ^ this.getCidrBlock() == null)
return false;
if (other.getCidrBlock() != null && other.getCidrBlock().equals(this.getCidrBlock()) == false)
return false;
if (other.getIpv6CidrBlockSet() == null ^ this.getIpv6CidrBlockSet() == null)
return false;
if (other.getIpv6CidrBlockSet() != null && other.getIpv6CidrBlockSet().equals(this.getIpv6CidrBlockSet()) == false)
return false;
if (other.getCidrBlockSet() == null ^ this.getCidrBlockSet() == null)
return false;
if (other.getCidrBlockSet() != null && other.getCidrBlockSet().equals(this.getCidrBlockSet()) == false)
return false;
if (other.getOwnerId() == null ^ this.getOwnerId() == null)
return false;
if (other.getOwnerId() != null && other.getOwnerId().equals(this.getOwnerId()) == false)
return false;
if (other.getPeeringOptions() == null ^ this.getPeeringOptions() == null)
return false;
if (other.getPeeringOptions() != null && other.getPeeringOptions().equals(this.getPeeringOptions()) == 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.getRegion() == null ^ this.getRegion() == null)
return false;
if (other.getRegion() != null && other.getRegion().equals(this.getRegion()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getCidrBlock() == null) ? 0 : getCidrBlock().hashCode());
hashCode = prime * hashCode + ((getIpv6CidrBlockSet() == null) ? 0 : getIpv6CidrBlockSet().hashCode());
hashCode = prime * hashCode + ((getCidrBlockSet() == null) ? 0 : getCidrBlockSet().hashCode());
hashCode = prime * hashCode + ((getOwnerId() == null) ? 0 : getOwnerId().hashCode());
hashCode = prime * hashCode + ((getPeeringOptions() == null) ? 0 : getPeeringOptions().hashCode());
hashCode = prime * hashCode + ((getVpcId() == null) ? 0 : getVpcId().hashCode());
hashCode = prime * hashCode + ((getRegion() == null) ? 0 : getRegion().hashCode());
return hashCode;
}
@Override
public VpcPeeringConnectionVpcInfo clone() {
try {
return (VpcPeeringConnectionVpcInfo) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}