com.amazonaws.services.elasticloadbalancingv2.model.TargetDescription Maven / Gradle / Ivy
Show all versions of aws-java-sdk-elasticloadbalancingv2 Show documentation
/*
* Copyright 2013-2018 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.elasticloadbalancingv2.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* Information about a target.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class TargetDescription implements Serializable, Cloneable {
/**
*
* The ID of the target. If the target type of the target group is instance
, specify an instance ID. If
* the target type is ip
, specify an IP address.
*
*/
private String id;
/**
*
* The port on which the target is listening.
*
*/
private Integer port;
/**
*
* An Availability Zone or all
. This determines whether the target receives traffic from the load
* balancer nodes in the specified Availability Zone or from all enabled Availability Zones for the load balancer.
*
*
* This parameter is not supported if the target type of the target group is instance
. If the IP
* address is in a subnet of the VPC for the target group, the Availability Zone is automatically detected and this
* parameter is optional. If the IP address is outside the VPC, this parameter is required.
*
*
* With an Application Load Balancer, if the IP address is outside the VPC for the target group, the only supported
* value is all
.
*
*/
private String availabilityZone;
/**
*
* The ID of the target. If the target type of the target group is instance
, specify an instance ID. If
* the target type is ip
, specify an IP address.
*
*
* @param id
* The ID of the target. If the target type of the target group is instance
, specify an instance
* ID. If the target type is ip
, specify an IP address.
*/
public void setId(String id) {
this.id = id;
}
/**
*
* The ID of the target. If the target type of the target group is instance
, specify an instance ID. If
* the target type is ip
, specify an IP address.
*
*
* @return The ID of the target. If the target type of the target group is instance
, specify an
* instance ID. If the target type is ip
, specify an IP address.
*/
public String getId() {
return this.id;
}
/**
*
* The ID of the target. If the target type of the target group is instance
, specify an instance ID. If
* the target type is ip
, specify an IP address.
*
*
* @param id
* The ID of the target. If the target type of the target group is instance
, specify an instance
* ID. If the target type is ip
, specify an IP address.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TargetDescription withId(String id) {
setId(id);
return this;
}
/**
*
* The port on which the target is listening.
*
*
* @param port
* The port on which the target is listening.
*/
public void setPort(Integer port) {
this.port = port;
}
/**
*
* The port on which the target is listening.
*
*
* @return The port on which the target is listening.
*/
public Integer getPort() {
return this.port;
}
/**
*
* The port on which the target is listening.
*
*
* @param port
* The port on which the target is listening.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TargetDescription withPort(Integer port) {
setPort(port);
return this;
}
/**
*
* An Availability Zone or all
. This determines whether the target receives traffic from the load
* balancer nodes in the specified Availability Zone or from all enabled Availability Zones for the load balancer.
*
*
* This parameter is not supported if the target type of the target group is instance
. If the IP
* address is in a subnet of the VPC for the target group, the Availability Zone is automatically detected and this
* parameter is optional. If the IP address is outside the VPC, this parameter is required.
*
*
* With an Application Load Balancer, if the IP address is outside the VPC for the target group, the only supported
* value is all
.
*
*
* @param availabilityZone
* An Availability Zone or all
. This determines whether the target receives traffic from the
* load balancer nodes in the specified Availability Zone or from all enabled Availability Zones for the load
* balancer.
*
* This parameter is not supported if the target type of the target group is instance
. If the IP
* address is in a subnet of the VPC for the target group, the Availability Zone is automatically detected
* and this parameter is optional. If the IP address is outside the VPC, this parameter is required.
*
*
* With an Application Load Balancer, if the IP address is outside the VPC for the target group, the only
* supported value is all
.
*/
public void setAvailabilityZone(String availabilityZone) {
this.availabilityZone = availabilityZone;
}
/**
*
* An Availability Zone or all
. This determines whether the target receives traffic from the load
* balancer nodes in the specified Availability Zone or from all enabled Availability Zones for the load balancer.
*
*
* This parameter is not supported if the target type of the target group is instance
. If the IP
* address is in a subnet of the VPC for the target group, the Availability Zone is automatically detected and this
* parameter is optional. If the IP address is outside the VPC, this parameter is required.
*
*
* With an Application Load Balancer, if the IP address is outside the VPC for the target group, the only supported
* value is all
.
*
*
* @return An Availability Zone or all
. This determines whether the target receives traffic from the
* load balancer nodes in the specified Availability Zone or from all enabled Availability Zones for the
* load balancer.
*
* This parameter is not supported if the target type of the target group is instance
. If the
* IP address is in a subnet of the VPC for the target group, the Availability Zone is automatically
* detected and this parameter is optional. If the IP address is outside the VPC, this parameter is
* required.
*
*
* With an Application Load Balancer, if the IP address is outside the VPC for the target group, the only
* supported value is all
.
*/
public String getAvailabilityZone() {
return this.availabilityZone;
}
/**
*
* An Availability Zone or all
. This determines whether the target receives traffic from the load
* balancer nodes in the specified Availability Zone or from all enabled Availability Zones for the load balancer.
*
*
* This parameter is not supported if the target type of the target group is instance
. If the IP
* address is in a subnet of the VPC for the target group, the Availability Zone is automatically detected and this
* parameter is optional. If the IP address is outside the VPC, this parameter is required.
*
*
* With an Application Load Balancer, if the IP address is outside the VPC for the target group, the only supported
* value is all
.
*
*
* @param availabilityZone
* An Availability Zone or all
. This determines whether the target receives traffic from the
* load balancer nodes in the specified Availability Zone or from all enabled Availability Zones for the load
* balancer.
*
* This parameter is not supported if the target type of the target group is instance
. If the IP
* address is in a subnet of the VPC for the target group, the Availability Zone is automatically detected
* and this parameter is optional. If the IP address is outside the VPC, this parameter is required.
*
*
* With an Application Load Balancer, if the IP address is outside the VPC for the target group, the only
* supported value is all
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TargetDescription withAvailabilityZone(String availabilityZone) {
setAvailabilityZone(availabilityZone);
return this;
}
/**
* Returns a string representation of this object; useful for testing and debugging.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getId() != null)
sb.append("Id: ").append(getId()).append(",");
if (getPort() != null)
sb.append("Port: ").append(getPort()).append(",");
if (getAvailabilityZone() != null)
sb.append("AvailabilityZone: ").append(getAvailabilityZone());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof TargetDescription == false)
return false;
TargetDescription other = (TargetDescription) obj;
if (other.getId() == null ^ this.getId() == null)
return false;
if (other.getId() != null && other.getId().equals(this.getId()) == false)
return false;
if (other.getPort() == null ^ this.getPort() == null)
return false;
if (other.getPort() != null && other.getPort().equals(this.getPort()) == false)
return false;
if (other.getAvailabilityZone() == null ^ this.getAvailabilityZone() == null)
return false;
if (other.getAvailabilityZone() != null && other.getAvailabilityZone().equals(this.getAvailabilityZone()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getId() == null) ? 0 : getId().hashCode());
hashCode = prime * hashCode + ((getPort() == null) ? 0 : getPort().hashCode());
hashCode = prime * hashCode + ((getAvailabilityZone() == null) ? 0 : getAvailabilityZone().hashCode());
return hashCode;
}
@Override
public TargetDescription clone() {
try {
return (TargetDescription) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}