/* * 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; /** * <p> * Information about the transit gateway in the peering attachment. * </p> * * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/PeeringTgwInfo" target="_top">AWS API * Documentation</a> */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class PeeringTgwInfo implements Serializable, Cloneable { /** * <p> * The ID of the transit gateway. * </p> */ private String transitGatewayId; /** * <p> * The ID of the core network where the transit gateway peer is located. * </p> */ private String coreNetworkId; /** * <p> * The ID of the Amazon Web Services account that owns the transit gateway. * </p> */ private String ownerId; /** * <p> * The Region of the transit gateway. * </p> */ private String region; /** * <p> * The ID of the transit gateway. * </p> * * @param transitGatewayId * The ID of the transit gateway. */ public void setTransitGatewayId(String transitGatewayId) { this.transitGatewayId = transitGatewayId; } /** * <p> * The ID of the transit gateway. * </p> * * @return The ID of the transit gateway. */ public String getTransitGatewayId() { return this.transitGatewayId; } /** * <p> * The ID of the transit gateway. * </p> * * @param transitGatewayId * The ID of the transit gateway. * @return Returns a reference to this object so that method calls can be chained together. */ public PeeringTgwInfo withTransitGatewayId(String transitGatewayId) { setTransitGatewayId(transitGatewayId); return this; } /** * <p> * The ID of the core network where the transit gateway peer is located. * </p> * * @param coreNetworkId * The ID of the core network where the transit gateway peer is located. */ public void setCoreNetworkId(String coreNetworkId) { this.coreNetworkId = coreNetworkId; } /** * <p> * The ID of the core network where the transit gateway peer is located. * </p> * * @return The ID of the core network where the transit gateway peer is located. */ public String getCoreNetworkId() { return this.coreNetworkId; } /** * <p> * The ID of the core network where the transit gateway peer is located. * </p> * * @param coreNetworkId * The ID of the core network where the transit gateway peer is located. * @return Returns a reference to this object so that method calls can be chained together. */ public PeeringTgwInfo withCoreNetworkId(String coreNetworkId) { setCoreNetworkId(coreNetworkId); return this; } /** * <p> * The ID of the Amazon Web Services account that owns the transit gateway. * </p> * * @param ownerId * The ID of the Amazon Web Services account that owns the transit gateway. */ public void setOwnerId(String ownerId) { this.ownerId = ownerId; } /** * <p> * The ID of the Amazon Web Services account that owns the transit gateway. * </p> * * @return The ID of the Amazon Web Services account that owns the transit gateway. */ public String getOwnerId() { return this.ownerId; } /** * <p> * The ID of the Amazon Web Services account that owns the transit gateway. * </p> * * @param ownerId * The ID of the Amazon Web Services account that owns the transit gateway. * @return Returns a reference to this object so that method calls can be chained together. */ public PeeringTgwInfo withOwnerId(String ownerId) { setOwnerId(ownerId); return this; } /** * <p> * The Region of the transit gateway. * </p> * * @param region * The Region of the transit gateway. */ public void setRegion(String region) { this.region = region; } /** * <p> * The Region of the transit gateway. * </p> * * @return The Region of the transit gateway. */ public String getRegion() { return this.region; } /** * <p> * The Region of the transit gateway. * </p> * * @param region * The Region of the transit gateway. * @return Returns a reference to this object so that method calls can be chained together. */ public PeeringTgwInfo 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 (getTransitGatewayId() != null) sb.append("TransitGatewayId: ").append(getTransitGatewayId()).append(","); if (getCoreNetworkId() != null) sb.append("CoreNetworkId: ").append(getCoreNetworkId()).append(","); if (getOwnerId() != null) sb.append("OwnerId: ").append(getOwnerId()).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 PeeringTgwInfo == false) return false; PeeringTgwInfo other = (PeeringTgwInfo) obj; if (other.getTransitGatewayId() == null ^ this.getTransitGatewayId() == null) return false; if (other.getTransitGatewayId() != null && other.getTransitGatewayId().equals(this.getTransitGatewayId()) == false) return false; if (other.getCoreNetworkId() == null ^ this.getCoreNetworkId() == null) return false; if (other.getCoreNetworkId() != null && other.getCoreNetworkId().equals(this.getCoreNetworkId()) == 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.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 + ((getTransitGatewayId() == null) ? 0 : getTransitGatewayId().hashCode()); hashCode = prime * hashCode + ((getCoreNetworkId() == null) ? 0 : getCoreNetworkId().hashCode()); hashCode = prime * hashCode + ((getOwnerId() == null) ? 0 : getOwnerId().hashCode()); hashCode = prime * hashCode + ((getRegion() == null) ? 0 : getRegion().hashCode()); return hashCode; } @Override public PeeringTgwInfo clone() { try { return (PeeringTgwInfo) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }