com.amazonaws.services.elasticloadbalancingv2.model.TargetDescription Maven / Gradle / Ivy
Show all versions of aws-java-sdk-elasticloadbalancingv2 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.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. If the target type is lambda
, specify the
* ARN of the Lambda function. If the target type is alb
, specify the ARN of the Application Load
* Balancer target.
*
*/
private String id;
/**
*
* The port on which the target is listening. If the target group protocol is GENEVE, the supported port is 6081. If
* the target type is alb
, the targeted Application Load Balancer must have at least one listener whose
* port matches the target group port. This parameter is not used if the target is a Lambda function.
*
*/
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.
*
*
* For Application Load Balancer target groups, the specified Availability Zone value is only applicable when
* cross-zone load balancing is off. Otherwise the parameter is ignored and treated as all
.
*
*
* This parameter is not supported if the target type of the target group is instance
or
* alb
.
*
*
* If the target type is ip
and 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.
*
*
* For Application Load Balancer target groups with cross-zone load balancing off, if the target type is
* ip
and the IP address is outside of the VPC for the target group, this should be an Availability
* Zone inside the VPC for the target group.
*
*
* If the target type is lambda
, this parameter is optional and 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. If the target type is lambda
, specify the
* ARN of the Lambda function. If the target type is alb
, specify the ARN of the Application Load
* Balancer target.
*
*
* @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. If the target type is
* lambda
, specify the ARN of the Lambda function. If the target type is alb
,
* specify the ARN of the Application Load Balancer target.
*/
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. If the target type is lambda
, specify the
* ARN of the Lambda function. If the target type is alb
, specify the ARN of the Application Load
* Balancer target.
*
*
* @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. If the target type is
* lambda
, specify the ARN of the Lambda function. If the target type is alb
,
* specify the ARN of the Application Load Balancer target.
*/
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. If the target type is lambda
, specify the
* ARN of the Lambda function. If the target type is alb
, specify the ARN of the Application Load
* Balancer target.
*
*
* @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. If the target type is
* lambda
, specify the ARN of the Lambda function. If the target type is alb
,
* specify the ARN of the Application Load Balancer target.
* @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. If the target group protocol is GENEVE, the supported port is 6081. If
* the target type is alb
, the targeted Application Load Balancer must have at least one listener whose
* port matches the target group port. This parameter is not used if the target is a Lambda function.
*
*
* @param port
* The port on which the target is listening. If the target group protocol is GENEVE, the supported port is
* 6081. If the target type is alb
, the targeted Application Load Balancer must have at least
* one listener whose port matches the target group port. This parameter is not used if the target is a
* Lambda function.
*/
public void setPort(Integer port) {
this.port = port;
}
/**
*
* The port on which the target is listening. If the target group protocol is GENEVE, the supported port is 6081. If
* the target type is alb
, the targeted Application Load Balancer must have at least one listener whose
* port matches the target group port. This parameter is not used if the target is a Lambda function.
*
*
* @return The port on which the target is listening. If the target group protocol is GENEVE, the supported port is
* 6081. If the target type is alb
, the targeted Application Load Balancer must have at least
* one listener whose port matches the target group port. This parameter is not used if the target is a
* Lambda function.
*/
public Integer getPort() {
return this.port;
}
/**
*
* The port on which the target is listening. If the target group protocol is GENEVE, the supported port is 6081. If
* the target type is alb
, the targeted Application Load Balancer must have at least one listener whose
* port matches the target group port. This parameter is not used if the target is a Lambda function.
*
*
* @param port
* The port on which the target is listening. If the target group protocol is GENEVE, the supported port is
* 6081. If the target type is alb
, the targeted Application Load Balancer must have at least
* one listener whose port matches the target group port. This parameter is not used if the target is a
* Lambda function.
* @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.
*
*
* For Application Load Balancer target groups, the specified Availability Zone value is only applicable when
* cross-zone load balancing is off. Otherwise the parameter is ignored and treated as all
.
*
*
* This parameter is not supported if the target type of the target group is instance
or
* alb
.
*
*
* If the target type is ip
and 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.
*
*
* For Application Load Balancer target groups with cross-zone load balancing off, if the target type is
* ip
and the IP address is outside of the VPC for the target group, this should be an Availability
* Zone inside the VPC for the target group.
*
*
* If the target type is lambda
, this parameter is optional and 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.
*
* For Application Load Balancer target groups, the specified Availability Zone value is only applicable when
* cross-zone load balancing is off. Otherwise the parameter is ignored and treated as all
.
*
*
* This parameter is not supported if the target type of the target group is instance
or
* alb
.
*
*
* If the target type is ip
and 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.
*
*
* For Application Load Balancer target groups with cross-zone load balancing off, if the target type is
* ip
and the IP address is outside of the VPC for the target group, this should be an
* Availability Zone inside the VPC for the target group.
*
*
* If the target type is lambda
, this parameter is optional and 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.
*
*
* For Application Load Balancer target groups, the specified Availability Zone value is only applicable when
* cross-zone load balancing is off. Otherwise the parameter is ignored and treated as all
.
*
*
* This parameter is not supported if the target type of the target group is instance
or
* alb
.
*
*
* If the target type is ip
and 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.
*
*
* For Application Load Balancer target groups with cross-zone load balancing off, if the target type is
* ip
and the IP address is outside of the VPC for the target group, this should be an Availability
* Zone inside the VPC for the target group.
*
*
* If the target type is lambda
, this parameter is optional and 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.
*
* For Application Load Balancer target groups, the specified Availability Zone value is only applicable
* when cross-zone load balancing is off. Otherwise the parameter is ignored and treated as all
* .
*
*
* This parameter is not supported if the target type of the target group is instance
or
* alb
.
*
*
* If the target type is ip
and 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.
*
*
* For Application Load Balancer target groups with cross-zone load balancing off, if the target type is
* ip
and the IP address is outside of the VPC for the target group, this should be an
* Availability Zone inside the VPC for the target group.
*
*
* If the target type is lambda
, this parameter is optional and 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.
*
*
* For Application Load Balancer target groups, the specified Availability Zone value is only applicable when
* cross-zone load balancing is off. Otherwise the parameter is ignored and treated as all
.
*
*
* This parameter is not supported if the target type of the target group is instance
or
* alb
.
*
*
* If the target type is ip
and 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.
*
*
* For Application Load Balancer target groups with cross-zone load balancing off, if the target type is
* ip
and the IP address is outside of the VPC for the target group, this should be an Availability
* Zone inside the VPC for the target group.
*
*
* If the target type is lambda
, this parameter is optional and 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.
*
* For Application Load Balancer target groups, the specified Availability Zone value is only applicable when
* cross-zone load balancing is off. Otherwise the parameter is ignored and treated as all
.
*
*
* This parameter is not supported if the target type of the target group is instance
or
* alb
.
*
*
* If the target type is ip
and 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.
*
*
* For Application Load Balancer target groups with cross-zone load balancing off, if the target type is
* ip
and the IP address is outside of the VPC for the target group, this should be an
* Availability Zone inside the VPC for the target group.
*
*
* If the target type is lambda
, this parameter is optional and 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. 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 (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);
}
}
}