/* * 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 local gateway virtual interface. *

* * @see AWS * API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class LocalGatewayVirtualInterface implements Serializable, Cloneable { /** *

* The ID of the virtual interface. *

*/ private String localGatewayVirtualInterfaceId; /** *

* The ID of the local gateway. *

*/ private String localGatewayId; /** *

* The ID of the VLAN. *

*/ private Integer vlan; /** *

* The local address. *

*/ private String localAddress; /** *

* The peer address. *

*/ private String peerAddress; /** *

* The Border Gateway Protocol (BGP) Autonomous System Number (ASN) of the local gateway. *

*/ private Integer localBgpAsn; /** *

* The peer BGP ASN. *

*/ private Integer peerBgpAsn; /** *

* The ID of the Amazon Web Services account that owns the local gateway virtual interface. *

*/ private String ownerId; /** *

* The tags assigned to the virtual interface. *

*/ private com.amazonaws.internal.SdkInternalList tags; /** *

* The ID of the virtual interface. *

* * @param localGatewayVirtualInterfaceId * The ID of the virtual interface. */ public void setLocalGatewayVirtualInterfaceId(String localGatewayVirtualInterfaceId) { this.localGatewayVirtualInterfaceId = localGatewayVirtualInterfaceId; } /** *

* The ID of the virtual interface. *

* * @return The ID of the virtual interface. */ public String getLocalGatewayVirtualInterfaceId() { return this.localGatewayVirtualInterfaceId; } /** *

* The ID of the virtual interface. *

* * @param localGatewayVirtualInterfaceId * The ID of the virtual interface. * @return Returns a reference to this object so that method calls can be chained together. */ public LocalGatewayVirtualInterface withLocalGatewayVirtualInterfaceId(String localGatewayVirtualInterfaceId) { setLocalGatewayVirtualInterfaceId(localGatewayVirtualInterfaceId); return this; } /** *

* The ID of the local gateway. *

* * @param localGatewayId * The ID of the local gateway. */ public void setLocalGatewayId(String localGatewayId) { this.localGatewayId = localGatewayId; } /** *

* The ID of the local gateway. *

* * @return The ID of the local gateway. */ public String getLocalGatewayId() { return this.localGatewayId; } /** *

* The ID of the local gateway. *

* * @param localGatewayId * The ID of the local gateway. * @return Returns a reference to this object so that method calls can be chained together. */ public LocalGatewayVirtualInterface withLocalGatewayId(String localGatewayId) { setLocalGatewayId(localGatewayId); 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 LocalGatewayVirtualInterface withVlan(Integer vlan) { setVlan(vlan); return this; } /** *

* The local address. *

* * @param localAddress * The local address. */ public void setLocalAddress(String localAddress) { this.localAddress = localAddress; } /** *

* The local address. *

* * @return The local address. */ public String getLocalAddress() { return this.localAddress; } /** *

* The local address. *

* * @param localAddress * The local address. * @return Returns a reference to this object so that method calls can be chained together. */ public LocalGatewayVirtualInterface withLocalAddress(String localAddress) { setLocalAddress(localAddress); return this; } /** *

* The peer address. *

* * @param peerAddress * The peer address. */ public void setPeerAddress(String peerAddress) { this.peerAddress = peerAddress; } /** *

* The peer address. *

* * @return The peer address. */ public String getPeerAddress() { return this.peerAddress; } /** *

* The peer address. *

* * @param peerAddress * The peer address. * @return Returns a reference to this object so that method calls can be chained together. */ public LocalGatewayVirtualInterface withPeerAddress(String peerAddress) { setPeerAddress(peerAddress); return this; } /** *

* The Border Gateway Protocol (BGP) Autonomous System Number (ASN) of the local gateway. *

* * @param localBgpAsn * The Border Gateway Protocol (BGP) Autonomous System Number (ASN) of the local gateway. */ public void setLocalBgpAsn(Integer localBgpAsn) { this.localBgpAsn = localBgpAsn; } /** *

* The Border Gateway Protocol (BGP) Autonomous System Number (ASN) of the local gateway. *

* * @return The Border Gateway Protocol (BGP) Autonomous System Number (ASN) of the local gateway. */ public Integer getLocalBgpAsn() { return this.localBgpAsn; } /** *

* The Border Gateway Protocol (BGP) Autonomous System Number (ASN) of the local gateway. *

* * @param localBgpAsn * The Border Gateway Protocol (BGP) Autonomous System Number (ASN) of the local gateway. * @return Returns a reference to this object so that method calls can be chained together. */ public LocalGatewayVirtualInterface withLocalBgpAsn(Integer localBgpAsn) { setLocalBgpAsn(localBgpAsn); return this; } /** *

* The peer BGP ASN. *

* * @param peerBgpAsn * The peer BGP ASN. */ public void setPeerBgpAsn(Integer peerBgpAsn) { this.peerBgpAsn = peerBgpAsn; } /** *

* The peer BGP ASN. *

* * @return The peer BGP ASN. */ public Integer getPeerBgpAsn() { return this.peerBgpAsn; } /** *

* The peer BGP ASN. *

* * @param peerBgpAsn * The peer BGP ASN. * @return Returns a reference to this object so that method calls can be chained together. */ public LocalGatewayVirtualInterface withPeerBgpAsn(Integer peerBgpAsn) { setPeerBgpAsn(peerBgpAsn); return this; } /** *

* The ID of the Amazon Web Services account that owns the local gateway virtual interface. *

* * @param ownerId * The ID of the Amazon Web Services account that owns the local gateway virtual interface. */ public void setOwnerId(String ownerId) { this.ownerId = ownerId; } /** *

* The ID of the Amazon Web Services account that owns the local gateway virtual interface. *

* * @return The ID of the Amazon Web Services account that owns the local gateway virtual interface. */ public String getOwnerId() { return this.ownerId; } /** *

* The ID of the Amazon Web Services account that owns the local gateway virtual interface. *

* * @param ownerId * The ID of the Amazon Web Services account that owns the local gateway virtual interface. * @return Returns a reference to this object so that method calls can be chained together. */ public LocalGatewayVirtualInterface withOwnerId(String ownerId) { setOwnerId(ownerId); return this; } /** *

* The tags assigned to the virtual interface. *

* * @return The tags assigned to the virtual interface. */ public java.util.List getTags() { if (tags == null) { tags = new com.amazonaws.internal.SdkInternalList(); } return tags; } /** *

* The tags assigned to the virtual interface. *

* * @param tags * The tags assigned to the 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 assigned to the 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 assigned to the virtual interface. * @return Returns a reference to this object so that method calls can be chained together. */ public LocalGatewayVirtualInterface 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 assigned to the virtual interface. *

* * @param tags * The tags assigned to the virtual interface. * @return Returns a reference to this object so that method calls can be chained together. */ public LocalGatewayVirtualInterface 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 (getLocalGatewayVirtualInterfaceId() != null) sb.append("LocalGatewayVirtualInterfaceId: ").append(getLocalGatewayVirtualInterfaceId()).append(","); if (getLocalGatewayId() != null) sb.append("LocalGatewayId: ").append(getLocalGatewayId()).append(","); if (getVlan() != null) sb.append("Vlan: ").append(getVlan()).append(","); if (getLocalAddress() != null) sb.append("LocalAddress: ").append(getLocalAddress()).append(","); if (getPeerAddress() != null) sb.append("PeerAddress: ").append(getPeerAddress()).append(","); if (getLocalBgpAsn() != null) sb.append("LocalBgpAsn: ").append(getLocalBgpAsn()).append(","); if (getPeerBgpAsn() != null) sb.append("PeerBgpAsn: ").append(getPeerBgpAsn()).append(","); if (getOwnerId() != null) sb.append("OwnerId: ").append(getOwnerId()).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 LocalGatewayVirtualInterface == false) return false; LocalGatewayVirtualInterface other = (LocalGatewayVirtualInterface) obj; if (other.getLocalGatewayVirtualInterfaceId() == null ^ this.getLocalGatewayVirtualInterfaceId() == null) return false; if (other.getLocalGatewayVirtualInterfaceId() != null && other.getLocalGatewayVirtualInterfaceId().equals(this.getLocalGatewayVirtualInterfaceId()) == false) return false; if (other.getLocalGatewayId() == null ^ this.getLocalGatewayId() == null) return false; if (other.getLocalGatewayId() != null && other.getLocalGatewayId().equals(this.getLocalGatewayId()) == 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.getLocalAddress() == null ^ this.getLocalAddress() == null) return false; if (other.getLocalAddress() != null && other.getLocalAddress().equals(this.getLocalAddress()) == 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.getLocalBgpAsn() == null ^ this.getLocalBgpAsn() == null) return false; if (other.getLocalBgpAsn() != null && other.getLocalBgpAsn().equals(this.getLocalBgpAsn()) == false) return false; if (other.getPeerBgpAsn() == null ^ this.getPeerBgpAsn() == null) return false; if (other.getPeerBgpAsn() != null && other.getPeerBgpAsn().equals(this.getPeerBgpAsn()) == 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.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 + ((getLocalGatewayVirtualInterfaceId() == null) ? 0 : getLocalGatewayVirtualInterfaceId().hashCode()); hashCode = prime * hashCode + ((getLocalGatewayId() == null) ? 0 : getLocalGatewayId().hashCode()); hashCode = prime * hashCode + ((getVlan() == null) ? 0 : getVlan().hashCode()); hashCode = prime * hashCode + ((getLocalAddress() == null) ? 0 : getLocalAddress().hashCode()); hashCode = prime * hashCode + ((getPeerAddress() == null) ? 0 : getPeerAddress().hashCode()); hashCode = prime * hashCode + ((getLocalBgpAsn() == null) ? 0 : getLocalBgpAsn().hashCode()); hashCode = prime * hashCode + ((getPeerBgpAsn() == null) ? 0 : getPeerBgpAsn().hashCode()); hashCode = prime * hashCode + ((getOwnerId() == null) ? 0 : getOwnerId().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); return hashCode; } @Override public LocalGatewayVirtualInterface clone() { try { return (LocalGatewayVirtualInterface) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }