/* * 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.guardduty.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Contains information about the task in an ECS cluster. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class EcsTaskDetails implements Serializable, Cloneable, StructuredPojo { /** ** The Amazon Resource Name (ARN) of the task. *
*/ private String arn; /** ** The ARN of the task definition that creates the task. *
*/ private String definitionArn; /** ** The version counter for the task. *
*/ private String version; /** ** The Unix timestamp for the time when the task was created. *
*/ private java.util.Date taskCreatedAt; /** ** The Unix timestamp for the time when the task started. *
*/ private java.util.Date startedAt; /** ** Contains the tag specified when a task is started. *
*/ private String startedBy; /** ** The tags of the ECS Task. *
*/ private java.util.List* The list of data volume definitions for the task. *
*/ private java.util.List* The containers that's associated with the task. *
*/ private java.util.List* The name of the task group that's associated with the task. *
*/ private String group; /** ** The Amazon Resource Name (ARN) of the task. *
* * @param arn * The Amazon Resource Name (ARN) of the task. */ public void setArn(String arn) { this.arn = arn; } /** ** The Amazon Resource Name (ARN) of the task. *
* * @return The Amazon Resource Name (ARN) of the task. */ public String getArn() { return this.arn; } /** ** The Amazon Resource Name (ARN) of the task. *
* * @param arn * The Amazon Resource Name (ARN) of the task. * @return Returns a reference to this object so that method calls can be chained together. */ public EcsTaskDetails withArn(String arn) { setArn(arn); return this; } /** ** The ARN of the task definition that creates the task. *
* * @param definitionArn * The ARN of the task definition that creates the task. */ public void setDefinitionArn(String definitionArn) { this.definitionArn = definitionArn; } /** ** The ARN of the task definition that creates the task. *
* * @return The ARN of the task definition that creates the task. */ public String getDefinitionArn() { return this.definitionArn; } /** ** The ARN of the task definition that creates the task. *
* * @param definitionArn * The ARN of the task definition that creates the task. * @return Returns a reference to this object so that method calls can be chained together. */ public EcsTaskDetails withDefinitionArn(String definitionArn) { setDefinitionArn(definitionArn); return this; } /** ** The version counter for the task. *
* * @param version * The version counter for the task. */ public void setVersion(String version) { this.version = version; } /** ** The version counter for the task. *
* * @return The version counter for the task. */ public String getVersion() { return this.version; } /** ** The version counter for the task. *
* * @param version * The version counter for the task. * @return Returns a reference to this object so that method calls can be chained together. */ public EcsTaskDetails withVersion(String version) { setVersion(version); return this; } /** ** The Unix timestamp for the time when the task was created. *
* * @param taskCreatedAt * The Unix timestamp for the time when the task was created. */ public void setTaskCreatedAt(java.util.Date taskCreatedAt) { this.taskCreatedAt = taskCreatedAt; } /** ** The Unix timestamp for the time when the task was created. *
* * @return The Unix timestamp for the time when the task was created. */ public java.util.Date getTaskCreatedAt() { return this.taskCreatedAt; } /** ** The Unix timestamp for the time when the task was created. *
* * @param taskCreatedAt * The Unix timestamp for the time when the task was created. * @return Returns a reference to this object so that method calls can be chained together. */ public EcsTaskDetails withTaskCreatedAt(java.util.Date taskCreatedAt) { setTaskCreatedAt(taskCreatedAt); return this; } /** ** The Unix timestamp for the time when the task started. *
* * @param startedAt * The Unix timestamp for the time when the task started. */ public void setStartedAt(java.util.Date startedAt) { this.startedAt = startedAt; } /** ** The Unix timestamp for the time when the task started. *
* * @return The Unix timestamp for the time when the task started. */ public java.util.Date getStartedAt() { return this.startedAt; } /** ** The Unix timestamp for the time when the task started. *
* * @param startedAt * The Unix timestamp for the time when the task started. * @return Returns a reference to this object so that method calls can be chained together. */ public EcsTaskDetails withStartedAt(java.util.Date startedAt) { setStartedAt(startedAt); return this; } /** ** Contains the tag specified when a task is started. *
* * @param startedBy * Contains the tag specified when a task is started. */ public void setStartedBy(String startedBy) { this.startedBy = startedBy; } /** ** Contains the tag specified when a task is started. *
* * @return Contains the tag specified when a task is started. */ public String getStartedBy() { return this.startedBy; } /** ** Contains the tag specified when a task is started. *
* * @param startedBy * Contains the tag specified when a task is started. * @return Returns a reference to this object so that method calls can be chained together. */ public EcsTaskDetails withStartedBy(String startedBy) { setStartedBy(startedBy); return this; } /** ** The tags of the ECS Task. *
* * @return The tags of the ECS Task. */ public java.util.List* The tags of the ECS Task. *
* * @param tags * The tags of the ECS Task. */ public void setTags(java.util.Collection* The tags of the ECS Task. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the * existing values. *
* * @param tags * The tags of the ECS Task. * @return Returns a reference to this object so that method calls can be chained together. */ public EcsTaskDetails withTags(Tag... tags) { if (this.tags == null) { setTags(new java.util.ArrayList* The tags of the ECS Task. *
* * @param tags * The tags of the ECS Task. * @return Returns a reference to this object so that method calls can be chained together. */ public EcsTaskDetails withTags(java.util.Collection* The list of data volume definitions for the task. *
* * @return The list of data volume definitions for the task. */ public java.util.List* The list of data volume definitions for the task. *
* * @param volumes * The list of data volume definitions for the task. */ public void setVolumes(java.util.Collection* The list of data volume definitions for the task. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setVolumes(java.util.Collection)} or {@link #withVolumes(java.util.Collection)} if you want to override * the existing values. *
* * @param volumes * The list of data volume definitions for the task. * @return Returns a reference to this object so that method calls can be chained together. */ public EcsTaskDetails withVolumes(Volume... volumes) { if (this.volumes == null) { setVolumes(new java.util.ArrayList* The list of data volume definitions for the task. *
* * @param volumes * The list of data volume definitions for the task. * @return Returns a reference to this object so that method calls can be chained together. */ public EcsTaskDetails withVolumes(java.util.Collection* The containers that's associated with the task. *
* * @return The containers that's associated with the task. */ public java.util.List* The containers that's associated with the task. *
* * @param containers * The containers that's associated with the task. */ public void setContainers(java.util.Collection* The containers that's associated with the task. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setContainers(java.util.Collection)} or {@link #withContainers(java.util.Collection)} if you want to * override the existing values. *
* * @param containers * The containers that's associated with the task. * @return Returns a reference to this object so that method calls can be chained together. */ public EcsTaskDetails withContainers(Container... containers) { if (this.containers == null) { setContainers(new java.util.ArrayList* The containers that's associated with the task. *
* * @param containers * The containers that's associated with the task. * @return Returns a reference to this object so that method calls can be chained together. */ public EcsTaskDetails withContainers(java.util.Collection* The name of the task group that's associated with the task. *
* * @param group * The name of the task group that's associated with the task. */ public void setGroup(String group) { this.group = group; } /** ** The name of the task group that's associated with the task. *
* * @return The name of the task group that's associated with the task. */ public String getGroup() { return this.group; } /** ** The name of the task group that's associated with the task. *
* * @param group * The name of the task group that's associated with the task. * @return Returns a reference to this object so that method calls can be chained together. */ public EcsTaskDetails withGroup(String group) { setGroup(group); 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 (getDefinitionArn() != null) sb.append("DefinitionArn: ").append(getDefinitionArn()).append(","); if (getVersion() != null) sb.append("Version: ").append(getVersion()).append(","); if (getTaskCreatedAt() != null) sb.append("TaskCreatedAt: ").append(getTaskCreatedAt()).append(","); if (getStartedAt() != null) sb.append("StartedAt: ").append(getStartedAt()).append(","); if (getStartedBy() != null) sb.append("StartedBy: ").append(getStartedBy()).append(","); if (getTags() != null) sb.append("Tags: ").append(getTags()).append(","); if (getVolumes() != null) sb.append("Volumes: ").append(getVolumes()).append(","); if (getContainers() != null) sb.append("Containers: ").append(getContainers()).append(","); if (getGroup() != null) sb.append("Group: ").append(getGroup()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof EcsTaskDetails == false) return false; EcsTaskDetails other = (EcsTaskDetails) obj; if (other.getArn() == null ^ this.getArn() == null) return false; if (other.getArn() != null && other.getArn().equals(this.getArn()) == false) return false; if (other.getDefinitionArn() == null ^ this.getDefinitionArn() == null) return false; if (other.getDefinitionArn() != null && other.getDefinitionArn().equals(this.getDefinitionArn()) == false) return false; if (other.getVersion() == null ^ this.getVersion() == null) return false; if (other.getVersion() != null && other.getVersion().equals(this.getVersion()) == false) return false; if (other.getTaskCreatedAt() == null ^ this.getTaskCreatedAt() == null) return false; if (other.getTaskCreatedAt() != null && other.getTaskCreatedAt().equals(this.getTaskCreatedAt()) == false) return false; if (other.getStartedAt() == null ^ this.getStartedAt() == null) return false; if (other.getStartedAt() != null && other.getStartedAt().equals(this.getStartedAt()) == false) return false; if (other.getStartedBy() == null ^ this.getStartedBy() == null) return false; if (other.getStartedBy() != null && other.getStartedBy().equals(this.getStartedBy()) == false) return false; if (other.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; if (other.getVolumes() == null ^ this.getVolumes() == null) return false; if (other.getVolumes() != null && other.getVolumes().equals(this.getVolumes()) == false) return false; if (other.getContainers() == null ^ this.getContainers() == null) return false; if (other.getContainers() != null && other.getContainers().equals(this.getContainers()) == false) return false; if (other.getGroup() == null ^ this.getGroup() == null) return false; if (other.getGroup() != null && other.getGroup().equals(this.getGroup()) == 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 + ((getDefinitionArn() == null) ? 0 : getDefinitionArn().hashCode()); hashCode = prime * hashCode + ((getVersion() == null) ? 0 : getVersion().hashCode()); hashCode = prime * hashCode + ((getTaskCreatedAt() == null) ? 0 : getTaskCreatedAt().hashCode()); hashCode = prime * hashCode + ((getStartedAt() == null) ? 0 : getStartedAt().hashCode()); hashCode = prime * hashCode + ((getStartedBy() == null) ? 0 : getStartedBy().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); hashCode = prime * hashCode + ((getVolumes() == null) ? 0 : getVolumes().hashCode()); hashCode = prime * hashCode + ((getContainers() == null) ? 0 : getContainers().hashCode()); hashCode = prime * hashCode + ((getGroup() == null) ? 0 : getGroup().hashCode()); return hashCode; } @Override public EcsTaskDetails clone() { try { return (EcsTaskDetails) 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.guardduty.model.transform.EcsTaskDetailsMarshaller.getInstance().marshall(this, protocolMarshaller); } }