/* * 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; /** *
* Summary information about a target group. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class TargetGroupSummary implements Serializable, Cloneable, StructuredPojo { /** ** The ARN (Amazon Resource Name) of the target group. *
*/ private String arn; /** ** The date and time that the target group was created, specified in ISO-8601 format. *
*/ private java.util.Date createdAt; /** ** The ID of the target group. *
*/ private String id; /** *
* 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 date and time that the target group was last updated, specified in ISO-8601 format. *
*/ private java.util.Date lastUpdatedAt; /** ** The name of the target group. *
*/ private String name; /** ** The port of the target group. *
*/ private Integer port; /** ** The protocol of the target group. *
*/ private String protocol; /** ** The list of Amazon Resource Names (ARNs) of the service. *
*/ private java.util.List* The status. *
*/ private String status; /** ** The target group type. *
*/ private String type; /** ** The ID of the VPC of the target group. *
*/ private String vpcIdentifier; /** ** The ARN (Amazon Resource Name) of the target group. *
* * @param arn * The ARN (Amazon Resource Name) of the target group. */ public void setArn(String arn) { this.arn = arn; } /** ** The ARN (Amazon Resource Name) of the target group. *
* * @return The ARN (Amazon Resource Name) of the target group. */ public String getArn() { return this.arn; } /** ** The ARN (Amazon Resource Name) of the target group. *
* * @param arn * The ARN (Amazon Resource Name) of the target group. * @return Returns a reference to this object so that method calls can be chained together. */ public TargetGroupSummary withArn(String arn) { setArn(arn); return this; } /** ** The date and time that the target group was created, specified in ISO-8601 format. *
* * @param createdAt * The date and time that the target group was created, specified in ISO-8601 format. */ public void setCreatedAt(java.util.Date createdAt) { this.createdAt = createdAt; } /** ** The date and time that the target group was created, specified in ISO-8601 format. *
* * @return The date and time that the target group was created, specified in ISO-8601 format. */ public java.util.Date getCreatedAt() { return this.createdAt; } /** ** The date and time that the target group was created, specified in ISO-8601 format. *
* * @param createdAt * The date and time that the target group was created, specified in ISO-8601 format. * @return Returns a reference to this object so that method calls can be chained together. */ public TargetGroupSummary withCreatedAt(java.util.Date createdAt) { setCreatedAt(createdAt); return this; } /** ** The ID of the target group. *
* * @param id * The ID of the target group. */ public void setId(String id) { this.id = id; } /** ** The ID of the target group. *
* * @return The ID of the target group. */ public String getId() { return this.id; } /** ** The ID of the target group. *
* * @param id * The ID of the target group. * @return Returns a reference to this object so that method calls can be chained together. */ public TargetGroupSummary withId(String id) { setId(id); 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 TargetGroupSummary 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 TargetGroupSummary withIpAddressType(IpAddressType ipAddressType) {
this.ipAddressType = ipAddressType.toString();
return this;
}
/**
* * The date and time that the target group was last updated, specified in ISO-8601 format. *
* * @param lastUpdatedAt * The date and time that the target group was last updated, specified in ISO-8601 format. */ public void setLastUpdatedAt(java.util.Date lastUpdatedAt) { this.lastUpdatedAt = lastUpdatedAt; } /** ** The date and time that the target group was last updated, specified in ISO-8601 format. *
* * @return The date and time that the target group was last updated, specified in ISO-8601 format. */ public java.util.Date getLastUpdatedAt() { return this.lastUpdatedAt; } /** ** The date and time that the target group was last updated, specified in ISO-8601 format. *
* * @param lastUpdatedAt * The date and time that the target group was last updated, specified in ISO-8601 format. * @return Returns a reference to this object so that method calls can be chained together. */ public TargetGroupSummary withLastUpdatedAt(java.util.Date lastUpdatedAt) { setLastUpdatedAt(lastUpdatedAt); return this; } /** ** The name of the target group. *
* * @param name * The name of the target group. */ public void setName(String name) { this.name = name; } /** ** The name of the target group. *
* * @return The name of the target group. */ public String getName() { return this.name; } /** ** The name of the target group. *
* * @param name * The name of the target group. * @return Returns a reference to this object so that method calls can be chained together. */ public TargetGroupSummary withName(String name) { setName(name); return this; } /** ** The port of the target group. *
* * @param port * The port of the target group. */ public void setPort(Integer port) { this.port = port; } /** ** The port of the target group. *
* * @return The port of the target group. */ public Integer getPort() { return this.port; } /** ** The port of the target group. *
* * @param port * The port of the target group. * @return Returns a reference to this object so that method calls can be chained together. */ public TargetGroupSummary withPort(Integer port) { setPort(port); return this; } /** ** The protocol of the target group. *
* * @param protocol * The protocol of the target group. * @see TargetGroupProtocol */ public void setProtocol(String protocol) { this.protocol = protocol; } /** ** The protocol of the target group. *
* * @return The protocol of the target group. * @see TargetGroupProtocol */ public String getProtocol() { return this.protocol; } /** ** The protocol of the target group. *
* * @param protocol * The protocol of the target group. * @return Returns a reference to this object so that method calls can be chained together. * @see TargetGroupProtocol */ public TargetGroupSummary withProtocol(String protocol) { setProtocol(protocol); return this; } /** ** The protocol of the target group. *
* * @param protocol * The protocol of the target group. * @return Returns a reference to this object so that method calls can be chained together. * @see TargetGroupProtocol */ public TargetGroupSummary withProtocol(TargetGroupProtocol protocol) { this.protocol = protocol.toString(); return this; } /** ** The list of Amazon Resource Names (ARNs) of the service. *
* * @return The list of Amazon Resource Names (ARNs) of the service. */ public java.util.List* The list of Amazon Resource Names (ARNs) of the service. *
* * @param serviceArns * The list of Amazon Resource Names (ARNs) of the service. */ public void setServiceArns(java.util.Collection* The list of Amazon Resource Names (ARNs) of the service. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setServiceArns(java.util.Collection)} or {@link #withServiceArns(java.util.Collection)} if you want to * override the existing values. *
* * @param serviceArns * The list of Amazon Resource Names (ARNs) of the service. * @return Returns a reference to this object so that method calls can be chained together. */ public TargetGroupSummary withServiceArns(String... serviceArns) { if (this.serviceArns == null) { setServiceArns(new java.util.ArrayList* The list of Amazon Resource Names (ARNs) of the service. *
* * @param serviceArns * The list of Amazon Resource Names (ARNs) of the service. * @return Returns a reference to this object so that method calls can be chained together. */ public TargetGroupSummary withServiceArns(java.util.Collection* The status. *
* * @param status * The status. * @see TargetGroupStatus */ public void setStatus(String status) { this.status = status; } /** ** The status. *
* * @return The status. * @see TargetGroupStatus */ public String getStatus() { return this.status; } /** ** The status. *
* * @param status * The status. * @return Returns a reference to this object so that method calls can be chained together. * @see TargetGroupStatus */ public TargetGroupSummary withStatus(String status) { setStatus(status); return this; } /** ** The status. *
* * @param status * The status. * @return Returns a reference to this object so that method calls can be chained together. * @see TargetGroupStatus */ public TargetGroupSummary withStatus(TargetGroupStatus status) { this.status = status.toString(); return this; } /** ** The target group type. *
* * @param type * The target group type. * @see TargetGroupType */ public void setType(String type) { this.type = type; } /** ** The target group type. *
* * @return The target group type. * @see TargetGroupType */ public String getType() { return this.type; } /** ** The target group type. *
* * @param type * The target group type. * @return Returns a reference to this object so that method calls can be chained together. * @see TargetGroupType */ public TargetGroupSummary withType(String type) { setType(type); return this; } /** ** The target group type. *
* * @param type * The target group type. * @return Returns a reference to this object so that method calls can be chained together. * @see TargetGroupType */ public TargetGroupSummary withType(TargetGroupType type) { this.type = type.toString(); return this; } /** ** The ID of the VPC of the target group. *
* * @param vpcIdentifier * The ID of the VPC of the target group. */ public void setVpcIdentifier(String vpcIdentifier) { this.vpcIdentifier = vpcIdentifier; } /** ** The ID of the VPC of the target group. *
* * @return The ID of the VPC of the target group. */ public String getVpcIdentifier() { return this.vpcIdentifier; } /** ** The ID of the VPC of the target group. *
* * @param vpcIdentifier * The ID of the VPC of the target group. * @return Returns a reference to this object so that method calls can be chained together. */ public TargetGroupSummary 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 (getArn() != null) sb.append("Arn: ").append(getArn()).append(","); if (getCreatedAt() != null) sb.append("CreatedAt: ").append(getCreatedAt()).append(","); if (getId() != null) sb.append("Id: ").append(getId()).append(","); if (getIpAddressType() != null) sb.append("IpAddressType: ").append(getIpAddressType()).append(","); if (getLastUpdatedAt() != null) sb.append("LastUpdatedAt: ").append(getLastUpdatedAt()).append(","); if (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getPort() != null) sb.append("Port: ").append(getPort()).append(","); if (getProtocol() != null) sb.append("Protocol: ").append(getProtocol()).append(","); if (getServiceArns() != null) sb.append("ServiceArns: ").append(getServiceArns()).append(","); if (getStatus() != null) sb.append("Status: ").append(getStatus()).append(","); if (getType() != null) sb.append("Type: ").append(getType()).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 TargetGroupSummary == false) return false; TargetGroupSummary other = (TargetGroupSummary) obj; if (other.getArn() == null ^ this.getArn() == null) return false; if (other.getArn() != null && other.getArn().equals(this.getArn()) == false) return false; if (other.getCreatedAt() == null ^ this.getCreatedAt() == null) return false; if (other.getCreatedAt() != null && other.getCreatedAt().equals(this.getCreatedAt()) == false) return false; if (other.getId() == null ^ this.getId() == null) return false; if (other.getId() != null && other.getId().equals(this.getId()) == 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.getLastUpdatedAt() == null ^ this.getLastUpdatedAt() == null) return false; if (other.getLastUpdatedAt() != null && other.getLastUpdatedAt().equals(this.getLastUpdatedAt()) == false) return false; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == 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.getServiceArns() == null ^ this.getServiceArns() == null) return false; if (other.getServiceArns() != null && other.getServiceArns().equals(this.getServiceArns()) == false) return false; if (other.getStatus() == null ^ this.getStatus() == null) return false; if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false) return false; if (other.getType() == null ^ this.getType() == null) return false; if (other.getType() != null && other.getType().equals(this.getType()) == 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 + ((getArn() == null) ? 0 : getArn().hashCode()); hashCode = prime * hashCode + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode()); hashCode = prime * hashCode + ((getId() == null) ? 0 : getId().hashCode()); hashCode = prime * hashCode + ((getIpAddressType() == null) ? 0 : getIpAddressType().hashCode()); hashCode = prime * hashCode + ((getLastUpdatedAt() == null) ? 0 : getLastUpdatedAt().hashCode()); hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getPort() == null) ? 0 : getPort().hashCode()); hashCode = prime * hashCode + ((getProtocol() == null) ? 0 : getProtocol().hashCode()); hashCode = prime * hashCode + ((getServiceArns() == null) ? 0 : getServiceArns().hashCode()); hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode()); hashCode = prime * hashCode + ((getVpcIdentifier() == null) ? 0 : getVpcIdentifier().hashCode()); return hashCode; } @Override public TargetGroupSummary clone() { try { return (TargetGroupSummary) 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.TargetGroupSummaryMarshaller.getInstance().marshall(this, protocolMarshaller); } }