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 VPC endpoint.

 
 public class VpcEndpoint implements SerializableCloneable {

    
The ID of the VPC endpoint.
 
     private String vpcEndpointId;

    
The ID of the VPC to which the endpoint is associated.
 
     private String vpcId;

    
The name of the AWS service to which the endpoint is associated.
 
     private String serviceName;

    
The state of the VPC endpoint.

Constraints:
Allowed Values: Pending, Available, Deleting, Deleted

 
     private String state;

    
The policy document associated with the endpoint.
 
     private String policyDocument;

    
One or more route tables associated with the endpoint.
 
The date and time the VPC endpoint was created.
 
     private java.util.Date creationTimestamp;

    
The ID of the VPC endpoint.

Returns:
The ID of the VPC endpoint.
 
     public String getVpcEndpointId() {
         return ;
     }
    
    
The ID of the VPC endpoint.

Parameters:
vpcEndpointId The ID of the VPC endpoint.
 
     public void setVpcEndpointId(String vpcEndpointId) {
         this. = vpcEndpointId;
     }
    
    
The ID of the VPC endpoint.

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

Parameters:
vpcEndpointId The ID of the VPC endpoint.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public VpcEndpoint withVpcEndpointId(String vpcEndpointId) {
         this. = vpcEndpointId;
         return this;
     }

    
The ID of the VPC to which the endpoint is associated.

Returns:
The ID of the VPC to which the endpoint is associated.
    public String getVpcId() {
        return ;
    }
    
    
The ID of the VPC to which the endpoint is associated.

Parameters:
vpcId The ID of the VPC to which the endpoint is associated.
    public void setVpcId(String vpcId) {
        this. = vpcId;
    }
    
    
The ID of the VPC to which the endpoint is associated.

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

Parameters:
vpcId The ID of the VPC to which the endpoint is associated.
Returns:
A reference to this updated object so that method calls can be chained together.
    public VpcEndpoint withVpcId(String vpcId) {
        this. = vpcId;
        return this;
    }

    
The name of the AWS service to which the endpoint is associated.

Returns:
The name of the AWS service to which the endpoint is associated.
    public String getServiceName() {
        return ;
    }
    
    
The name of the AWS service to which the endpoint is associated.

Parameters:
serviceName The name of the AWS service to which the endpoint is associated.
    public void setServiceName(String serviceName) {
        this. = serviceName;
    }
    
    
The name of the AWS service to which the endpoint is associated.

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

Parameters:
serviceName The name of the AWS service to which the endpoint is associated.
Returns:
A reference to this updated object so that method calls can be chained together.
    public VpcEndpoint withServiceName(String serviceName) {
        this. = serviceName;
        return this;
    }

    
The state of the VPC endpoint.

Constraints:
Allowed Values: Pending, Available, Deleting, Deleted

Returns:
The state of the VPC endpoint.
See also:
State
    public String getState() {
        return ;
    }
    
    
The state of the VPC endpoint.

Constraints:
Allowed Values: Pending, Available, Deleting, Deleted

Parameters:
state The state of the VPC endpoint.
See also:
State
    public void setState(String state) {
        this. = state;
    }
    
    
The state of the VPC endpoint.

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

Constraints:
Allowed Values: Pending, Available, Deleting, Deleted

Parameters:
state The state of the VPC endpoint.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
State
    public VpcEndpoint withState(String state) {
        this. = state;
        return this;
    }

    
The state of the VPC endpoint.

Constraints:
Allowed Values: Pending, Available, Deleting, Deleted

Parameters:
state The state of the VPC endpoint.
See also:
State
    public void setState(State state) {
        this. = state.toString();
    }
    
    
The state of the VPC endpoint.

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

Constraints:
Allowed Values: Pending, Available, Deleting, Deleted

Parameters:
state The state of the VPC endpoint.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
State
    public VpcEndpoint withState(State state) {
        this. = state.toString();
        return this;
    }

    
The policy document associated with the endpoint.

Returns:
The policy document associated with the endpoint.
    public String getPolicyDocument() {
        return ;
    }
    
    
The policy document associated with the endpoint.

Parameters:
policyDocument The policy document associated with the endpoint.
    public void setPolicyDocument(String policyDocument) {
        this. = policyDocument;
    }
    
    
The policy document associated with the endpoint.

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

Parameters:
policyDocument The policy document associated with the endpoint.
Returns:
A reference to this updated object so that method calls can be chained together.
    public VpcEndpoint withPolicyDocument(String policyDocument) {
        this. = policyDocument;
        return this;
    }

    
One or more route tables associated with the endpoint.

Returns:
One or more route tables associated with the endpoint.
    public java.util.List<StringgetRouteTableIds() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
One or more route tables associated with the endpoint.

Parameters:
routeTableIds One or more route tables associated with the endpoint.
    public void setRouteTableIds(java.util.Collection<StringrouteTableIds) {
        if (routeTableIds == null) {
            this. = null;
            return;
        }
        com.amazonaws.internal.ListWithAutoConstructFlag<StringrouteTableIdsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(routeTableIds.size());
        routeTableIdsCopy.addAll(routeTableIds);
        this. = routeTableIdsCopy;
    }
    
    
One or more route tables associated with the endpoint.

NOTE: This method appends the values to the existing list (if any). Use setRouteTableIds(java.util.Collection) or withRouteTableIds(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:
routeTableIds One or more route tables associated with the endpoint.
Returns:
A reference to this updated object so that method calls can be chained together.
    public VpcEndpoint withRouteTableIds(String... routeTableIds) {
        if (getRouteTableIds() == nullsetRouteTableIds(new java.util.ArrayList<String>(routeTableIds.length));
        for (String value : routeTableIds) {
            getRouteTableIds().add(value);
        }
        return this;
    }
    
    
One or more route tables associated with the endpoint.

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

Parameters:
routeTableIds One or more route tables associated with the endpoint.
Returns:
A reference to this updated object so that method calls can be chained together.
    public VpcEndpoint withRouteTableIds(java.util.Collection<StringrouteTableIds) {
        if (routeTableIds == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<StringrouteTableIdsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(routeTableIds.size());
            routeTableIdsCopy.addAll(routeTableIds);
            this. = routeTableIdsCopy;
        }
        return this;
    }

    
The date and time the VPC endpoint was created.

Returns:
The date and time the VPC endpoint was created.
    public java.util.Date getCreationTimestamp() {
        return ;
    }
    
    
The date and time the VPC endpoint was created.

Parameters:
creationTimestamp The date and time the VPC endpoint was created.
    public void setCreationTimestamp(java.util.Date creationTimestamp) {
        this. = creationTimestamp;
    }
    
    
The date and time the VPC endpoint was created.

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

Parameters:
creationTimestamp The date and time the VPC endpoint was created.
Returns:
A reference to this updated object so that method calls can be chained together.
    public VpcEndpoint withCreationTimestamp(java.util.Date creationTimestamp) {
        this. = creationTimestamp;
        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 (getVpcEndpointId() != nullsb.append("VpcEndpointId: " + getVpcEndpointId() + ",");
        if (getVpcId() != nullsb.append("VpcId: " + getVpcId() + ",");
        if (getServiceName() != nullsb.append("ServiceName: " + getServiceName() + ",");
        if (getState() != nullsb.append("State: " + getState() + ",");
        if (getPolicyDocument() != nullsb.append("PolicyDocument: " + getPolicyDocument() + ",");
        if (getRouteTableIds() != nullsb.append("RouteTableIds: " + getRouteTableIds() + ",");
        if (getCreationTimestamp() != nullsb.append("CreationTimestamp: " + getCreationTimestamp() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getVpcEndpointId() == null) ? 0 : getVpcEndpointId().hashCode()); 
        hashCode = prime * hashCode + ((getVpcId() == null) ? 0 : getVpcId().hashCode()); 
        hashCode = prime * hashCode + ((getServiceName() == null) ? 0 : getServiceName().hashCode()); 
        hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode()); 
        hashCode = prime * hashCode + ((getPolicyDocument() == null) ? 0 : getPolicyDocument().hashCode()); 
        hashCode = prime * hashCode + ((getRouteTableIds() == null) ? 0 : getRouteTableIds().hashCode()); 
        hashCode = prime * hashCode + ((getCreationTimestamp() == null) ? 0 : getCreationTimestamp().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof VpcEndpoint == falsereturn false;
        VpcEndpoint other = (VpcEndpoint)obj;
        
        if (other.getVpcEndpointId() == null ^ this.getVpcEndpointId() == nullreturn false;
        if (other.getVpcEndpointId() != null && other.getVpcEndpointId().equals(this.getVpcEndpointId()) == falsereturn false
        if (other.getVpcId() == null ^ this.getVpcId() == nullreturn false;
        if (other.getVpcId() != null && other.getVpcId().equals(this.getVpcId()) == falsereturn false
        if (other.getServiceName() == null ^ this.getServiceName() == nullreturn false;
        if (other.getServiceName() != null && other.getServiceName().equals(this.getServiceName()) == falsereturn false
        if (other.getState() == null ^ this.getState() == nullreturn false;
        if (other.getState() != null && other.getState().equals(this.getState()) == falsereturn false
        if (other.getPolicyDocument() == null ^ this.getPolicyDocument() == nullreturn false;
        if (other.getPolicyDocument() != null && other.getPolicyDocument().equals(this.getPolicyDocument()) == falsereturn false
        if (other.getRouteTableIds() == null ^ this.getRouteTableIds() == nullreturn false;
        if (other.getRouteTableIds() != null && other.getRouteTableIds().equals(this.getRouteTableIds()) == falsereturn false
        if (other.getCreationTimestamp() == null ^ this.getCreationTimestamp() == nullreturn false;
        if (other.getCreationTimestamp() != null && other.getCreationTimestamp().equals(this.getCreationTimestamp()) == falsereturn false
        return true;
    }
    
    @Override
    public VpcEndpoint clone() {
        try {
            return (VpcEndpointsuper.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