com.amazonaws.services.ec2.model.VpcEndpointConnection Maven / Gradle / Ivy
Show all versions of aws-java-sdk-ec2 Show documentation
/*
* Copyright 2016-2021 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;
import javax.annotation.Generated;
/**
*
* Describes a VPC endpoint connection to a service.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class VpcEndpointConnection implements Serializable, Cloneable {
/**
*
* The ID of the service to which the endpoint is connected.
*
*/
private String serviceId;
/**
*
* The ID of the VPC endpoint.
*
*/
private String vpcEndpointId;
/**
*
* The ID of the Amazon Web Services account that owns the VPC endpoint.
*
*/
private String vpcEndpointOwner;
/**
*
* The state of the VPC endpoint.
*
*/
private String vpcEndpointState;
/**
*
* The date and time that the VPC endpoint was created.
*
*/
private java.util.Date creationTimestamp;
/**
*
* The DNS entries for the VPC endpoint.
*
*/
private com.amazonaws.internal.SdkInternalList dnsEntries;
/**
*
* The Amazon Resource Names (ARNs) of the network load balancers for the service.
*
*/
private com.amazonaws.internal.SdkInternalList networkLoadBalancerArns;
/**
*
* The Amazon Resource Names (ARNs) of the Gateway Load Balancers for the service.
*
*/
private com.amazonaws.internal.SdkInternalList gatewayLoadBalancerArns;
/**
*
* The ID of the service to which the endpoint is connected.
*
*
* @param serviceId
* The ID of the service to which the endpoint is connected.
*/
public void setServiceId(String serviceId) {
this.serviceId = serviceId;
}
/**
*
* The ID of the service to which the endpoint is connected.
*
*
* @return The ID of the service to which the endpoint is connected.
*/
public String getServiceId() {
return this.serviceId;
}
/**
*
* The ID of the service to which the endpoint is connected.
*
*
* @param serviceId
* The ID of the service to which the endpoint is connected.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VpcEndpointConnection withServiceId(String serviceId) {
setServiceId(serviceId);
return this;
}
/**
*
* The ID of the VPC endpoint.
*
*
* @param vpcEndpointId
* The ID of the VPC endpoint.
*/
public void setVpcEndpointId(String vpcEndpointId) {
this.vpcEndpointId = vpcEndpointId;
}
/**
*
* The ID of the VPC endpoint.
*
*
* @return The ID of the VPC endpoint.
*/
public String getVpcEndpointId() {
return this.vpcEndpointId;
}
/**
*
* The ID of the VPC endpoint.
*
*
* @param vpcEndpointId
* The ID of the VPC endpoint.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VpcEndpointConnection withVpcEndpointId(String vpcEndpointId) {
setVpcEndpointId(vpcEndpointId);
return this;
}
/**
*
* The ID of the Amazon Web Services account that owns the VPC endpoint.
*
*
* @param vpcEndpointOwner
* The ID of the Amazon Web Services account that owns the VPC endpoint.
*/
public void setVpcEndpointOwner(String vpcEndpointOwner) {
this.vpcEndpointOwner = vpcEndpointOwner;
}
/**
*
* The ID of the Amazon Web Services account that owns the VPC endpoint.
*
*
* @return The ID of the Amazon Web Services account that owns the VPC endpoint.
*/
public String getVpcEndpointOwner() {
return this.vpcEndpointOwner;
}
/**
*
* The ID of the Amazon Web Services account that owns the VPC endpoint.
*
*
* @param vpcEndpointOwner
* The ID of the Amazon Web Services account that owns the VPC endpoint.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VpcEndpointConnection withVpcEndpointOwner(String vpcEndpointOwner) {
setVpcEndpointOwner(vpcEndpointOwner);
return this;
}
/**
*
* The state of the VPC endpoint.
*
*
* @param vpcEndpointState
* The state of the VPC endpoint.
* @see State
*/
public void setVpcEndpointState(String vpcEndpointState) {
this.vpcEndpointState = vpcEndpointState;
}
/**
*
* The state of the VPC endpoint.
*
*
* @return The state of the VPC endpoint.
* @see State
*/
public String getVpcEndpointState() {
return this.vpcEndpointState;
}
/**
*
* The state of the VPC endpoint.
*
*
* @param vpcEndpointState
* The state of the VPC endpoint.
* @return Returns a reference to this object so that method calls can be chained together.
* @see State
*/
public VpcEndpointConnection withVpcEndpointState(String vpcEndpointState) {
setVpcEndpointState(vpcEndpointState);
return this;
}
/**
*
* The state of the VPC endpoint.
*
*
* @param vpcEndpointState
* The state of the VPC endpoint.
* @return Returns a reference to this object so that method calls can be chained together.
* @see State
*/
public VpcEndpointConnection withVpcEndpointState(State vpcEndpointState) {
this.vpcEndpointState = vpcEndpointState.toString();
return this;
}
/**
*
* The date and time that the VPC endpoint was created.
*
*
* @param creationTimestamp
* The date and time that the VPC endpoint was created.
*/
public void setCreationTimestamp(java.util.Date creationTimestamp) {
this.creationTimestamp = creationTimestamp;
}
/**
*
* The date and time that the VPC endpoint was created.
*
*
* @return The date and time that the VPC endpoint was created.
*/
public java.util.Date getCreationTimestamp() {
return this.creationTimestamp;
}
/**
*
* The date and time that the VPC endpoint was created.
*
*
* @param creationTimestamp
* The date and time that the VPC endpoint was created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VpcEndpointConnection withCreationTimestamp(java.util.Date creationTimestamp) {
setCreationTimestamp(creationTimestamp);
return this;
}
/**
*
* The DNS entries for the VPC endpoint.
*
*
* @return The DNS entries for the VPC endpoint.
*/
public java.util.List getDnsEntries() {
if (dnsEntries == null) {
dnsEntries = new com.amazonaws.internal.SdkInternalList();
}
return dnsEntries;
}
/**
*
* The DNS entries for the VPC endpoint.
*
*
* @param dnsEntries
* The DNS entries for the VPC endpoint.
*/
public void setDnsEntries(java.util.Collection dnsEntries) {
if (dnsEntries == null) {
this.dnsEntries = null;
return;
}
this.dnsEntries = new com.amazonaws.internal.SdkInternalList(dnsEntries);
}
/**
*
* The DNS entries for the VPC endpoint.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setDnsEntries(java.util.Collection)} or {@link #withDnsEntries(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param dnsEntries
* The DNS entries for the VPC endpoint.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VpcEndpointConnection withDnsEntries(DnsEntry... dnsEntries) {
if (this.dnsEntries == null) {
setDnsEntries(new com.amazonaws.internal.SdkInternalList(dnsEntries.length));
}
for (DnsEntry ele : dnsEntries) {
this.dnsEntries.add(ele);
}
return this;
}
/**
*
* The DNS entries for the VPC endpoint.
*
*
* @param dnsEntries
* The DNS entries for the VPC endpoint.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VpcEndpointConnection withDnsEntries(java.util.Collection dnsEntries) {
setDnsEntries(dnsEntries);
return this;
}
/**
*
* The Amazon Resource Names (ARNs) of the network load balancers for the service.
*
*
* @return The Amazon Resource Names (ARNs) of the network load balancers for the service.
*/
public java.util.List getNetworkLoadBalancerArns() {
if (networkLoadBalancerArns == null) {
networkLoadBalancerArns = new com.amazonaws.internal.SdkInternalList();
}
return networkLoadBalancerArns;
}
/**
*
* The Amazon Resource Names (ARNs) of the network load balancers for the service.
*
*
* @param networkLoadBalancerArns
* The Amazon Resource Names (ARNs) of the network load balancers for the service.
*/
public void setNetworkLoadBalancerArns(java.util.Collection networkLoadBalancerArns) {
if (networkLoadBalancerArns == null) {
this.networkLoadBalancerArns = null;
return;
}
this.networkLoadBalancerArns = new com.amazonaws.internal.SdkInternalList(networkLoadBalancerArns);
}
/**
*
* The Amazon Resource Names (ARNs) of the network load balancers for the service.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setNetworkLoadBalancerArns(java.util.Collection)} or
* {@link #withNetworkLoadBalancerArns(java.util.Collection)} if you want to override the existing values.
*
*
* @param networkLoadBalancerArns
* The Amazon Resource Names (ARNs) of the network load balancers for the service.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VpcEndpointConnection withNetworkLoadBalancerArns(String... networkLoadBalancerArns) {
if (this.networkLoadBalancerArns == null) {
setNetworkLoadBalancerArns(new com.amazonaws.internal.SdkInternalList(networkLoadBalancerArns.length));
}
for (String ele : networkLoadBalancerArns) {
this.networkLoadBalancerArns.add(ele);
}
return this;
}
/**
*
* The Amazon Resource Names (ARNs) of the network load balancers for the service.
*
*
* @param networkLoadBalancerArns
* The Amazon Resource Names (ARNs) of the network load balancers for the service.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VpcEndpointConnection withNetworkLoadBalancerArns(java.util.Collection networkLoadBalancerArns) {
setNetworkLoadBalancerArns(networkLoadBalancerArns);
return this;
}
/**
*
* The Amazon Resource Names (ARNs) of the Gateway Load Balancers for the service.
*
*
* @return The Amazon Resource Names (ARNs) of the Gateway Load Balancers for the service.
*/
public java.util.List getGatewayLoadBalancerArns() {
if (gatewayLoadBalancerArns == null) {
gatewayLoadBalancerArns = new com.amazonaws.internal.SdkInternalList();
}
return gatewayLoadBalancerArns;
}
/**
*
* The Amazon Resource Names (ARNs) of the Gateway Load Balancers for the service.
*
*
* @param gatewayLoadBalancerArns
* The Amazon Resource Names (ARNs) of the Gateway Load Balancers for the service.
*/
public void setGatewayLoadBalancerArns(java.util.Collection gatewayLoadBalancerArns) {
if (gatewayLoadBalancerArns == null) {
this.gatewayLoadBalancerArns = null;
return;
}
this.gatewayLoadBalancerArns = new com.amazonaws.internal.SdkInternalList(gatewayLoadBalancerArns);
}
/**
*
* The Amazon Resource Names (ARNs) of the Gateway Load Balancers for the service.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setGatewayLoadBalancerArns(java.util.Collection)} or
* {@link #withGatewayLoadBalancerArns(java.util.Collection)} if you want to override the existing values.
*
*
* @param gatewayLoadBalancerArns
* The Amazon Resource Names (ARNs) of the Gateway Load Balancers for the service.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VpcEndpointConnection withGatewayLoadBalancerArns(String... gatewayLoadBalancerArns) {
if (this.gatewayLoadBalancerArns == null) {
setGatewayLoadBalancerArns(new com.amazonaws.internal.SdkInternalList(gatewayLoadBalancerArns.length));
}
for (String ele : gatewayLoadBalancerArns) {
this.gatewayLoadBalancerArns.add(ele);
}
return this;
}
/**
*
* The Amazon Resource Names (ARNs) of the Gateway Load Balancers for the service.
*
*
* @param gatewayLoadBalancerArns
* The Amazon Resource Names (ARNs) of the Gateway Load Balancers for the service.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VpcEndpointConnection withGatewayLoadBalancerArns(java.util.Collection gatewayLoadBalancerArns) {
setGatewayLoadBalancerArns(gatewayLoadBalancerArns);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getServiceId() != null)
sb.append("ServiceId: ").append(getServiceId()).append(",");
if (getVpcEndpointId() != null)
sb.append("VpcEndpointId: ").append(getVpcEndpointId()).append(",");
if (getVpcEndpointOwner() != null)
sb.append("VpcEndpointOwner: ").append(getVpcEndpointOwner()).append(",");
if (getVpcEndpointState() != null)
sb.append("VpcEndpointState: ").append(getVpcEndpointState()).append(",");
if (getCreationTimestamp() != null)
sb.append("CreationTimestamp: ").append(getCreationTimestamp()).append(",");
if (getDnsEntries() != null)
sb.append("DnsEntries: ").append(getDnsEntries()).append(",");
if (getNetworkLoadBalancerArns() != null)
sb.append("NetworkLoadBalancerArns: ").append(getNetworkLoadBalancerArns()).append(",");
if (getGatewayLoadBalancerArns() != null)
sb.append("GatewayLoadBalancerArns: ").append(getGatewayLoadBalancerArns());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof VpcEndpointConnection == false)
return false;
VpcEndpointConnection other = (VpcEndpointConnection) obj;
if (other.getServiceId() == null ^ this.getServiceId() == null)
return false;
if (other.getServiceId() != null && other.getServiceId().equals(this.getServiceId()) == false)
return false;
if (other.getVpcEndpointId() == null ^ this.getVpcEndpointId() == null)
return false;
if (other.getVpcEndpointId() != null && other.getVpcEndpointId().equals(this.getVpcEndpointId()) == false)
return false;
if (other.getVpcEndpointOwner() == null ^ this.getVpcEndpointOwner() == null)
return false;
if (other.getVpcEndpointOwner() != null && other.getVpcEndpointOwner().equals(this.getVpcEndpointOwner()) == false)
return false;
if (other.getVpcEndpointState() == null ^ this.getVpcEndpointState() == null)
return false;
if (other.getVpcEndpointState() != null && other.getVpcEndpointState().equals(this.getVpcEndpointState()) == false)
return false;
if (other.getCreationTimestamp() == null ^ this.getCreationTimestamp() == null)
return false;
if (other.getCreationTimestamp() != null && other.getCreationTimestamp().equals(this.getCreationTimestamp()) == false)
return false;
if (other.getDnsEntries() == null ^ this.getDnsEntries() == null)
return false;
if (other.getDnsEntries() != null && other.getDnsEntries().equals(this.getDnsEntries()) == false)
return false;
if (other.getNetworkLoadBalancerArns() == null ^ this.getNetworkLoadBalancerArns() == null)
return false;
if (other.getNetworkLoadBalancerArns() != null && other.getNetworkLoadBalancerArns().equals(this.getNetworkLoadBalancerArns()) == false)
return false;
if (other.getGatewayLoadBalancerArns() == null ^ this.getGatewayLoadBalancerArns() == null)
return false;
if (other.getGatewayLoadBalancerArns() != null && other.getGatewayLoadBalancerArns().equals(this.getGatewayLoadBalancerArns()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getServiceId() == null) ? 0 : getServiceId().hashCode());
hashCode = prime * hashCode + ((getVpcEndpointId() == null) ? 0 : getVpcEndpointId().hashCode());
hashCode = prime * hashCode + ((getVpcEndpointOwner() == null) ? 0 : getVpcEndpointOwner().hashCode());
hashCode = prime * hashCode + ((getVpcEndpointState() == null) ? 0 : getVpcEndpointState().hashCode());
hashCode = prime * hashCode + ((getCreationTimestamp() == null) ? 0 : getCreationTimestamp().hashCode());
hashCode = prime * hashCode + ((getDnsEntries() == null) ? 0 : getDnsEntries().hashCode());
hashCode = prime * hashCode + ((getNetworkLoadBalancerArns() == null) ? 0 : getNetworkLoadBalancerArns().hashCode());
hashCode = prime * hashCode + ((getGatewayLoadBalancerArns() == null) ? 0 : getGatewayLoadBalancerArns().hashCode());
return hashCode;
}
@Override
public VpcEndpointConnection clone() {
try {
return (VpcEndpointConnection) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}