com.amazonaws.services.ec2.model.TransitGatewayRouteTableRoute Maven / Gradle / Ivy
Show all versions of aws-java-sdk-ec2 Show documentation
/*
* Copyright 2019-2024 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 in a transit gateway route table.
*
*
* @see AWS
* API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class TransitGatewayRouteTableRoute implements Serializable, Cloneable {
/**
*
* The CIDR block used for destination matches.
*
*/
private String destinationCidr;
/**
*
* The state of the route.
*
*/
private String state;
/**
*
* The route origin. The following are the possible values:
*
*
* -
*
* static
*
*
* -
*
* propagated
*
*
*
*/
private String routeOrigin;
/**
*
* The ID of the prefix list.
*
*/
private String prefixListId;
/**
*
* The ID of the route attachment.
*
*/
private String attachmentId;
/**
*
* The ID of the resource for the route attachment.
*
*/
private String resourceId;
/**
*
* The resource type for the route attachment.
*
*/
private String resourceType;
/**
*
* The CIDR block used for destination matches.
*
*
* @param destinationCidr
* The CIDR block used for destination matches.
*/
public void setDestinationCidr(String destinationCidr) {
this.destinationCidr = destinationCidr;
}
/**
*
* The CIDR block used for destination matches.
*
*
* @return The CIDR block used for destination matches.
*/
public String getDestinationCidr() {
return this.destinationCidr;
}
/**
*
* The CIDR block used for destination matches.
*
*
* @param destinationCidr
* The CIDR block used for destination matches.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TransitGatewayRouteTableRoute withDestinationCidr(String destinationCidr) {
setDestinationCidr(destinationCidr);
return this;
}
/**
*
* The state of the route.
*
*
* @param state
* The state of the route.
*/
public void setState(String state) {
this.state = state;
}
/**
*
* The state of the route.
*
*
* @return The state of the route.
*/
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.
*/
public TransitGatewayRouteTableRoute withState(String state) {
setState(state);
return this;
}
/**
*
* The route origin. The following are the possible values:
*
*
* -
*
* static
*
*
* -
*
* propagated
*
*
*
*
* @param routeOrigin
* The route origin. The following are the possible values:
*
* -
*
* static
*
*
* -
*
* propagated
*
*
*/
public void setRouteOrigin(String routeOrigin) {
this.routeOrigin = routeOrigin;
}
/**
*
* The route origin. The following are the possible values:
*
*
* -
*
* static
*
*
* -
*
* propagated
*
*
*
*
* @return The route origin. The following are the possible values:
*
* -
*
* static
*
*
* -
*
* propagated
*
*
*/
public String getRouteOrigin() {
return this.routeOrigin;
}
/**
*
* The route origin. The following are the possible values:
*
*
* -
*
* static
*
*
* -
*
* propagated
*
*
*
*
* @param routeOrigin
* The route origin. The following are the possible values:
*
* -
*
* static
*
*
* -
*
* propagated
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TransitGatewayRouteTableRoute withRouteOrigin(String routeOrigin) {
setRouteOrigin(routeOrigin);
return this;
}
/**
*
* The ID of the prefix list.
*
*
* @param prefixListId
* The ID of the prefix list.
*/
public void setPrefixListId(String prefixListId) {
this.prefixListId = prefixListId;
}
/**
*
* The ID of the prefix list.
*
*
* @return The ID of the prefix list.
*/
public String getPrefixListId() {
return this.prefixListId;
}
/**
*
* The ID of the prefix list.
*
*
* @param prefixListId
* The ID of the prefix list.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TransitGatewayRouteTableRoute withPrefixListId(String prefixListId) {
setPrefixListId(prefixListId);
return this;
}
/**
*
* The ID of the route attachment.
*
*
* @param attachmentId
* The ID of the route attachment.
*/
public void setAttachmentId(String attachmentId) {
this.attachmentId = attachmentId;
}
/**
*
* The ID of the route attachment.
*
*
* @return The ID of the route attachment.
*/
public String getAttachmentId() {
return this.attachmentId;
}
/**
*
* The ID of the route attachment.
*
*
* @param attachmentId
* The ID of the route attachment.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TransitGatewayRouteTableRoute withAttachmentId(String attachmentId) {
setAttachmentId(attachmentId);
return this;
}
/**
*
* The ID of the resource for the route attachment.
*
*
* @param resourceId
* The ID of the resource for the route attachment.
*/
public void setResourceId(String resourceId) {
this.resourceId = resourceId;
}
/**
*
* The ID of the resource for the route attachment.
*
*
* @return The ID of the resource for the route attachment.
*/
public String getResourceId() {
return this.resourceId;
}
/**
*
* The ID of the resource for the route attachment.
*
*
* @param resourceId
* The ID of the resource for the route attachment.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TransitGatewayRouteTableRoute withResourceId(String resourceId) {
setResourceId(resourceId);
return this;
}
/**
*
* The resource type for the route attachment.
*
*
* @param resourceType
* The resource type for the route attachment.
*/
public void setResourceType(String resourceType) {
this.resourceType = resourceType;
}
/**
*
* The resource type for the route attachment.
*
*
* @return The resource type for the route attachment.
*/
public String getResourceType() {
return this.resourceType;
}
/**
*
* The resource type for the route attachment.
*
*
* @param resourceType
* The resource type for the route attachment.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TransitGatewayRouteTableRoute withResourceType(String resourceType) {
setResourceType(resourceType);
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 (getDestinationCidr() != null)
sb.append("DestinationCidr: ").append(getDestinationCidr()).append(",");
if (getState() != null)
sb.append("State: ").append(getState()).append(",");
if (getRouteOrigin() != null)
sb.append("RouteOrigin: ").append(getRouteOrigin()).append(",");
if (getPrefixListId() != null)
sb.append("PrefixListId: ").append(getPrefixListId()).append(",");
if (getAttachmentId() != null)
sb.append("AttachmentId: ").append(getAttachmentId()).append(",");
if (getResourceId() != null)
sb.append("ResourceId: ").append(getResourceId()).append(",");
if (getResourceType() != null)
sb.append("ResourceType: ").append(getResourceType());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof TransitGatewayRouteTableRoute == false)
return false;
TransitGatewayRouteTableRoute other = (TransitGatewayRouteTableRoute) obj;
if (other.getDestinationCidr() == null ^ this.getDestinationCidr() == null)
return false;
if (other.getDestinationCidr() != null && other.getDestinationCidr().equals(this.getDestinationCidr()) == 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.getRouteOrigin() == null ^ this.getRouteOrigin() == null)
return false;
if (other.getRouteOrigin() != null && other.getRouteOrigin().equals(this.getRouteOrigin()) == false)
return false;
if (other.getPrefixListId() == null ^ this.getPrefixListId() == null)
return false;
if (other.getPrefixListId() != null && other.getPrefixListId().equals(this.getPrefixListId()) == false)
return false;
if (other.getAttachmentId() == null ^ this.getAttachmentId() == null)
return false;
if (other.getAttachmentId() != null && other.getAttachmentId().equals(this.getAttachmentId()) == false)
return false;
if (other.getResourceId() == null ^ this.getResourceId() == null)
return false;
if (other.getResourceId() != null && other.getResourceId().equals(this.getResourceId()) == false)
return false;
if (other.getResourceType() == null ^ this.getResourceType() == null)
return false;
if (other.getResourceType() != null && other.getResourceType().equals(this.getResourceType()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getDestinationCidr() == null) ? 0 : getDestinationCidr().hashCode());
hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode());
hashCode = prime * hashCode + ((getRouteOrigin() == null) ? 0 : getRouteOrigin().hashCode());
hashCode = prime * hashCode + ((getPrefixListId() == null) ? 0 : getPrefixListId().hashCode());
hashCode = prime * hashCode + ((getAttachmentId() == null) ? 0 : getAttachmentId().hashCode());
hashCode = prime * hashCode + ((getResourceId() == null) ? 0 : getResourceId().hashCode());
hashCode = prime * hashCode + ((getResourceType() == null) ? 0 : getResourceType().hashCode());
return hashCode;
}
@Override
public TransitGatewayRouteTableRoute clone() {
try {
return (TransitGatewayRouteTableRoute) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}