com.amazonaws.services.ec2.model.LocalGatewayRoute 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 route for a local gateway route table.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class LocalGatewayRoute implements Serializable, Cloneable {
/**
*
* The CIDR block used for destination matches.
*
*/
private String destinationCidrBlock;
/**
*
* The ID of the virtual interface group.
*
*/
private String localGatewayVirtualInterfaceGroupId;
/**
*
* The route type.
*
*/
private String type;
/**
*
* The state of the route.
*
*/
private String state;
/**
*
* The ID of the local gateway route table.
*
*/
private String localGatewayRouteTableId;
/**
*
* The Amazon Resource Name (ARN) of the local gateway route table.
*
*/
private String localGatewayRouteTableArn;
/**
*
* The ID of the Amazon Web Services account that owns the local gateway route.
*
*/
private String ownerId;
/**
*
* The CIDR block used for destination matches.
*
*
* @param destinationCidrBlock
* The CIDR block used for destination matches.
*/
public void setDestinationCidrBlock(String destinationCidrBlock) {
this.destinationCidrBlock = destinationCidrBlock;
}
/**
*
* The CIDR block used for destination matches.
*
*
* @return The CIDR block used for destination matches.
*/
public String getDestinationCidrBlock() {
return this.destinationCidrBlock;
}
/**
*
* The CIDR block used for destination matches.
*
*
* @param destinationCidrBlock
* The CIDR block used for destination matches.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LocalGatewayRoute withDestinationCidrBlock(String destinationCidrBlock) {
setDestinationCidrBlock(destinationCidrBlock);
return this;
}
/**
*
* The ID of the virtual interface group.
*
*
* @param localGatewayVirtualInterfaceGroupId
* The ID of the virtual interface group.
*/
public void setLocalGatewayVirtualInterfaceGroupId(String localGatewayVirtualInterfaceGroupId) {
this.localGatewayVirtualInterfaceGroupId = localGatewayVirtualInterfaceGroupId;
}
/**
*
* The ID of the virtual interface group.
*
*
* @return The ID of the virtual interface group.
*/
public String getLocalGatewayVirtualInterfaceGroupId() {
return this.localGatewayVirtualInterfaceGroupId;
}
/**
*
* The ID of the virtual interface group.
*
*
* @param localGatewayVirtualInterfaceGroupId
* The ID of the virtual interface group.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LocalGatewayRoute withLocalGatewayVirtualInterfaceGroupId(String localGatewayVirtualInterfaceGroupId) {
setLocalGatewayVirtualInterfaceGroupId(localGatewayVirtualInterfaceGroupId);
return this;
}
/**
*
* The route type.
*
*
* @param type
* The route type.
* @see LocalGatewayRouteType
*/
public void setType(String type) {
this.type = type;
}
/**
*
* The route type.
*
*
* @return The route type.
* @see LocalGatewayRouteType
*/
public String getType() {
return this.type;
}
/**
*
* The route type.
*
*
* @param type
* The route type.
* @return Returns a reference to this object so that method calls can be chained together.
* @see LocalGatewayRouteType
*/
public LocalGatewayRoute withType(String type) {
setType(type);
return this;
}
/**
*
* The route type.
*
*
* @param type
* The route type.
* @return Returns a reference to this object so that method calls can be chained together.
* @see LocalGatewayRouteType
*/
public LocalGatewayRoute withType(LocalGatewayRouteType type) {
this.type = type.toString();
return this;
}
/**
*
* The state of the route.
*
*
* @param state
* The state of the route.
* @see LocalGatewayRouteState
*/
public void setState(String state) {
this.state = state;
}
/**
*
* The state of the route.
*
*
* @return The state of the route.
* @see LocalGatewayRouteState
*/
public String getState() {
return this.state;
}
/**
*
* The state of the route.
*
*
* @param state
* The state of the route.
* @return Returns a reference to this object so that method calls can be chained together.
* @see LocalGatewayRouteState
*/
public LocalGatewayRoute withState(String state) {
setState(state);
return this;
}
/**
*
* The state of the route.
*
*
* @param state
* The state of the route.
* @return Returns a reference to this object so that method calls can be chained together.
* @see LocalGatewayRouteState
*/
public LocalGatewayRoute withState(LocalGatewayRouteState state) {
this.state = state.toString();
return this;
}
/**
*
* The ID of the local gateway route table.
*
*
* @param localGatewayRouteTableId
* The ID of the local gateway route table.
*/
public void setLocalGatewayRouteTableId(String localGatewayRouteTableId) {
this.localGatewayRouteTableId = localGatewayRouteTableId;
}
/**
*
* The ID of the local gateway route table.
*
*
* @return The ID of the local gateway route table.
*/
public String getLocalGatewayRouteTableId() {
return this.localGatewayRouteTableId;
}
/**
*
* The ID of the local gateway route table.
*
*
* @param localGatewayRouteTableId
* The ID of the local gateway route table.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LocalGatewayRoute withLocalGatewayRouteTableId(String localGatewayRouteTableId) {
setLocalGatewayRouteTableId(localGatewayRouteTableId);
return this;
}
/**
*
* The Amazon Resource Name (ARN) of the local gateway route table.
*
*
* @param localGatewayRouteTableArn
* The Amazon Resource Name (ARN) of the local gateway route table.
*/
public void setLocalGatewayRouteTableArn(String localGatewayRouteTableArn) {
this.localGatewayRouteTableArn = localGatewayRouteTableArn;
}
/**
*
* The Amazon Resource Name (ARN) of the local gateway route table.
*
*
* @return The Amazon Resource Name (ARN) of the local gateway route table.
*/
public String getLocalGatewayRouteTableArn() {
return this.localGatewayRouteTableArn;
}
/**
*
* The Amazon Resource Name (ARN) of the local gateway route table.
*
*
* @param localGatewayRouteTableArn
* The Amazon Resource Name (ARN) of the local gateway route table.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LocalGatewayRoute withLocalGatewayRouteTableArn(String localGatewayRouteTableArn) {
setLocalGatewayRouteTableArn(localGatewayRouteTableArn);
return this;
}
/**
*
* The ID of the Amazon Web Services account that owns the local gateway route.
*
*
* @param ownerId
* The ID of the Amazon Web Services account that owns the local gateway route.
*/
public void setOwnerId(String ownerId) {
this.ownerId = ownerId;
}
/**
*
* The ID of the Amazon Web Services account that owns the local gateway route.
*
*
* @return The ID of the Amazon Web Services account that owns the local gateway route.
*/
public String getOwnerId() {
return this.ownerId;
}
/**
*
* The ID of the Amazon Web Services account that owns the local gateway route.
*
*
* @param ownerId
* The ID of the Amazon Web Services account that owns the local gateway route.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LocalGatewayRoute withOwnerId(String ownerId) {
setOwnerId(ownerId);
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 (getDestinationCidrBlock() != null)
sb.append("DestinationCidrBlock: ").append(getDestinationCidrBlock()).append(",");
if (getLocalGatewayVirtualInterfaceGroupId() != null)
sb.append("LocalGatewayVirtualInterfaceGroupId: ").append(getLocalGatewayVirtualInterfaceGroupId()).append(",");
if (getType() != null)
sb.append("Type: ").append(getType()).append(",");
if (getState() != null)
sb.append("State: ").append(getState()).append(",");
if (getLocalGatewayRouteTableId() != null)
sb.append("LocalGatewayRouteTableId: ").append(getLocalGatewayRouteTableId()).append(",");
if (getLocalGatewayRouteTableArn() != null)
sb.append("LocalGatewayRouteTableArn: ").append(getLocalGatewayRouteTableArn()).append(",");
if (getOwnerId() != null)
sb.append("OwnerId: ").append(getOwnerId());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof LocalGatewayRoute == false)
return false;
LocalGatewayRoute other = (LocalGatewayRoute) obj;
if (other.getDestinationCidrBlock() == null ^ this.getDestinationCidrBlock() == null)
return false;
if (other.getDestinationCidrBlock() != null && other.getDestinationCidrBlock().equals(this.getDestinationCidrBlock()) == false)
return false;
if (other.getLocalGatewayVirtualInterfaceGroupId() == null ^ this.getLocalGatewayVirtualInterfaceGroupId() == null)
return false;
if (other.getLocalGatewayVirtualInterfaceGroupId() != null
&& other.getLocalGatewayVirtualInterfaceGroupId().equals(this.getLocalGatewayVirtualInterfaceGroupId()) == 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.getState() == null ^ this.getState() == null)
return false;
if (other.getState() != null && other.getState().equals(this.getState()) == false)
return false;
if (other.getLocalGatewayRouteTableId() == null ^ this.getLocalGatewayRouteTableId() == null)
return false;
if (other.getLocalGatewayRouteTableId() != null && other.getLocalGatewayRouteTableId().equals(this.getLocalGatewayRouteTableId()) == false)
return false;
if (other.getLocalGatewayRouteTableArn() == null ^ this.getLocalGatewayRouteTableArn() == null)
return false;
if (other.getLocalGatewayRouteTableArn() != null && other.getLocalGatewayRouteTableArn().equals(this.getLocalGatewayRouteTableArn()) == false)
return false;
if (other.getOwnerId() == null ^ this.getOwnerId() == null)
return false;
if (other.getOwnerId() != null && other.getOwnerId().equals(this.getOwnerId()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getDestinationCidrBlock() == null) ? 0 : getDestinationCidrBlock().hashCode());
hashCode = prime * hashCode + ((getLocalGatewayVirtualInterfaceGroupId() == null) ? 0 : getLocalGatewayVirtualInterfaceGroupId().hashCode());
hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode());
hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode());
hashCode = prime * hashCode + ((getLocalGatewayRouteTableId() == null) ? 0 : getLocalGatewayRouteTableId().hashCode());
hashCode = prime * hashCode + ((getLocalGatewayRouteTableArn() == null) ? 0 : getLocalGatewayRouteTableArn().hashCode());
hashCode = prime * hashCode + ((getOwnerId() == null) ? 0 : getOwnerId().hashCode());
return hashCode;
}
@Override
public LocalGatewayRoute clone() {
try {
return (LocalGatewayRoute) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}