/* * Copyright 2018-2023 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.vpclattice.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Describes the configuration of a target group. Lambda functions don't support target group configuration. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class TargetGroupConfig implements Serializable, Cloneable, StructuredPojo { /** ** The health check configuration. *
*/ private HealthCheckConfig healthCheck; /** *
* The type of IP address used for the target group. The possible values are ipv4
and ipv6
* . This is an optional parameter. If not specified, the IP address type defaults to ipv4
.
*
* The port on which the targets are listening. For HTTP, the default is 80
. For HTTPS, the default is
* 443
*
* The protocol to use for routing traffic to the targets. Default is the protocol of a target group. *
*/ private String protocol; /** *
* The protocol version. Default value is HTTP1
.
*
* The ID of the VPC. *
*/ private String vpcIdentifier; /** ** The health check configuration. *
* * @param healthCheck * The health check configuration. */ public void setHealthCheck(HealthCheckConfig healthCheck) { this.healthCheck = healthCheck; } /** ** The health check configuration. *
* * @return The health check configuration. */ public HealthCheckConfig getHealthCheck() { return this.healthCheck; } /** ** The health check configuration. *
* * @param healthCheck * The health check configuration. * @return Returns a reference to this object so that method calls can be chained together. */ public TargetGroupConfig withHealthCheck(HealthCheckConfig healthCheck) { setHealthCheck(healthCheck); return this; } /** *
* The type of IP address used for the target group. The possible values are ipv4
and ipv6
* . This is an optional parameter. If not specified, the IP address type defaults to ipv4
.
*
ipv4
and
* ipv6
. This is an optional parameter. If not specified, the IP address type defaults to
* ipv4
.
* @see IpAddressType
*/
public void setIpAddressType(String ipAddressType) {
this.ipAddressType = ipAddressType;
}
/**
*
* The type of IP address used for the target group. The possible values are ipv4
and ipv6
* . This is an optional parameter. If not specified, the IP address type defaults to ipv4
.
*
ipv4
and
* ipv6
. This is an optional parameter. If not specified, the IP address type defaults to
* ipv4
.
* @see IpAddressType
*/
public String getIpAddressType() {
return this.ipAddressType;
}
/**
*
* The type of IP address used for the target group. The possible values are ipv4
and ipv6
* . This is an optional parameter. If not specified, the IP address type defaults to ipv4
.
*
ipv4
and
* ipv6
. This is an optional parameter. If not specified, the IP address type defaults to
* ipv4
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see IpAddressType
*/
public TargetGroupConfig withIpAddressType(String ipAddressType) {
setIpAddressType(ipAddressType);
return this;
}
/**
*
* The type of IP address used for the target group. The possible values are ipv4
and ipv6
* . This is an optional parameter. If not specified, the IP address type defaults to ipv4
.
*
ipv4
and
* ipv6
. This is an optional parameter. If not specified, the IP address type defaults to
* ipv4
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see IpAddressType
*/
public TargetGroupConfig withIpAddressType(IpAddressType ipAddressType) {
this.ipAddressType = ipAddressType.toString();
return this;
}
/**
*
* The port on which the targets are listening. For HTTP, the default is 80
. For HTTPS, the default is
* 443
*
80
. For HTTPS, the
* default is 443
*/
public void setPort(Integer port) {
this.port = port;
}
/**
*
* The port on which the targets are listening. For HTTP, the default is 80
. For HTTPS, the default is
* 443
*
80
. For HTTPS, the
* default is 443
*/
public Integer getPort() {
return this.port;
}
/**
*
* The port on which the targets are listening. For HTTP, the default is 80
. For HTTPS, the default is
* 443
*
80
. For HTTPS, the
* default is 443
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TargetGroupConfig withPort(Integer port) {
setPort(port);
return this;
}
/**
* * The protocol to use for routing traffic to the targets. Default is the protocol of a target group. *
* * @param protocol * The protocol to use for routing traffic to the targets. Default is the protocol of a target group. * @see TargetGroupProtocol */ public void setProtocol(String protocol) { this.protocol = protocol; } /** ** The protocol to use for routing traffic to the targets. Default is the protocol of a target group. *
* * @return The protocol to use for routing traffic to the targets. Default is the protocol of a target group. * @see TargetGroupProtocol */ public String getProtocol() { return this.protocol; } /** ** The protocol to use for routing traffic to the targets. Default is the protocol of a target group. *
* * @param protocol * The protocol to use for routing traffic to the targets. Default is the protocol of a target group. * @return Returns a reference to this object so that method calls can be chained together. * @see TargetGroupProtocol */ public TargetGroupConfig withProtocol(String protocol) { setProtocol(protocol); return this; } /** ** The protocol to use for routing traffic to the targets. Default is the protocol of a target group. *
* * @param protocol * The protocol to use for routing traffic to the targets. Default is the protocol of a target group. * @return Returns a reference to this object so that method calls can be chained together. * @see TargetGroupProtocol */ public TargetGroupConfig withProtocol(TargetGroupProtocol protocol) { this.protocol = protocol.toString(); return this; } /** *
* The protocol version. Default value is HTTP1
.
*
HTTP1
.
* @see TargetGroupProtocolVersion
*/
public void setProtocolVersion(String protocolVersion) {
this.protocolVersion = protocolVersion;
}
/**
*
* The protocol version. Default value is HTTP1
.
*
HTTP1
.
* @see TargetGroupProtocolVersion
*/
public String getProtocolVersion() {
return this.protocolVersion;
}
/**
*
* The protocol version. Default value is HTTP1
.
*
HTTP1
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see TargetGroupProtocolVersion
*/
public TargetGroupConfig withProtocolVersion(String protocolVersion) {
setProtocolVersion(protocolVersion);
return this;
}
/**
*
* The protocol version. Default value is HTTP1
.
*
HTTP1
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see TargetGroupProtocolVersion
*/
public TargetGroupConfig withProtocolVersion(TargetGroupProtocolVersion protocolVersion) {
this.protocolVersion = protocolVersion.toString();
return this;
}
/**
* * The ID of the VPC. *
* * @param vpcIdentifier * The ID of the VPC. */ public void setVpcIdentifier(String vpcIdentifier) { this.vpcIdentifier = vpcIdentifier; } /** ** The ID of the VPC. *
* * @return The ID of the VPC. */ public String getVpcIdentifier() { return this.vpcIdentifier; } /** ** The ID of the VPC. *
* * @param vpcIdentifier * The ID of the VPC. * @return Returns a reference to this object so that method calls can be chained together. */ public TargetGroupConfig withVpcIdentifier(String vpcIdentifier) { setVpcIdentifier(vpcIdentifier); 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 (getHealthCheck() != null) sb.append("HealthCheck: ").append(getHealthCheck()).append(","); if (getIpAddressType() != null) sb.append("IpAddressType: ").append(getIpAddressType()).append(","); if (getPort() != null) sb.append("Port: ").append(getPort()).append(","); if (getProtocol() != null) sb.append("Protocol: ").append(getProtocol()).append(","); if (getProtocolVersion() != null) sb.append("ProtocolVersion: ").append(getProtocolVersion()).append(","); if (getVpcIdentifier() != null) sb.append("VpcIdentifier: ").append(getVpcIdentifier()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof TargetGroupConfig == false) return false; TargetGroupConfig other = (TargetGroupConfig) obj; if (other.getHealthCheck() == null ^ this.getHealthCheck() == null) return false; if (other.getHealthCheck() != null && other.getHealthCheck().equals(this.getHealthCheck()) == false) return false; if (other.getIpAddressType() == null ^ this.getIpAddressType() == null) return false; if (other.getIpAddressType() != null && other.getIpAddressType().equals(this.getIpAddressType()) == 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.getProtocol() == null ^ this.getProtocol() == null) return false; if (other.getProtocol() != null && other.getProtocol().equals(this.getProtocol()) == false) return false; if (other.getProtocolVersion() == null ^ this.getProtocolVersion() == null) return false; if (other.getProtocolVersion() != null && other.getProtocolVersion().equals(this.getProtocolVersion()) == false) return false; if (other.getVpcIdentifier() == null ^ this.getVpcIdentifier() == null) return false; if (other.getVpcIdentifier() != null && other.getVpcIdentifier().equals(this.getVpcIdentifier()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getHealthCheck() == null) ? 0 : getHealthCheck().hashCode()); hashCode = prime * hashCode + ((getIpAddressType() == null) ? 0 : getIpAddressType().hashCode()); hashCode = prime * hashCode + ((getPort() == null) ? 0 : getPort().hashCode()); hashCode = prime * hashCode + ((getProtocol() == null) ? 0 : getProtocol().hashCode()); hashCode = prime * hashCode + ((getProtocolVersion() == null) ? 0 : getProtocolVersion().hashCode()); hashCode = prime * hashCode + ((getVpcIdentifier() == null) ? 0 : getVpcIdentifier().hashCode()); return hashCode; } @Override public TargetGroupConfig clone() { try { return (TargetGroupConfig) 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.vpclattice.model.transform.TargetGroupConfigMarshaller.getInstance().marshall(this, protocolMarshaller); } }