com.amazonaws.services.directconnect.model.NewTransitVirtualInterface Maven / Gradle / Ivy
Show all versions of aws-java-sdk-directconnect Show documentation
/*
* Copyright 2017-2022 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.directconnect.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Information about a transit virtual interface.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class NewTransitVirtualInterface implements Serializable, Cloneable, StructuredPojo {
/**
*
* The name of the virtual interface assigned by the customer network. The name has a maximum of 100 characters. The
* following are valid characters: a-z, 0-9 and a hyphen (-).
*
*/
private String virtualInterfaceName;
/**
*
* The ID of the VLAN.
*
*/
private Integer vlan;
/**
*
* The autonomous system (AS) number for Border Gateway Protocol (BGP) configuration.
*
*
* The valid values are 1-2147483647.
*
*/
private Integer asn;
/**
*
* The maximum transmission unit (MTU), in bytes. The supported values are 1500 and 9001. The default value is 1500.
*
*/
private Integer mtu;
/**
*
* The authentication key for BGP configuration. This string has a minimum length of 6 characters and and a maximun
* lenth of 80 characters.
*
*/
private String authKey;
/**
*
* The IP address assigned to the Amazon interface.
*
*/
private String amazonAddress;
/**
*
* The IP address assigned to the customer interface.
*
*/
private String customerAddress;
/**
*
* The address family for the BGP peer.
*
*/
private String addressFamily;
/**
*
* The ID of the Direct Connect gateway.
*
*/
private String directConnectGatewayId;
/**
*
* The tags associated with the transitive virtual interface.
*
*/
private com.amazonaws.internal.SdkInternalList tags;
/**
*
* Indicates whether to enable or disable SiteLink.
*
*/
private Boolean enableSiteLink;
/**
*
* The name of the virtual interface assigned by the customer network. The name has a maximum of 100 characters. The
* following are valid characters: a-z, 0-9 and a hyphen (-).
*
*
* @param virtualInterfaceName
* The name of the virtual interface assigned by the customer network. The name has a maximum of 100
* characters. The following are valid characters: a-z, 0-9 and a hyphen (-).
*/
public void setVirtualInterfaceName(String virtualInterfaceName) {
this.virtualInterfaceName = virtualInterfaceName;
}
/**
*
* The name of the virtual interface assigned by the customer network. The name has a maximum of 100 characters. The
* following are valid characters: a-z, 0-9 and a hyphen (-).
*
*
* @return The name of the virtual interface assigned by the customer network. The name has a maximum of 100
* characters. The following are valid characters: a-z, 0-9 and a hyphen (-).
*/
public String getVirtualInterfaceName() {
return this.virtualInterfaceName;
}
/**
*
* The name of the virtual interface assigned by the customer network. The name has a maximum of 100 characters. The
* following are valid characters: a-z, 0-9 and a hyphen (-).
*
*
* @param virtualInterfaceName
* The name of the virtual interface assigned by the customer network. The name has a maximum of 100
* characters. The following are valid characters: a-z, 0-9 and a hyphen (-).
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NewTransitVirtualInterface withVirtualInterfaceName(String virtualInterfaceName) {
setVirtualInterfaceName(virtualInterfaceName);
return this;
}
/**
*
* The ID of the VLAN.
*
*
* @param vlan
* The ID of the VLAN.
*/
public void setVlan(Integer vlan) {
this.vlan = vlan;
}
/**
*
* The ID of the VLAN.
*
*
* @return The ID of the VLAN.
*/
public Integer getVlan() {
return this.vlan;
}
/**
*
* The ID of the VLAN.
*
*
* @param vlan
* The ID of the VLAN.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NewTransitVirtualInterface withVlan(Integer vlan) {
setVlan(vlan);
return this;
}
/**
*
* The autonomous system (AS) number for Border Gateway Protocol (BGP) configuration.
*
*
* The valid values are 1-2147483647.
*
*
* @param asn
* The autonomous system (AS) number for Border Gateway Protocol (BGP) configuration.
*
* The valid values are 1-2147483647.
*/
public void setAsn(Integer asn) {
this.asn = asn;
}
/**
*
* The autonomous system (AS) number for Border Gateway Protocol (BGP) configuration.
*
*
* The valid values are 1-2147483647.
*
*
* @return The autonomous system (AS) number for Border Gateway Protocol (BGP) configuration.
*
* The valid values are 1-2147483647.
*/
public Integer getAsn() {
return this.asn;
}
/**
*
* The autonomous system (AS) number for Border Gateway Protocol (BGP) configuration.
*
*
* The valid values are 1-2147483647.
*
*
* @param asn
* The autonomous system (AS) number for Border Gateway Protocol (BGP) configuration.
*
* The valid values are 1-2147483647.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NewTransitVirtualInterface withAsn(Integer asn) {
setAsn(asn);
return this;
}
/**
*
* The maximum transmission unit (MTU), in bytes. The supported values are 1500 and 9001. The default value is 1500.
*
*
* @param mtu
* The maximum transmission unit (MTU), in bytes. The supported values are 1500 and 9001. The default value
* is 1500.
*/
public void setMtu(Integer mtu) {
this.mtu = mtu;
}
/**
*
* The maximum transmission unit (MTU), in bytes. The supported values are 1500 and 9001. The default value is 1500.
*
*
* @return The maximum transmission unit (MTU), in bytes. The supported values are 1500 and 9001. The default value
* is 1500.
*/
public Integer getMtu() {
return this.mtu;
}
/**
*
* The maximum transmission unit (MTU), in bytes. The supported values are 1500 and 9001. The default value is 1500.
*
*
* @param mtu
* The maximum transmission unit (MTU), in bytes. The supported values are 1500 and 9001. The default value
* is 1500.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NewTransitVirtualInterface withMtu(Integer mtu) {
setMtu(mtu);
return this;
}
/**
*
* The authentication key for BGP configuration. This string has a minimum length of 6 characters and and a maximun
* lenth of 80 characters.
*
*
* @param authKey
* The authentication key for BGP configuration. This string has a minimum length of 6 characters and and a
* maximun lenth of 80 characters.
*/
public void setAuthKey(String authKey) {
this.authKey = authKey;
}
/**
*
* The authentication key for BGP configuration. This string has a minimum length of 6 characters and and a maximun
* lenth of 80 characters.
*
*
* @return The authentication key for BGP configuration. This string has a minimum length of 6 characters and and a
* maximun lenth of 80 characters.
*/
public String getAuthKey() {
return this.authKey;
}
/**
*
* The authentication key for BGP configuration. This string has a minimum length of 6 characters and and a maximun
* lenth of 80 characters.
*
*
* @param authKey
* The authentication key for BGP configuration. This string has a minimum length of 6 characters and and a
* maximun lenth of 80 characters.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NewTransitVirtualInterface withAuthKey(String authKey) {
setAuthKey(authKey);
return this;
}
/**
*
* The IP address assigned to the Amazon interface.
*
*
* @param amazonAddress
* The IP address assigned to the Amazon interface.
*/
public void setAmazonAddress(String amazonAddress) {
this.amazonAddress = amazonAddress;
}
/**
*
* The IP address assigned to the Amazon interface.
*
*
* @return The IP address assigned to the Amazon interface.
*/
public String getAmazonAddress() {
return this.amazonAddress;
}
/**
*
* The IP address assigned to the Amazon interface.
*
*
* @param amazonAddress
* The IP address assigned to the Amazon interface.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NewTransitVirtualInterface withAmazonAddress(String amazonAddress) {
setAmazonAddress(amazonAddress);
return this;
}
/**
*
* The IP address assigned to the customer interface.
*
*
* @param customerAddress
* The IP address assigned to the customer interface.
*/
public void setCustomerAddress(String customerAddress) {
this.customerAddress = customerAddress;
}
/**
*
* The IP address assigned to the customer interface.
*
*
* @return The IP address assigned to the customer interface.
*/
public String getCustomerAddress() {
return this.customerAddress;
}
/**
*
* The IP address assigned to the customer interface.
*
*
* @param customerAddress
* The IP address assigned to the customer interface.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NewTransitVirtualInterface withCustomerAddress(String customerAddress) {
setCustomerAddress(customerAddress);
return this;
}
/**
*
* The address family for the BGP peer.
*
*
* @param addressFamily
* The address family for the BGP peer.
* @see AddressFamily
*/
public void setAddressFamily(String addressFamily) {
this.addressFamily = addressFamily;
}
/**
*
* The address family for the BGP peer.
*
*
* @return The address family for the BGP peer.
* @see AddressFamily
*/
public String getAddressFamily() {
return this.addressFamily;
}
/**
*
* The address family for the BGP peer.
*
*
* @param addressFamily
* The address family for the BGP peer.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AddressFamily
*/
public NewTransitVirtualInterface withAddressFamily(String addressFamily) {
setAddressFamily(addressFamily);
return this;
}
/**
*
* The address family for the BGP peer.
*
*
* @param addressFamily
* The address family for the BGP peer.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AddressFamily
*/
public NewTransitVirtualInterface withAddressFamily(AddressFamily addressFamily) {
this.addressFamily = addressFamily.toString();
return this;
}
/**
*
* The ID of the Direct Connect gateway.
*
*
* @param directConnectGatewayId
* The ID of the Direct Connect gateway.
*/
public void setDirectConnectGatewayId(String directConnectGatewayId) {
this.directConnectGatewayId = directConnectGatewayId;
}
/**
*
* The ID of the Direct Connect gateway.
*
*
* @return The ID of the Direct Connect gateway.
*/
public String getDirectConnectGatewayId() {
return this.directConnectGatewayId;
}
/**
*
* The ID of the Direct Connect gateway.
*
*
* @param directConnectGatewayId
* The ID of the Direct Connect gateway.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NewTransitVirtualInterface withDirectConnectGatewayId(String directConnectGatewayId) {
setDirectConnectGatewayId(directConnectGatewayId);
return this;
}
/**
*
* The tags associated with the transitive virtual interface.
*
*
* @return The tags associated with the transitive virtual interface.
*/
public java.util.List getTags() {
if (tags == null) {
tags = new com.amazonaws.internal.SdkInternalList();
}
return tags;
}
/**
*
* The tags associated with the transitive virtual interface.
*
*
* @param tags
* The tags associated with the transitive virtual interface.
*/
public void setTags(java.util.Collection tags) {
if (tags == null) {
this.tags = null;
return;
}
this.tags = new com.amazonaws.internal.SdkInternalList(tags);
}
/**
*
* The tags associated with the transitive virtual interface.
*
*
* 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 tags associated with the transitive virtual interface.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NewTransitVirtualInterface 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 tags associated with the transitive virtual interface.
*
*
* @param tags
* The tags associated with the transitive virtual interface.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NewTransitVirtualInterface withTags(java.util.Collection tags) {
setTags(tags);
return this;
}
/**
*
* Indicates whether to enable or disable SiteLink.
*
*
* @param enableSiteLink
* Indicates whether to enable or disable SiteLink.
*/
public void setEnableSiteLink(Boolean enableSiteLink) {
this.enableSiteLink = enableSiteLink;
}
/**
*
* Indicates whether to enable or disable SiteLink.
*
*
* @return Indicates whether to enable or disable SiteLink.
*/
public Boolean getEnableSiteLink() {
return this.enableSiteLink;
}
/**
*
* Indicates whether to enable or disable SiteLink.
*
*
* @param enableSiteLink
* Indicates whether to enable or disable SiteLink.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public NewTransitVirtualInterface withEnableSiteLink(Boolean enableSiteLink) {
setEnableSiteLink(enableSiteLink);
return this;
}
/**
*
* Indicates whether to enable or disable SiteLink.
*
*
* @return Indicates whether to enable or disable SiteLink.
*/
public Boolean isEnableSiteLink() {
return this.enableSiteLink;
}
/**
* 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 (getVirtualInterfaceName() != null)
sb.append("VirtualInterfaceName: ").append(getVirtualInterfaceName()).append(",");
if (getVlan() != null)
sb.append("Vlan: ").append(getVlan()).append(",");
if (getAsn() != null)
sb.append("Asn: ").append(getAsn()).append(",");
if (getMtu() != null)
sb.append("Mtu: ").append(getMtu()).append(",");
if (getAuthKey() != null)
sb.append("AuthKey: ").append(getAuthKey()).append(",");
if (getAmazonAddress() != null)
sb.append("AmazonAddress: ").append(getAmazonAddress()).append(",");
if (getCustomerAddress() != null)
sb.append("CustomerAddress: ").append(getCustomerAddress()).append(",");
if (getAddressFamily() != null)
sb.append("AddressFamily: ").append(getAddressFamily()).append(",");
if (getDirectConnectGatewayId() != null)
sb.append("DirectConnectGatewayId: ").append(getDirectConnectGatewayId()).append(",");
if (getTags() != null)
sb.append("Tags: ").append(getTags()).append(",");
if (getEnableSiteLink() != null)
sb.append("EnableSiteLink: ").append(getEnableSiteLink());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof NewTransitVirtualInterface == false)
return false;
NewTransitVirtualInterface other = (NewTransitVirtualInterface) obj;
if (other.getVirtualInterfaceName() == null ^ this.getVirtualInterfaceName() == null)
return false;
if (other.getVirtualInterfaceName() != null && other.getVirtualInterfaceName().equals(this.getVirtualInterfaceName()) == false)
return false;
if (other.getVlan() == null ^ this.getVlan() == null)
return false;
if (other.getVlan() != null && other.getVlan().equals(this.getVlan()) == false)
return false;
if (other.getAsn() == null ^ this.getAsn() == null)
return false;
if (other.getAsn() != null && other.getAsn().equals(this.getAsn()) == false)
return false;
if (other.getMtu() == null ^ this.getMtu() == null)
return false;
if (other.getMtu() != null && other.getMtu().equals(this.getMtu()) == false)
return false;
if (other.getAuthKey() == null ^ this.getAuthKey() == null)
return false;
if (other.getAuthKey() != null && other.getAuthKey().equals(this.getAuthKey()) == false)
return false;
if (other.getAmazonAddress() == null ^ this.getAmazonAddress() == null)
return false;
if (other.getAmazonAddress() != null && other.getAmazonAddress().equals(this.getAmazonAddress()) == false)
return false;
if (other.getCustomerAddress() == null ^ this.getCustomerAddress() == null)
return false;
if (other.getCustomerAddress() != null && other.getCustomerAddress().equals(this.getCustomerAddress()) == false)
return false;
if (other.getAddressFamily() == null ^ this.getAddressFamily() == null)
return false;
if (other.getAddressFamily() != null && other.getAddressFamily().equals(this.getAddressFamily()) == false)
return false;
if (other.getDirectConnectGatewayId() == null ^ this.getDirectConnectGatewayId() == null)
return false;
if (other.getDirectConnectGatewayId() != null && other.getDirectConnectGatewayId().equals(this.getDirectConnectGatewayId()) == false)
return false;
if (other.getTags() == null ^ this.getTags() == null)
return false;
if (other.getTags() != null && other.getTags().equals(this.getTags()) == false)
return false;
if (other.getEnableSiteLink() == null ^ this.getEnableSiteLink() == null)
return false;
if (other.getEnableSiteLink() != null && other.getEnableSiteLink().equals(this.getEnableSiteLink()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getVirtualInterfaceName() == null) ? 0 : getVirtualInterfaceName().hashCode());
hashCode = prime * hashCode + ((getVlan() == null) ? 0 : getVlan().hashCode());
hashCode = prime * hashCode + ((getAsn() == null) ? 0 : getAsn().hashCode());
hashCode = prime * hashCode + ((getMtu() == null) ? 0 : getMtu().hashCode());
hashCode = prime * hashCode + ((getAuthKey() == null) ? 0 : getAuthKey().hashCode());
hashCode = prime * hashCode + ((getAmazonAddress() == null) ? 0 : getAmazonAddress().hashCode());
hashCode = prime * hashCode + ((getCustomerAddress() == null) ? 0 : getCustomerAddress().hashCode());
hashCode = prime * hashCode + ((getAddressFamily() == null) ? 0 : getAddressFamily().hashCode());
hashCode = prime * hashCode + ((getDirectConnectGatewayId() == null) ? 0 : getDirectConnectGatewayId().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
hashCode = prime * hashCode + ((getEnableSiteLink() == null) ? 0 : getEnableSiteLink().hashCode());
return hashCode;
}
@Override
public NewTransitVirtualInterface clone() {
try {
return (NewTransitVirtualInterface) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.directconnect.model.transform.NewTransitVirtualInterfaceMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}