com.amazonaws.services.ec2.model.TransitGatewayConnectPeerConfiguration Maven / Gradle / Ivy
Show all versions of aws-java-sdk-ec2 Show documentation
/*
* 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.ec2.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* Describes the Connect peer details.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class TransitGatewayConnectPeerConfiguration implements Serializable, Cloneable {
/**
*
* The Connect peer IP address on the transit gateway side of the tunnel.
*
*/
private String transitGatewayAddress;
/**
*
* The Connect peer IP address on the appliance side of the tunnel.
*
*/
private String peerAddress;
/**
*
* The range of interior BGP peer IP addresses.
*
*/
private com.amazonaws.internal.SdkInternalList insideCidrBlocks;
/**
*
* The tunnel protocol.
*
*/
private String protocol;
/**
*
* The BGP configuration details.
*
*/
private com.amazonaws.internal.SdkInternalList bgpConfigurations;
/**
*
* The Connect peer IP address on the transit gateway side of the tunnel.
*
*
* @param transitGatewayAddress
* The Connect peer IP address on the transit gateway side of the tunnel.
*/
public void setTransitGatewayAddress(String transitGatewayAddress) {
this.transitGatewayAddress = transitGatewayAddress;
}
/**
*
* The Connect peer IP address on the transit gateway side of the tunnel.
*
*
* @return The Connect peer IP address on the transit gateway side of the tunnel.
*/
public String getTransitGatewayAddress() {
return this.transitGatewayAddress;
}
/**
*
* The Connect peer IP address on the transit gateway side of the tunnel.
*
*
* @param transitGatewayAddress
* The Connect peer IP address on the transit gateway side of the tunnel.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TransitGatewayConnectPeerConfiguration withTransitGatewayAddress(String transitGatewayAddress) {
setTransitGatewayAddress(transitGatewayAddress);
return this;
}
/**
*
* The Connect peer IP address on the appliance side of the tunnel.
*
*
* @param peerAddress
* The Connect peer IP address on the appliance side of the tunnel.
*/
public void setPeerAddress(String peerAddress) {
this.peerAddress = peerAddress;
}
/**
*
* The Connect peer IP address on the appliance side of the tunnel.
*
*
* @return The Connect peer IP address on the appliance side of the tunnel.
*/
public String getPeerAddress() {
return this.peerAddress;
}
/**
*
* The Connect peer IP address on the appliance side of the tunnel.
*
*
* @param peerAddress
* The Connect peer IP address on the appliance side of the tunnel.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TransitGatewayConnectPeerConfiguration withPeerAddress(String peerAddress) {
setPeerAddress(peerAddress);
return this;
}
/**
*
* The range of interior BGP peer IP addresses.
*
*
* @return The range of interior BGP peer IP addresses.
*/
public java.util.List getInsideCidrBlocks() {
if (insideCidrBlocks == null) {
insideCidrBlocks = new com.amazonaws.internal.SdkInternalList();
}
return insideCidrBlocks;
}
/**
*
* The range of interior BGP peer IP addresses.
*
*
* @param insideCidrBlocks
* The range of interior BGP peer IP addresses.
*/
public void setInsideCidrBlocks(java.util.Collection insideCidrBlocks) {
if (insideCidrBlocks == null) {
this.insideCidrBlocks = null;
return;
}
this.insideCidrBlocks = new com.amazonaws.internal.SdkInternalList(insideCidrBlocks);
}
/**
*
* The range of interior BGP peer IP addresses.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setInsideCidrBlocks(java.util.Collection)} or {@link #withInsideCidrBlocks(java.util.Collection)} if you
* want to override the existing values.
*
*
* @param insideCidrBlocks
* The range of interior BGP peer IP addresses.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TransitGatewayConnectPeerConfiguration withInsideCidrBlocks(String... insideCidrBlocks) {
if (this.insideCidrBlocks == null) {
setInsideCidrBlocks(new com.amazonaws.internal.SdkInternalList(insideCidrBlocks.length));
}
for (String ele : insideCidrBlocks) {
this.insideCidrBlocks.add(ele);
}
return this;
}
/**
*
* The range of interior BGP peer IP addresses.
*
*
* @param insideCidrBlocks
* The range of interior BGP peer IP addresses.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TransitGatewayConnectPeerConfiguration withInsideCidrBlocks(java.util.Collection insideCidrBlocks) {
setInsideCidrBlocks(insideCidrBlocks);
return this;
}
/**
*
* The tunnel protocol.
*
*
* @param protocol
* The tunnel protocol.
* @see ProtocolValue
*/
public void setProtocol(String protocol) {
this.protocol = protocol;
}
/**
*
* The tunnel protocol.
*
*
* @return The tunnel protocol.
* @see ProtocolValue
*/
public String getProtocol() {
return this.protocol;
}
/**
*
* The tunnel protocol.
*
*
* @param protocol
* The tunnel protocol.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ProtocolValue
*/
public TransitGatewayConnectPeerConfiguration withProtocol(String protocol) {
setProtocol(protocol);
return this;
}
/**
*
* The tunnel protocol.
*
*
* @param protocol
* The tunnel protocol.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ProtocolValue
*/
public TransitGatewayConnectPeerConfiguration withProtocol(ProtocolValue protocol) {
this.protocol = protocol.toString();
return this;
}
/**
*
* The BGP configuration details.
*
*
* @return The BGP configuration details.
*/
public java.util.List getBgpConfigurations() {
if (bgpConfigurations == null) {
bgpConfigurations = new com.amazonaws.internal.SdkInternalList();
}
return bgpConfigurations;
}
/**
*
* The BGP configuration details.
*
*
* @param bgpConfigurations
* The BGP configuration details.
*/
public void setBgpConfigurations(java.util.Collection bgpConfigurations) {
if (bgpConfigurations == null) {
this.bgpConfigurations = null;
return;
}
this.bgpConfigurations = new com.amazonaws.internal.SdkInternalList(bgpConfigurations);
}
/**
*
* The BGP configuration details.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setBgpConfigurations(java.util.Collection)} or {@link #withBgpConfigurations(java.util.Collection)} if
* you want to override the existing values.
*
*
* @param bgpConfigurations
* The BGP configuration details.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TransitGatewayConnectPeerConfiguration withBgpConfigurations(TransitGatewayAttachmentBgpConfiguration... bgpConfigurations) {
if (this.bgpConfigurations == null) {
setBgpConfigurations(new com.amazonaws.internal.SdkInternalList(bgpConfigurations.length));
}
for (TransitGatewayAttachmentBgpConfiguration ele : bgpConfigurations) {
this.bgpConfigurations.add(ele);
}
return this;
}
/**
*
* The BGP configuration details.
*
*
* @param bgpConfigurations
* The BGP configuration details.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TransitGatewayConnectPeerConfiguration withBgpConfigurations(java.util.Collection bgpConfigurations) {
setBgpConfigurations(bgpConfigurations);
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 (getTransitGatewayAddress() != null)
sb.append("TransitGatewayAddress: ").append(getTransitGatewayAddress()).append(",");
if (getPeerAddress() != null)
sb.append("PeerAddress: ").append(getPeerAddress()).append(",");
if (getInsideCidrBlocks() != null)
sb.append("InsideCidrBlocks: ").append(getInsideCidrBlocks()).append(",");
if (getProtocol() != null)
sb.append("Protocol: ").append(getProtocol()).append(",");
if (getBgpConfigurations() != null)
sb.append("BgpConfigurations: ").append(getBgpConfigurations());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof TransitGatewayConnectPeerConfiguration == false)
return false;
TransitGatewayConnectPeerConfiguration other = (TransitGatewayConnectPeerConfiguration) obj;
if (other.getTransitGatewayAddress() == null ^ this.getTransitGatewayAddress() == null)
return false;
if (other.getTransitGatewayAddress() != null && other.getTransitGatewayAddress().equals(this.getTransitGatewayAddress()) == false)
return false;
if (other.getPeerAddress() == null ^ this.getPeerAddress() == null)
return false;
if (other.getPeerAddress() != null && other.getPeerAddress().equals(this.getPeerAddress()) == false)
return false;
if (other.getInsideCidrBlocks() == null ^ this.getInsideCidrBlocks() == null)
return false;
if (other.getInsideCidrBlocks() != null && other.getInsideCidrBlocks().equals(this.getInsideCidrBlocks()) == false)
return false;
if (other.getProtocol() == null ^ this.getProtocol() == null)
return false;
if (other.getProtocol() != null && other.getProtocol().equals(this.getProtocol()) == false)
return false;
if (other.getBgpConfigurations() == null ^ this.getBgpConfigurations() == null)
return false;
if (other.getBgpConfigurations() != null && other.getBgpConfigurations().equals(this.getBgpConfigurations()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getTransitGatewayAddress() == null) ? 0 : getTransitGatewayAddress().hashCode());
hashCode = prime * hashCode + ((getPeerAddress() == null) ? 0 : getPeerAddress().hashCode());
hashCode = prime * hashCode + ((getInsideCidrBlocks() == null) ? 0 : getInsideCidrBlocks().hashCode());
hashCode = prime * hashCode + ((getProtocol() == null) ? 0 : getProtocol().hashCode());
hashCode = prime * hashCode + ((getBgpConfigurations() == null) ? 0 : getBgpConfigurations().hashCode());
return hashCode;
}
@Override
public TransitGatewayConnectPeerConfiguration clone() {
try {
return (TransitGatewayConnectPeerConfiguration) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}