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 static route for a VPN connection.

 
 public class VpnStaticRoute implements SerializableCloneable {

    
The CIDR block associated with the local subnet of the customer data center.
 
     private String destinationCidrBlock;

    
Indicates how the routes were provided.

Constraints:
Allowed Values: Static

 
     private String source;

    
The current state of the static route.

Constraints:
Allowed Values: pending, available, deleting, deleted

 
     private String state;

    
The CIDR block associated with the local subnet of the customer data center.

Returns:
The CIDR block associated with the local subnet of the customer data center.
 
     public String getDestinationCidrBlock() {
         return ;
     }
    
    
The CIDR block associated with the local subnet of the customer data center.

Parameters:
destinationCidrBlock The CIDR block associated with the local subnet of the customer data center.
 
     public void setDestinationCidrBlock(String destinationCidrBlock) {
         this. = destinationCidrBlock;
     }
    
    
The CIDR block associated with the local subnet of the customer data center.

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

Parameters:
destinationCidrBlock The CIDR block associated with the local subnet of the customer data center.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public VpnStaticRoute withDestinationCidrBlock(String destinationCidrBlock) {
         this. = destinationCidrBlock;
         return this;
     }

    
Indicates how the routes were provided.

Constraints:
Allowed Values: Static

Returns:
Indicates how the routes were provided.
See also:
VpnStaticRouteSource
 
     public String getSource() {
         return ;
     }
    
    
Indicates how the routes were provided.

Constraints:
Allowed Values: Static

Parameters:
source Indicates how the routes were provided.
See also:
VpnStaticRouteSource
    public void setSource(String source) {
        this. = source;
    }
    
    
Indicates how the routes were provided.

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

Constraints:
Allowed Values: Static

Parameters:
source Indicates how the routes were provided.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
VpnStaticRouteSource
    public VpnStaticRoute withSource(String source) {
        this. = source;
        return this;
    }

    
Indicates how the routes were provided.

Constraints:
Allowed Values: Static

Parameters:
source Indicates how the routes were provided.
See also:
VpnStaticRouteSource
    public void setSource(VpnStaticRouteSource source) {
        this. = source.toString();
    }
    
    
Indicates how the routes were provided.

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

Constraints:
Allowed Values: Static

Parameters:
source Indicates how the routes were provided.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
VpnStaticRouteSource
        this. = source.toString();
        return this;
    }

    
The current state of the static route.

Constraints:
Allowed Values: pending, available, deleting, deleted

Returns:
The current state of the static route.
See also:
VpnState
    public String getState() {
        return ;
    }
    
    
The current state of the static route.

Constraints:
Allowed Values: pending, available, deleting, deleted

Parameters:
state The current state of the static route.
See also:
VpnState
    public void setState(String state) {
        this. = state;
    }
    
    
The current state of the static route.

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

Constraints:
Allowed Values: pending, available, deleting, deleted

Parameters:
state The current state of the static route.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
VpnState
    public VpnStaticRoute withState(String state) {
        this. = state;
        return this;
    }

    
The current state of the static route.

Constraints:
Allowed Values: pending, available, deleting, deleted

Parameters:
state The current state of the static route.
See also:
VpnState
    public void setState(VpnState state) {
        this. = state.toString();
    }
    
    
The current state of the static route.

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

Constraints:
Allowed Values: pending, available, deleting, deleted

Parameters:
state The current state of the static route.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
VpnState
    public VpnStaticRoute withState(VpnState state) {
        this. = state.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 (getSource() != nullsb.append("Source: " + getSource() + ",");
        if (getState() != nullsb.append("State: " + getState() );
        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 + ((getSource() == null) ? 0 : getSource().hashCode()); 
        hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof VpnStaticRoute == falsereturn false;
        VpnStaticRoute other = (VpnStaticRoute)obj;
        
        if (other.getDestinationCidrBlock() == null ^ this.getDestinationCidrBlock() == nullreturn false;
        if (other.getDestinationCidrBlock() != null && other.getDestinationCidrBlock().equals(this.getDestinationCidrBlock()) == falsereturn false
        if (other.getSource() == null ^ this.getSource() == nullreturn false;
        if (other.getSource() != null && other.getSource().equals(this.getSource()) == falsereturn false
        if (other.getState() == null ^ this.getState() == nullreturn false;
        if (other.getState() != null && other.getState().equals(this.getState()) == falsereturn false
        return true;
    }
    
    @Override
    public VpnStaticRoute clone() {
        try {
            return (VpnStaticRoutesuper.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