com.amazonaws.services.globalaccelerator.model.Resource Maven / Gradle / Ivy
Show all versions of aws-java-sdk-globalaccelerator Show documentation
/*
* Copyright 2019-2024 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.globalaccelerator.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* A resource is one of the following: the ARN for an Amazon Web Services resource that is supported by Global
* Accelerator to be added as an endpoint, or a CIDR range that specifies a bring your own IP (BYOIP) address pool.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Resource implements Serializable, Cloneable, StructuredPojo {
/**
*
* The endpoint ID for the endpoint that is specified as a Amazon Web Services resource.
*
*
* An endpoint ID for the cross-account feature is the ARN of an Amazon Web Services resource, such as a Network
* Load Balancer, that Global Accelerator supports as an endpoint for an accelerator.
*
*/
private String endpointId;
/**
*
* An IP address range, in CIDR format, that is specified as resource. The address must be provisioned and
* advertised in Global Accelerator by following the bring your own IP address (BYOIP) process for Global
* Accelerator
*
*
* For more information, see Bring your own IP addresses
* (BYOIP) in the Global Accelerator Developer Guide.
*
*/
private String cidr;
/**
*
* The Amazon Web Services Region where a shared endpoint resource is located.
*
*/
private String region;
/**
*
* The endpoint ID for the endpoint that is specified as a Amazon Web Services resource.
*
*
* An endpoint ID for the cross-account feature is the ARN of an Amazon Web Services resource, such as a Network
* Load Balancer, that Global Accelerator supports as an endpoint for an accelerator.
*
*
* @param endpointId
* The endpoint ID for the endpoint that is specified as a Amazon Web Services resource.
*
* An endpoint ID for the cross-account feature is the ARN of an Amazon Web Services resource, such as a
* Network Load Balancer, that Global Accelerator supports as an endpoint for an accelerator.
*/
public void setEndpointId(String endpointId) {
this.endpointId = endpointId;
}
/**
*
* The endpoint ID for the endpoint that is specified as a Amazon Web Services resource.
*
*
* An endpoint ID for the cross-account feature is the ARN of an Amazon Web Services resource, such as a Network
* Load Balancer, that Global Accelerator supports as an endpoint for an accelerator.
*
*
* @return The endpoint ID for the endpoint that is specified as a Amazon Web Services resource.
*
* An endpoint ID for the cross-account feature is the ARN of an Amazon Web Services resource, such as a
* Network Load Balancer, that Global Accelerator supports as an endpoint for an accelerator.
*/
public String getEndpointId() {
return this.endpointId;
}
/**
*
* The endpoint ID for the endpoint that is specified as a Amazon Web Services resource.
*
*
* An endpoint ID for the cross-account feature is the ARN of an Amazon Web Services resource, such as a Network
* Load Balancer, that Global Accelerator supports as an endpoint for an accelerator.
*
*
* @param endpointId
* The endpoint ID for the endpoint that is specified as a Amazon Web Services resource.
*
* An endpoint ID for the cross-account feature is the ARN of an Amazon Web Services resource, such as a
* Network Load Balancer, that Global Accelerator supports as an endpoint for an accelerator.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Resource withEndpointId(String endpointId) {
setEndpointId(endpointId);
return this;
}
/**
*
* An IP address range, in CIDR format, that is specified as resource. The address must be provisioned and
* advertised in Global Accelerator by following the bring your own IP address (BYOIP) process for Global
* Accelerator
*
*
* For more information, see Bring your own IP addresses
* (BYOIP) in the Global Accelerator Developer Guide.
*
*
* @param cidr
* An IP address range, in CIDR format, that is specified as resource. The address must be provisioned and
* advertised in Global Accelerator by following the bring your own IP address (BYOIP) process for Global
* Accelerator
*
* For more information, see Bring your own IP
* addresses (BYOIP) in the Global Accelerator Developer Guide.
*/
public void setCidr(String cidr) {
this.cidr = cidr;
}
/**
*
* An IP address range, in CIDR format, that is specified as resource. The address must be provisioned and
* advertised in Global Accelerator by following the bring your own IP address (BYOIP) process for Global
* Accelerator
*
*
* For more information, see Bring your own IP addresses
* (BYOIP) in the Global Accelerator Developer Guide.
*
*
* @return An IP address range, in CIDR format, that is specified as resource. The address must be provisioned and
* advertised in Global Accelerator by following the bring your own IP address (BYOIP) process for Global
* Accelerator
*
* For more information, see Bring your own IP
* addresses (BYOIP) in the Global Accelerator Developer Guide.
*/
public String getCidr() {
return this.cidr;
}
/**
*
* An IP address range, in CIDR format, that is specified as resource. The address must be provisioned and
* advertised in Global Accelerator by following the bring your own IP address (BYOIP) process for Global
* Accelerator
*
*
* For more information, see Bring your own IP addresses
* (BYOIP) in the Global Accelerator Developer Guide.
*
*
* @param cidr
* An IP address range, in CIDR format, that is specified as resource. The address must be provisioned and
* advertised in Global Accelerator by following the bring your own IP address (BYOIP) process for Global
* Accelerator
*
* For more information, see Bring your own IP
* addresses (BYOIP) in the Global Accelerator Developer Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Resource withCidr(String cidr) {
setCidr(cidr);
return this;
}
/**
*
* The Amazon Web Services Region where a shared endpoint resource is located.
*
*
* @param region
* The Amazon Web Services Region where a shared endpoint resource is located.
*/
public void setRegion(String region) {
this.region = region;
}
/**
*
* The Amazon Web Services Region where a shared endpoint resource is located.
*
*
* @return The Amazon Web Services Region where a shared endpoint resource is located.
*/
public String getRegion() {
return this.region;
}
/**
*
* The Amazon Web Services Region where a shared endpoint resource is located.
*
*
* @param region
* The Amazon Web Services Region where a shared endpoint resource is located.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Resource withRegion(String region) {
setRegion(region);
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 (getEndpointId() != null)
sb.append("EndpointId: ").append(getEndpointId()).append(",");
if (getCidr() != null)
sb.append("Cidr: ").append(getCidr()).append(",");
if (getRegion() != null)
sb.append("Region: ").append(getRegion());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Resource == false)
return false;
Resource other = (Resource) obj;
if (other.getEndpointId() == null ^ this.getEndpointId() == null)
return false;
if (other.getEndpointId() != null && other.getEndpointId().equals(this.getEndpointId()) == false)
return false;
if (other.getCidr() == null ^ this.getCidr() == null)
return false;
if (other.getCidr() != null && other.getCidr().equals(this.getCidr()) == false)
return false;
if (other.getRegion() == null ^ this.getRegion() == null)
return false;
if (other.getRegion() != null && other.getRegion().equals(this.getRegion()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getEndpointId() == null) ? 0 : getEndpointId().hashCode());
hashCode = prime * hashCode + ((getCidr() == null) ? 0 : getCidr().hashCode());
hashCode = prime * hashCode + ((getRegion() == null) ? 0 : getRegion().hashCode());
return hashCode;
}
@Override
public Resource clone() {
try {
return (Resource) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.globalaccelerator.model.transform.ResourceMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}