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 customer gateway.

 
 public class CustomerGateway implements SerializableCloneable {

    
The ID of the customer gateway.
 
     private String customerGatewayId;

    
The current state of the customer gateway (pending | available | deleting | deleted).
 
     private String state;

    
The type of VPN connection the customer gateway supports (ipsec.1).
 
     private String type;

    
The Internet-routable IP address of the customer gateway's outside interface.
 
     private String ipAddress;

    
The customer gateway's Border Gateway Protocol (BGP) Autonomous System Number (ASN).
 
     private String bgpAsn;

    
Any tags assigned to the customer gateway.
 
The ID of the customer gateway.

Returns:
The ID of the customer gateway.
 
     public String getCustomerGatewayId() {
         return ;
     }
    
    
The ID of the customer gateway.

Parameters:
customerGatewayId The ID of the customer gateway.
 
     public void setCustomerGatewayId(String customerGatewayId) {
         this. = customerGatewayId;
     }
    
    
The ID of the customer gateway.

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

Parameters:
customerGatewayId The ID of the customer gateway.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public CustomerGateway withCustomerGatewayId(String customerGatewayId) {
         this. = customerGatewayId;
         return this;
     }

    
The current state of the customer gateway (pending | available | deleting | deleted).

Returns:
The current state of the customer gateway (pending | available | deleting | deleted).
 
    public String getState() {
        return ;
    }
    
    
The current state of the customer gateway (pending | available | deleting | deleted).

Parameters:
state The current state of the customer gateway (pending | available | deleting | deleted).
    public void setState(String state) {
        this. = state;
    }
    
    
The current state of the customer gateway (pending | available | deleting | deleted).

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

Parameters:
state The current state of the customer gateway (pending | available | deleting | deleted).
Returns:
A reference to this updated object so that method calls can be chained together.
    public CustomerGateway withState(String state) {
        this. = state;
        return this;
    }

    
The type of VPN connection the customer gateway supports (ipsec.1).

Returns:
The type of VPN connection the customer gateway supports (ipsec.1).
    public String getType() {
        return ;
    }
    
    
The type of VPN connection the customer gateway supports (ipsec.1).

Parameters:
type The type of VPN connection the customer gateway supports (ipsec.1).
    public void setType(String type) {
        this. = type;
    }
    
    
The type of VPN connection the customer gateway supports (ipsec.1).

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

Parameters:
type The type of VPN connection the customer gateway supports (ipsec.1).
Returns:
A reference to this updated object so that method calls can be chained together.
    public CustomerGateway withType(String type) {
        this. = type;
        return this;
    }

    
The Internet-routable IP address of the customer gateway's outside interface.

Returns:
The Internet-routable IP address of the customer gateway's outside interface.
    public String getIpAddress() {
        return ;
    }
    
    
The Internet-routable IP address of the customer gateway's outside interface.

Parameters:
ipAddress The Internet-routable IP address of the customer gateway's outside interface.
    public void setIpAddress(String ipAddress) {
        this. = ipAddress;
    }
    
    
The Internet-routable IP address of the customer gateway's outside interface.

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

Parameters:
ipAddress The Internet-routable IP address of the customer gateway's outside interface.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CustomerGateway withIpAddress(String ipAddress) {
        this. = ipAddress;
        return this;
    }

    
The customer gateway's Border Gateway Protocol (BGP) Autonomous System Number (ASN).

Returns:
The customer gateway's Border Gateway Protocol (BGP) Autonomous System Number (ASN).
    public String getBgpAsn() {
        return ;
    }
    
    
The customer gateway's Border Gateway Protocol (BGP) Autonomous System Number (ASN).

Parameters:
bgpAsn The customer gateway's Border Gateway Protocol (BGP) Autonomous System Number (ASN).
    public void setBgpAsn(String bgpAsn) {
        this. = bgpAsn;
    }
    
    
The customer gateway's Border Gateway Protocol (BGP) Autonomous System Number (ASN).

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

Parameters:
bgpAsn The customer gateway's Border Gateway Protocol (BGP) Autonomous System Number (ASN).
Returns:
A reference to this updated object so that method calls can be chained together.
    public CustomerGateway withBgpAsn(String bgpAsn) {
        this. = bgpAsn;
        return this;
    }

    
Any tags assigned to the customer gateway.

Returns:
Any tags assigned to the customer gateway.
    public java.util.List<TaggetTags() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<Tag>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
Any tags assigned to the customer gateway.

Parameters:
tags Any tags assigned to the customer gateway.
    public void setTags(java.util.Collection<Tagtags) {
        if (tags == null) {
            this. = null;
            return;
        }
        tagsCopy.addAll(tags);
        this. = tagsCopy;
    }
    
    
Any tags assigned to the customer gateway.

NOTE: This method appends the values to the existing list (if any). Use setTags(java.util.Collection) or withTags(java.util.Collection) if you want to override the existing values.

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

Parameters:
tags Any tags assigned to the customer gateway.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CustomerGateway withTags(Tag... tags) {
        if (getTags() == nullsetTags(new java.util.ArrayList<Tag>(tags.length));
        for (Tag value : tags) {
            getTags().add(value);
        }
        return this;
    }
    
    
Any tags assigned to the customer gateway.

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

Parameters:
tags Any tags assigned to the customer gateway.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CustomerGateway withTags(java.util.Collection<Tagtags) {
        if (tags == null) {
            this. = null;
        } else {
            tagsCopy.addAll(tags);
            this. = tagsCopy;
        }
        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 (getCustomerGatewayId() != nullsb.append("CustomerGatewayId: " + getCustomerGatewayId() + ",");
        if (getState() != nullsb.append("State: " + getState() + ",");
        if (getType() != nullsb.append("Type: " + getType() + ",");
        if (getIpAddress() != nullsb.append("IpAddress: " + getIpAddress() + ",");
        if (getBgpAsn() != nullsb.append("BgpAsn: " + getBgpAsn() + ",");
        if (getTags() != nullsb.append("Tags: " + getTags() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getCustomerGatewayId() == null) ? 0 : getCustomerGatewayId().hashCode()); 
        hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode()); 
        hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode()); 
        hashCode = prime * hashCode + ((getIpAddress() == null) ? 0 : getIpAddress().hashCode()); 
        hashCode = prime * hashCode + ((getBgpAsn() == null) ? 0 : getBgpAsn().hashCode()); 
        hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof CustomerGateway == falsereturn false;
        CustomerGateway other = (CustomerGateway)obj;
        
        if (other.getCustomerGatewayId() == null ^ this.getCustomerGatewayId() == nullreturn false;
        if (other.getCustomerGatewayId() != null && other.getCustomerGatewayId().equals(this.getCustomerGatewayId()) == falsereturn false
        if (other.getState() == null ^ this.getState() == nullreturn false;
        if (other.getState() != null && other.getState().equals(this.getState()) == falsereturn false
        if (other.getType() == null ^ this.getType() == nullreturn false;
        if (other.getType() != null && other.getType().equals(this.getType()) == falsereturn false
        if (other.getIpAddress() == null ^ this.getIpAddress() == nullreturn false;
        if (other.getIpAddress() != null && other.getIpAddress().equals(this.getIpAddress()) == falsereturn false
        if (other.getBgpAsn() == null ^ this.getBgpAsn() == nullreturn false;
        if (other.getBgpAsn() != null && other.getBgpAsn().equals(this.getBgpAsn()) == falsereturn false
        if (other.getTags() == null ^ this.getTags() == nullreturn false;
        if (other.getTags() != null && other.getTags().equals(this.getTags()) == falsereturn false
        return true;
    }
    
    @Override
    public CustomerGateway clone() {
        try {
            return (CustomerGatewaysuper.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