com.amazonaws.services.ec2.model.CustomerGateway Maven / Gradle / Ivy
Show all versions of aws-java-sdk-ec2 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.ec2.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* Describes a customer gateway.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CustomerGateway implements Serializable, Cloneable {
/**
*
* The customer gateway's Border Gateway Protocol (BGP) Autonomous System Number (ASN).
*
*/
private String bgpAsn;
/**
*
* The ID of the customer gateway.
*
*/
private String customerGatewayId;
/**
*
* The IP address of the customer gateway device's outside interface.
*
*/
private String ipAddress;
/**
*
* The Amazon Resource Name (ARN) for the customer gateway certificate.
*
*/
private String certificateArn;
/**
*
* The current state of the customer gateway (pending | available | deleting | deleted
).
*
*/
private String state;
/**
*
* The type of VPN connection the customer gateway supports (ipsec.1
).
*
*/
private String type;
/**
*
* The name of customer gateway device.
*
*/
private String deviceName;
/**
*
* Any tags assigned to the customer gateway.
*
*/
private com.amazonaws.internal.SdkInternalList tags;
/**
*
* The customer gateway's Border Gateway Protocol (BGP) Autonomous System Number (ASN).
*
*
* @param bgpAsn
* The customer gateway's Border Gateway Protocol (BGP) Autonomous System Number (ASN).
*/
public void setBgpAsn(String bgpAsn) {
this.bgpAsn = bgpAsn;
}
/**
*
* The customer gateway's Border Gateway Protocol (BGP) Autonomous System Number (ASN).
*
*
* @return The customer gateway's Border Gateway Protocol (BGP) Autonomous System Number (ASN).
*/
public String getBgpAsn() {
return this.bgpAsn;
}
/**
*
* The customer gateway's Border Gateway Protocol (BGP) Autonomous System Number (ASN).
*
*
* @param bgpAsn
* The customer gateway's Border Gateway Protocol (BGP) Autonomous System Number (ASN).
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CustomerGateway withBgpAsn(String bgpAsn) {
setBgpAsn(bgpAsn);
return this;
}
/**
*
* The ID of the customer gateway.
*
*
* @param customerGatewayId
* The ID of the customer gateway.
*/
public void setCustomerGatewayId(String customerGatewayId) {
this.customerGatewayId = customerGatewayId;
}
/**
*
* The ID of the customer gateway.
*
*
* @return The ID of the customer gateway.
*/
public String getCustomerGatewayId() {
return this.customerGatewayId;
}
/**
*
* The ID of the customer gateway.
*
*
* @param customerGatewayId
* The ID of the customer gateway.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CustomerGateway withCustomerGatewayId(String customerGatewayId) {
setCustomerGatewayId(customerGatewayId);
return this;
}
/**
*
* The IP address of the customer gateway device's outside interface.
*
*
* @param ipAddress
* The IP address of the customer gateway device's outside interface.
*/
public void setIpAddress(String ipAddress) {
this.ipAddress = ipAddress;
}
/**
*
* The IP address of the customer gateway device's outside interface.
*
*
* @return The IP address of the customer gateway device's outside interface.
*/
public String getIpAddress() {
return this.ipAddress;
}
/**
*
* The IP address of the customer gateway device's outside interface.
*
*
* @param ipAddress
* The IP address of the customer gateway device's outside interface.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CustomerGateway withIpAddress(String ipAddress) {
setIpAddress(ipAddress);
return this;
}
/**
*
* The Amazon Resource Name (ARN) for the customer gateway certificate.
*
*
* @param certificateArn
* The Amazon Resource Name (ARN) for the customer gateway certificate.
*/
public void setCertificateArn(String certificateArn) {
this.certificateArn = certificateArn;
}
/**
*
* The Amazon Resource Name (ARN) for the customer gateway certificate.
*
*
* @return The Amazon Resource Name (ARN) for the customer gateway certificate.
*/
public String getCertificateArn() {
return this.certificateArn;
}
/**
*
* The Amazon Resource Name (ARN) for the customer gateway certificate.
*
*
* @param certificateArn
* The Amazon Resource Name (ARN) for the customer gateway certificate.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CustomerGateway withCertificateArn(String certificateArn) {
setCertificateArn(certificateArn);
return this;
}
/**
*
* The current state of the customer gateway (pending | available | deleting | deleted
).
*
*
* @param state
* The current state of the customer gateway (pending | available | deleting | deleted
).
*/
public void setState(String state) {
this.state = state;
}
/**
*
* The current state of the customer gateway (pending | available | deleting | deleted
).
*
*
* @return The current state of the customer gateway (pending | available | deleting | deleted
).
*/
public String getState() {
return this.state;
}
/**
*
* The current state of the customer gateway (pending | available | deleting | deleted
).
*
*
* @param state
* The current state of the customer gateway (pending | available | deleting | deleted
).
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CustomerGateway withState(String state) {
setState(state);
return this;
}
/**
*
* The type of VPN connection the customer gateway supports (ipsec.1
).
*
*
* @param type
* The type of VPN connection the customer gateway supports (ipsec.1
).
*/
public void setType(String type) {
this.type = type;
}
/**
*
* The type of VPN connection the customer gateway supports (ipsec.1
).
*
*
* @return The type of VPN connection the customer gateway supports (ipsec.1
).
*/
public String getType() {
return this.type;
}
/**
*
* The type of VPN connection the customer gateway supports (ipsec.1
).
*
*
* @param type
* The type of VPN connection the customer gateway supports (ipsec.1
).
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CustomerGateway withType(String type) {
setType(type);
return this;
}
/**
*
* The name of customer gateway device.
*
*
* @param deviceName
* The name of customer gateway device.
*/
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
/**
*
* The name of customer gateway device.
*
*
* @return The name of customer gateway device.
*/
public String getDeviceName() {
return this.deviceName;
}
/**
*
* The name of customer gateway device.
*
*
* @param deviceName
* The name of customer gateway device.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CustomerGateway withDeviceName(String deviceName) {
setDeviceName(deviceName);
return this;
}
/**
*
* Any tags assigned to the customer gateway.
*
*
* @return Any tags assigned to the customer gateway.
*/
public java.util.List getTags() {
if (tags == null) {
tags = new com.amazonaws.internal.SdkInternalList();
}
return tags;
}
/**
*
* Any tags assigned to the customer gateway.
*
*
* @param tags
* Any tags assigned to the customer gateway.
*/
public void setTags(java.util.Collection tags) {
if (tags == null) {
this.tags = null;
return;
}
this.tags = new com.amazonaws.internal.SdkInternalList(tags);
}
/**
*
* Any tags assigned to the customer gateway.
*
*
* 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
* Any tags assigned to the customer gateway.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CustomerGateway 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;
}
/**
*
* Any tags assigned to the customer gateway.
*
*
* @param tags
* Any tags assigned to the customer gateway.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CustomerGateway withTags(java.util.Collection tags) {
setTags(tags);
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 (getBgpAsn() != null)
sb.append("BgpAsn: ").append(getBgpAsn()).append(",");
if (getCustomerGatewayId() != null)
sb.append("CustomerGatewayId: ").append(getCustomerGatewayId()).append(",");
if (getIpAddress() != null)
sb.append("IpAddress: ").append(getIpAddress()).append(",");
if (getCertificateArn() != null)
sb.append("CertificateArn: ").append(getCertificateArn()).append(",");
if (getState() != null)
sb.append("State: ").append(getState()).append(",");
if (getType() != null)
sb.append("Type: ").append(getType()).append(",");
if (getDeviceName() != null)
sb.append("DeviceName: ").append(getDeviceName()).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 CustomerGateway == false)
return false;
CustomerGateway other = (CustomerGateway) obj;
if (other.getBgpAsn() == null ^ this.getBgpAsn() == null)
return false;
if (other.getBgpAsn() != null && other.getBgpAsn().equals(this.getBgpAsn()) == false)
return false;
if (other.getCustomerGatewayId() == null ^ this.getCustomerGatewayId() == null)
return false;
if (other.getCustomerGatewayId() != null && other.getCustomerGatewayId().equals(this.getCustomerGatewayId()) == false)
return false;
if (other.getIpAddress() == null ^ this.getIpAddress() == null)
return false;
if (other.getIpAddress() != null && other.getIpAddress().equals(this.getIpAddress()) == false)
return false;
if (other.getCertificateArn() == null ^ this.getCertificateArn() == null)
return false;
if (other.getCertificateArn() != null && other.getCertificateArn().equals(this.getCertificateArn()) == 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.getType() == null ^ this.getType() == null)
return false;
if (other.getType() != null && other.getType().equals(this.getType()) == false)
return false;
if (other.getDeviceName() == null ^ this.getDeviceName() == null)
return false;
if (other.getDeviceName() != null && other.getDeviceName().equals(this.getDeviceName()) == 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 + ((getBgpAsn() == null) ? 0 : getBgpAsn().hashCode());
hashCode = prime * hashCode + ((getCustomerGatewayId() == null) ? 0 : getCustomerGatewayId().hashCode());
hashCode = prime * hashCode + ((getIpAddress() == null) ? 0 : getIpAddress().hashCode());
hashCode = prime * hashCode + ((getCertificateArn() == null) ? 0 : getCertificateArn().hashCode());
hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode());
hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode());
hashCode = prime * hashCode + ((getDeviceName() == null) ? 0 : getDeviceName().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
return hashCode;
}
@Override
public CustomerGateway clone() {
try {
return (CustomerGateway) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}