All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazonaws.services.ec2.model.RouteTable Maven / Gradle / Ivy

Go to download

The AWS SDK for Java with support for OSGi. The AWS SDK for Java provides Java APIs for building software on AWS' cost-effective, scalable, and reliable infrastructure products. The AWS Java SDK allows developers to code against APIs for all of Amazon's infrastructure web services (Amazon S3, Amazon EC2, Amazon SQS, Amazon Relational Database Service, Amazon AutoScaling, etc).

There is a newer version: 1.11.60
Show newest version
/*
 * Copyright 2011-2016 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;

/**
 * 

* Describes a route table. *

*/ public class RouteTable implements Serializable, Cloneable { /** *

* The ID of the route table. *

*/ private String routeTableId; /** *

* The ID of the VPC. *

*/ private String vpcId; /** *

* The routes in the route table. *

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

* The associations between the route table and one or more subnets. *

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

* Any tags assigned to the route table. *

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

* Any virtual private gateway (VGW) propagating routes. *

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

* The ID of the route table. *

* * @param routeTableId * The ID of the route table. */ public void setRouteTableId(String routeTableId) { this.routeTableId = routeTableId; } /** *

* The ID of the route table. *

* * @return The ID of the route table. */ public String getRouteTableId() { return this.routeTableId; } /** *

* The ID of the route table. *

* * @param routeTableId * The ID of the route table. * @return Returns a reference to this object so that method calls can be * chained together. */ public RouteTable withRouteTableId(String routeTableId) { setRouteTableId(routeTableId); return this; } /** *

* The ID of the VPC. *

* * @param vpcId * The ID of the VPC. */ public void setVpcId(String vpcId) { this.vpcId = vpcId; } /** *

* The ID of the VPC. *

* * @return The ID of the VPC. */ public String getVpcId() { return this.vpcId; } /** *

* The ID of the VPC. *

* * @param vpcId * The ID of the VPC. * @return Returns a reference to this object so that method calls can be * chained together. */ public RouteTable withVpcId(String vpcId) { setVpcId(vpcId); return this; } /** *

* The routes in the route table. *

* * @return The routes in the route table. */ public java.util.List getRoutes() { if (routes == null) { routes = new com.amazonaws.internal.SdkInternalList(); } return routes; } /** *

* The routes in the route table. *

* * @param routes * The routes in the route table. */ public void setRoutes(java.util.Collection routes) { if (routes == null) { this.routes = null; return; } this.routes = new com.amazonaws.internal.SdkInternalList(routes); } /** *

* The routes in the route table. *

*

* NOTE: This method appends the values to the existing list (if * any). Use {@link #setRoutes(java.util.Collection)} or * {@link #withRoutes(java.util.Collection)} if you want to override the * existing values. *

* * @param routes * The routes in the route table. * @return Returns a reference to this object so that method calls can be * chained together. */ public RouteTable withRoutes(Route... routes) { if (this.routes == null) { setRoutes(new com.amazonaws.internal.SdkInternalList( routes.length)); } for (Route ele : routes) { this.routes.add(ele); } return this; } /** *

* The routes in the route table. *

* * @param routes * The routes in the route table. * @return Returns a reference to this object so that method calls can be * chained together. */ public RouteTable withRoutes(java.util.Collection routes) { setRoutes(routes); return this; } /** *

* The associations between the route table and one or more subnets. *

* * @return The associations between the route table and one or more subnets. */ public java.util.List getAssociations() { if (associations == null) { associations = new com.amazonaws.internal.SdkInternalList(); } return associations; } /** *

* The associations between the route table and one or more subnets. *

* * @param associations * The associations between the route table and one or more subnets. */ public void setAssociations( java.util.Collection associations) { if (associations == null) { this.associations = null; return; } this.associations = new com.amazonaws.internal.SdkInternalList( associations); } /** *

* The associations between the route table and one or more subnets. *

*

* NOTE: This method appends the values to the existing list (if * any). Use {@link #setAssociations(java.util.Collection)} or * {@link #withAssociations(java.util.Collection)} if you want to override * the existing values. *

* * @param associations * The associations between the route table and one or more subnets. * @return Returns a reference to this object so that method calls can be * chained together. */ public RouteTable withAssociations(RouteTableAssociation... associations) { if (this.associations == null) { setAssociations(new com.amazonaws.internal.SdkInternalList( associations.length)); } for (RouteTableAssociation ele : associations) { this.associations.add(ele); } return this; } /** *

* The associations between the route table and one or more subnets. *

* * @param associations * The associations between the route table and one or more subnets. * @return Returns a reference to this object so that method calls can be * chained together. */ public RouteTable withAssociations( java.util.Collection associations) { setAssociations(associations); return this; } /** *

* Any tags assigned to the route table. *

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

* Any tags assigned to the route table. *

* * @param tags * Any tags assigned to the route table. */ 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 route table. *

*

* 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 route table. * @return Returns a reference to this object so that method calls can be * chained together. */ public RouteTable 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 route table. *

* * @param tags * Any tags assigned to the route table. * @return Returns a reference to this object so that method calls can be * chained together. */ public RouteTable withTags(java.util.Collection tags) { setTags(tags); return this; } /** *

* Any virtual private gateway (VGW) propagating routes. *

* * @return Any virtual private gateway (VGW) propagating routes. */ public java.util.List getPropagatingVgws() { if (propagatingVgws == null) { propagatingVgws = new com.amazonaws.internal.SdkInternalList(); } return propagatingVgws; } /** *

* Any virtual private gateway (VGW) propagating routes. *

* * @param propagatingVgws * Any virtual private gateway (VGW) propagating routes. */ public void setPropagatingVgws( java.util.Collection propagatingVgws) { if (propagatingVgws == null) { this.propagatingVgws = null; return; } this.propagatingVgws = new com.amazonaws.internal.SdkInternalList( propagatingVgws); } /** *

* Any virtual private gateway (VGW) propagating routes. *

*

* NOTE: This method appends the values to the existing list (if * any). Use {@link #setPropagatingVgws(java.util.Collection)} or * {@link #withPropagatingVgws(java.util.Collection)} if you want to * override the existing values. *

* * @param propagatingVgws * Any virtual private gateway (VGW) propagating routes. * @return Returns a reference to this object so that method calls can be * chained together. */ public RouteTable withPropagatingVgws(PropagatingVgw... propagatingVgws) { if (this.propagatingVgws == null) { setPropagatingVgws(new com.amazonaws.internal.SdkInternalList( propagatingVgws.length)); } for (PropagatingVgw ele : propagatingVgws) { this.propagatingVgws.add(ele); } return this; } /** *

* Any virtual private gateway (VGW) propagating routes. *

* * @param propagatingVgws * Any virtual private gateway (VGW) propagating routes. * @return Returns a reference to this object so that method calls can be * chained together. */ public RouteTable withPropagatingVgws( java.util.Collection propagatingVgws) { setPropagatingVgws(propagatingVgws); return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getRouteTableId() != null) sb.append("RouteTableId: " + getRouteTableId() + ","); if (getVpcId() != null) sb.append("VpcId: " + getVpcId() + ","); if (getRoutes() != null) sb.append("Routes: " + getRoutes() + ","); if (getAssociations() != null) sb.append("Associations: " + getAssociations() + ","); if (getTags() != null) sb.append("Tags: " + getTags() + ","); if (getPropagatingVgws() != null) sb.append("PropagatingVgws: " + getPropagatingVgws()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof RouteTable == false) return false; RouteTable other = (RouteTable) obj; if (other.getRouteTableId() == null ^ this.getRouteTableId() == null) return false; if (other.getRouteTableId() != null && other.getRouteTableId().equals(this.getRouteTableId()) == false) return false; if (other.getVpcId() == null ^ this.getVpcId() == null) return false; if (other.getVpcId() != null && other.getVpcId().equals(this.getVpcId()) == false) return false; if (other.getRoutes() == null ^ this.getRoutes() == null) return false; if (other.getRoutes() != null && other.getRoutes().equals(this.getRoutes()) == false) return false; if (other.getAssociations() == null ^ this.getAssociations() == null) return false; if (other.getAssociations() != null && other.getAssociations().equals(this.getAssociations()) == false) return false; if (other.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; if (other.getPropagatingVgws() == null ^ this.getPropagatingVgws() == null) return false; if (other.getPropagatingVgws() != null && other.getPropagatingVgws().equals(this.getPropagatingVgws()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getRouteTableId() == null) ? 0 : getRouteTableId() .hashCode()); hashCode = prime * hashCode + ((getVpcId() == null) ? 0 : getVpcId().hashCode()); hashCode = prime * hashCode + ((getRoutes() == null) ? 0 : getRoutes().hashCode()); hashCode = prime * hashCode + ((getAssociations() == null) ? 0 : getAssociations() .hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); hashCode = prime * hashCode + ((getPropagatingVgws() == null) ? 0 : getPropagatingVgws() .hashCode()); return hashCode; } @Override public RouteTable clone() { try { return (RouteTable) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException( "Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy