Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 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;
 

Describes a route in a route table.

 
 public class Route implements SerializableCloneable {

    
The CIDR block used for the destination match.
 
     private String destinationCidrBlock;

    
The prefix of the AWS service.
 
     private String destinationPrefixListId;

    
The ID of a gateway attached to your VPC.
 
     private String gatewayId;

    
The ID of a NAT instance in your VPC.
 
     private String instanceId;

    
The AWS account ID of the owner of the instance.
 
     private String instanceOwnerId;

    
The ID of the network interface.
 
     private String networkInterfaceId;

    
The ID of the VPC peering connection.
 
     private String vpcPeeringConnectionId;

    
The state of the route. The blackhole state indicates that the route's target isn't available (for example, the specified gateway isn't attached to the VPC, or the specified NAT instance has been terminated).

Constraints:
Allowed Values: active, blackhole

 
     private String state;

    
Describes how the route was created.
  • CreateRouteTable indicates that route was automatically created when the route table was created.
  • CreateRoute indicates that the route was manually added to the route table.
  • EnableVgwRoutePropagation indicates that the route was propagated by route propagation.

Constraints:
Allowed Values: CreateRouteTable, CreateRoute, EnableVgwRoutePropagation

 
     private String origin;

    
The CIDR block used for the destination match.

Returns:
The CIDR block used for the destination match.
 
     public String getDestinationCidrBlock() {
         return ;
     }
    
    
The CIDR block used for the destination match.

Parameters:
destinationCidrBlock The CIDR block used for the destination match.
 
    public void setDestinationCidrBlock(String destinationCidrBlock) {
        this. = destinationCidrBlock;
    }
    
    
The CIDR block used for the destination match.

Returns a reference to this object so that method calls can be chained together.

Parameters:
destinationCidrBlock The CIDR block used for the destination match.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Route withDestinationCidrBlock(String destinationCidrBlock) {
        this. = destinationCidrBlock;
        return this;
    }

    
The prefix of the AWS service.

Returns:
The prefix of the AWS service.
        return ;
    }
    
    
The prefix of the AWS service.

Parameters:
destinationPrefixListId The prefix of the AWS service.
    public void setDestinationPrefixListId(String destinationPrefixListId) {
        this. = destinationPrefixListId;
    }
    
    
The prefix of the AWS service.

Returns a reference to this object so that method calls can be chained together.

Parameters:
destinationPrefixListId The prefix of the AWS service.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Route withDestinationPrefixListId(String destinationPrefixListId) {
        this. = destinationPrefixListId;
        return this;
    }

    
The ID of a gateway attached to your VPC.

Returns:
The ID of a gateway attached to your VPC.
    public String getGatewayId() {
        return ;
    }
    
    
The ID of a gateway attached to your VPC.

Parameters:
gatewayId The ID of a gateway attached to your VPC.
    public void setGatewayId(String gatewayId) {
        this. = gatewayId;
    }
    
    
The ID of a gateway attached to your VPC.

Returns a reference to this object so that method calls can be chained together.

Parameters:
gatewayId The ID of a gateway attached to your VPC.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Route withGatewayId(String gatewayId) {
        this. = gatewayId;
        return this;
    }

    
The ID of a NAT instance in your VPC.

Returns:
The ID of a NAT instance in your VPC.
    public String getInstanceId() {
        return ;
    }
    
    
The ID of a NAT instance in your VPC.

Parameters:
instanceId The ID of a NAT instance in your VPC.
    public void setInstanceId(String instanceId) {
        this. = instanceId;
    }
    
    
The ID of a NAT instance in your VPC.

Returns a reference to this object so that method calls can be chained together.

Parameters:
instanceId The ID of a NAT instance in your VPC.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Route withInstanceId(String instanceId) {
        this. = instanceId;
        return this;
    }

    
The AWS account ID of the owner of the instance.

Returns:
The AWS account ID of the owner of the instance.
    public String getInstanceOwnerId() {
        return ;
    }
    
    
The AWS account ID of the owner of the instance.

Parameters:
instanceOwnerId The AWS account ID of the owner of the instance.
    public void setInstanceOwnerId(String instanceOwnerId) {
        this. = instanceOwnerId;
    }
    
    
The AWS account ID of the owner of the instance.

Returns a reference to this object so that method calls can be chained together.

Parameters:
instanceOwnerId The AWS account ID of the owner of the instance.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Route withInstanceOwnerId(String instanceOwnerId) {
        this. = instanceOwnerId;
        return this;
    }

    
The ID of the network interface.

Returns:
The ID of the network interface.
    public String getNetworkInterfaceId() {
        return ;
    }
    
    
The ID of the network interface.

Parameters:
networkInterfaceId The ID of the network interface.
    public void setNetworkInterfaceId(String networkInterfaceId) {
        this. = networkInterfaceId;
    }
    
    
The ID of the network interface.

Returns a reference to this object so that method calls can be chained together.

Parameters:
networkInterfaceId The ID of the network interface.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Route withNetworkInterfaceId(String networkInterfaceId) {
        this. = networkInterfaceId;
        return this;
    }

    
The ID of the VPC peering connection.

Returns:
The ID of the VPC peering connection.
    public String getVpcPeeringConnectionId() {
        return ;
    }
    
    
The ID of the VPC peering connection.

Parameters:
vpcPeeringConnectionId The ID of the VPC peering connection.
    public void setVpcPeeringConnectionId(String vpcPeeringConnectionId) {
        this. = vpcPeeringConnectionId;
    }
    
    
The ID of the VPC peering connection.

Returns a reference to this object so that method calls can be chained together.

Parameters:
vpcPeeringConnectionId The ID of the VPC peering connection.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Route withVpcPeeringConnectionId(String vpcPeeringConnectionId) {
        this. = vpcPeeringConnectionId;
        return this;
    }

    
The state of the route. The blackhole state indicates that the route's target isn't available (for example, the specified gateway isn't attached to the VPC, or the specified NAT instance has been terminated).

Constraints:
Allowed Values: active, blackhole

Returns:
The state of the route. The blackhole state indicates that the route's target isn't available (for example, the specified gateway isn't attached to the VPC, or the specified NAT instance has been terminated).
See also:
RouteState
    public String getState() {
        return ;
    }
    
    
The state of the route. The blackhole state indicates that the route's target isn't available (for example, the specified gateway isn't attached to the VPC, or the specified NAT instance has been terminated).

Constraints:
Allowed Values: active, blackhole

Parameters:
state The state of the route. The blackhole state indicates that the route's target isn't available (for example, the specified gateway isn't attached to the VPC, or the specified NAT instance has been terminated).
See also:
RouteState
    public void setState(String state) {
        this. = state;
    }
    
    
The state of the route. The blackhole state indicates that the route's target isn't available (for example, the specified gateway isn't attached to the VPC, or the specified NAT instance has been terminated).

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: active, blackhole

Parameters:
state The state of the route. The blackhole state indicates that the route's target isn't available (for example, the specified gateway isn't attached to the VPC, or the specified NAT instance has been terminated).
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
RouteState
    public Route withState(String state) {
        this. = state;
        return this;
    }

    
The state of the route. The blackhole state indicates that the route's target isn't available (for example, the specified gateway isn't attached to the VPC, or the specified NAT instance has been terminated).

Constraints:
Allowed Values: active, blackhole

Parameters:
state The state of the route. The blackhole state indicates that the route's target isn't available (for example, the specified gateway isn't attached to the VPC, or the specified NAT instance has been terminated).
See also:
RouteState
    public void setState(RouteState state) {
        this. = state.toString();
    }
    
    
The state of the route. The blackhole state indicates that the route's target isn't available (for example, the specified gateway isn't attached to the VPC, or the specified NAT instance has been terminated).

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: active, blackhole

Parameters:
state The state of the route. The blackhole state indicates that the route's target isn't available (for example, the specified gateway isn't attached to the VPC, or the specified NAT instance has been terminated).
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
RouteState
    public Route withState(RouteState state) {
        this. = state.toString();
        return this;
    }

    
Describes how the route was created.
  • CreateRouteTable indicates that route was automatically created when the route table was created.
  • CreateRoute indicates that the route was manually added to the route table.
  • EnableVgwRoutePropagation indicates that the route was propagated by route propagation.

Constraints:
Allowed Values: CreateRouteTable, CreateRoute, EnableVgwRoutePropagation

Returns:
Describes how the route was created.
  • CreateRouteTable indicates that route was automatically created when the route table was created.
  • CreateRoute indicates that the route was manually added to the route table.
  • EnableVgwRoutePropagation indicates that the route was propagated by route propagation.
See also:
RouteOrigin
    public String getOrigin() {
        return ;
    }
    
    
Describes how the route was created.
  • CreateRouteTable indicates that route was automatically created when the route table was created.
  • CreateRoute indicates that the route was manually added to the route table.
  • EnableVgwRoutePropagation indicates that the route was propagated by route propagation.

Constraints:
Allowed Values: CreateRouteTable, CreateRoute, EnableVgwRoutePropagation

Parameters:
origin Describes how the route was created.
  • CreateRouteTable indicates that route was automatically created when the route table was created.
  • CreateRoute indicates that the route was manually added to the route table.
  • EnableVgwRoutePropagation indicates that the route was propagated by route propagation.
See also:
RouteOrigin
    public void setOrigin(String origin) {
        this. = origin;
    }
    
    
Describes how the route was created.
  • CreateRouteTable indicates that route was automatically created when the route table was created.
  • CreateRoute indicates that the route was manually added to the route table.
  • EnableVgwRoutePropagation indicates that the route was propagated by route propagation.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: CreateRouteTable, CreateRoute, EnableVgwRoutePropagation

Parameters:
origin Describes how the route was created.
  • CreateRouteTable indicates that route was automatically created when the route table was created.
  • CreateRoute indicates that the route was manually added to the route table.
  • EnableVgwRoutePropagation indicates that the route was propagated by route propagation.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
RouteOrigin
    public Route withOrigin(String origin) {
        this. = origin;
        return this;
    }

    
Describes how the route was created.
  • CreateRouteTable indicates that route was automatically created when the route table was created.
  • CreateRoute indicates that the route was manually added to the route table.
  • EnableVgwRoutePropagation indicates that the route was propagated by route propagation.

Constraints:
Allowed Values: CreateRouteTable, CreateRoute, EnableVgwRoutePropagation

Parameters:
origin Describes how the route was created.
  • CreateRouteTable indicates that route was automatically created when the route table was created.
  • CreateRoute indicates that the route was manually added to the route table.
  • EnableVgwRoutePropagation indicates that the route was propagated by route propagation.
See also:
RouteOrigin
    public void setOrigin(RouteOrigin origin) {
        this. = origin.toString();
    }
    
    
Describes how the route was created.
  • CreateRouteTable indicates that route was automatically created when the route table was created.
  • CreateRoute indicates that the route was manually added to the route table.
  • EnableVgwRoutePropagation indicates that the route was propagated by route propagation.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: CreateRouteTable, CreateRoute, EnableVgwRoutePropagation

Parameters:
origin Describes how the route was created.
  • CreateRouteTable indicates that route was automatically created when the route table was created.
  • CreateRoute indicates that the route was manually added to the route table.
  • EnableVgwRoutePropagation indicates that the route was propagated by route propagation.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
RouteOrigin
    public Route withOrigin(RouteOrigin origin) {
        this. = origin.toString();
        return this;
    }

    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getDestinationCidrBlock() != nullsb.append("DestinationCidrBlock: " + getDestinationCidrBlock() + ",");
        if (getDestinationPrefixListId() != nullsb.append("DestinationPrefixListId: " + getDestinationPrefixListId() + ",");
        if (getGatewayId() != nullsb.append("GatewayId: " + getGatewayId() + ",");
        if (getInstanceId() != nullsb.append("InstanceId: " + getInstanceId() + ",");
        if (getInstanceOwnerId() != nullsb.append("InstanceOwnerId: " + getInstanceOwnerId() + ",");
        if (getNetworkInterfaceId() != nullsb.append("NetworkInterfaceId: " + getNetworkInterfaceId() + ",");
        if (getVpcPeeringConnectionId() != nullsb.append("VpcPeeringConnectionId: " + getVpcPeeringConnectionId() + ",");
        if (getState() != nullsb.append("State: " + getState() + ",");
        if (getOrigin() != nullsb.append("Origin: " + getOrigin() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getDestinationCidrBlock() == null) ? 0 : getDestinationCidrBlock().hashCode()); 
        hashCode = prime * hashCode + ((getDestinationPrefixListId() == null) ? 0 : getDestinationPrefixListId().hashCode()); 
        hashCode = prime * hashCode + ((getGatewayId() == null) ? 0 : getGatewayId().hashCode()); 
        hashCode = prime * hashCode + ((getInstanceId() == null) ? 0 : getInstanceId().hashCode()); 
        hashCode = prime * hashCode + ((getInstanceOwnerId() == null) ? 0 : getInstanceOwnerId().hashCode()); 
        hashCode = prime * hashCode + ((getNetworkInterfaceId() == null) ? 0 : getNetworkInterfaceId().hashCode()); 
        hashCode = prime * hashCode + ((getVpcPeeringConnectionId() == null) ? 0 : getVpcPeeringConnectionId().hashCode()); 
        hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode()); 
        hashCode = prime * hashCode + ((getOrigin() == null) ? 0 : getOrigin().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof Route == falsereturn false;
        Route other = (Route)obj;
        
        if (other.getDestinationCidrBlock() == null ^ this.getDestinationCidrBlock() == nullreturn false;
        if (other.getDestinationCidrBlock() != null && other.getDestinationCidrBlock().equals(this.getDestinationCidrBlock()) == falsereturn false
        if (other.getDestinationPrefixListId() == null ^ this.getDestinationPrefixListId() == nullreturn false;
        if (other.getDestinationPrefixListId() != null && other.getDestinationPrefixListId().equals(this.getDestinationPrefixListId()) == falsereturn false
        if (other.getGatewayId() == null ^ this.getGatewayId() == nullreturn false;
        if (other.getGatewayId() != null && other.getGatewayId().equals(this.getGatewayId()) == falsereturn false
        if (other.getInstanceId() == null ^ this.getInstanceId() == nullreturn false;
        if (other.getInstanceId() != null && other.getInstanceId().equals(this.getInstanceId()) == falsereturn false
        if (other.getInstanceOwnerId() == null ^ this.getInstanceOwnerId() == nullreturn false;
        if (other.getInstanceOwnerId() != null && other.getInstanceOwnerId().equals(this.getInstanceOwnerId()) == falsereturn false
        if (other.getNetworkInterfaceId() == null ^ this.getNetworkInterfaceId() == nullreturn false;
        if (other.getNetworkInterfaceId() != null && other.getNetworkInterfaceId().equals(this.getNetworkInterfaceId()) == falsereturn false
        if (other.getVpcPeeringConnectionId() == null ^ this.getVpcPeeringConnectionId() == nullreturn false;
        if (other.getVpcPeeringConnectionId() != null && other.getVpcPeeringConnectionId().equals(this.getVpcPeeringConnectionId()) == falsereturn false
        if (other.getState() == null ^ this.getState() == nullreturn false;
        if (other.getState() != null && other.getState().equals(this.getState()) == falsereturn false
        if (other.getOrigin() == null ^ this.getOrigin() == nullreturn false;
        if (other.getOrigin() != null && other.getOrigin().equals(this.getOrigin()) == falsereturn false
        return true;
    }
    
    @Override
    public Route clone() {
        try {
            return (Routesuper.clone();
        
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException(
                    "Got a CloneNotSupportedException from Object.clone() "
                    + "even though we're Cloneable!",
                    e);
        }
        
    }
}
    
New to GrepCode? Check out our FAQ X