/* * 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.batch.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* An object that represents a job attempt. *

* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AttemptDetail implements Serializable, Cloneable, StructuredPojo { /** *

* The details for the container in this job attempt. *

*/ private AttemptContainerDetail container; /** *

* The Unix timestamp (in milliseconds) for when the attempt was started (when the attempt transitioned from the * STARTING state to the RUNNING state). *

*/ private Long startedAt; /** *

* The Unix timestamp (in milliseconds) for when the attempt was stopped (when the attempt transitioned from the * RUNNING state to a terminal state, such as SUCCEEDED or FAILED). *

*/ private Long stoppedAt; /** *

* A short, human-readable string to provide additional details for the current status of the job attempt. *

*/ private String statusReason; /** *

* The details for the container in this job attempt. *

* * @param container * The details for the container in this job attempt. */ public void setContainer(AttemptContainerDetail container) { this.container = container; } /** *

* The details for the container in this job attempt. *

* * @return The details for the container in this job attempt. */ public AttemptContainerDetail getContainer() { return this.container; } /** *

* The details for the container in this job attempt. *

* * @param container * The details for the container in this job attempt. * @return Returns a reference to this object so that method calls can be chained together. */ public AttemptDetail withContainer(AttemptContainerDetail container) { setContainer(container); return this; } /** *

* The Unix timestamp (in milliseconds) for when the attempt was started (when the attempt transitioned from the * STARTING state to the RUNNING state). *

* * @param startedAt * The Unix timestamp (in milliseconds) for when the attempt was started (when the attempt transitioned from * the STARTING state to the RUNNING state). */ public void setStartedAt(Long startedAt) { this.startedAt = startedAt; } /** *

* The Unix timestamp (in milliseconds) for when the attempt was started (when the attempt transitioned from the * STARTING state to the RUNNING state). *

* * @return The Unix timestamp (in milliseconds) for when the attempt was started (when the attempt transitioned from * the STARTING state to the RUNNING state). */ public Long getStartedAt() { return this.startedAt; } /** *

* The Unix timestamp (in milliseconds) for when the attempt was started (when the attempt transitioned from the * STARTING state to the RUNNING state). *

* * @param startedAt * The Unix timestamp (in milliseconds) for when the attempt was started (when the attempt transitioned from * the STARTING state to the RUNNING state). * @return Returns a reference to this object so that method calls can be chained together. */ public AttemptDetail withStartedAt(Long startedAt) { setStartedAt(startedAt); return this; } /** *

* The Unix timestamp (in milliseconds) for when the attempt was stopped (when the attempt transitioned from the * RUNNING state to a terminal state, such as SUCCEEDED or FAILED). *

* * @param stoppedAt * The Unix timestamp (in milliseconds) for when the attempt was stopped (when the attempt transitioned from * the RUNNING state to a terminal state, such as SUCCEEDED or FAILED * ). */ public void setStoppedAt(Long stoppedAt) { this.stoppedAt = stoppedAt; } /** *

* The Unix timestamp (in milliseconds) for when the attempt was stopped (when the attempt transitioned from the * RUNNING state to a terminal state, such as SUCCEEDED or FAILED). *

* * @return The Unix timestamp (in milliseconds) for when the attempt was stopped (when the attempt transitioned from * the RUNNING state to a terminal state, such as SUCCEEDED or FAILED * ). */ public Long getStoppedAt() { return this.stoppedAt; } /** *

* The Unix timestamp (in milliseconds) for when the attempt was stopped (when the attempt transitioned from the * RUNNING state to a terminal state, such as SUCCEEDED or FAILED). *

* * @param stoppedAt * The Unix timestamp (in milliseconds) for when the attempt was stopped (when the attempt transitioned from * the RUNNING state to a terminal state, such as SUCCEEDED or FAILED * ). * @return Returns a reference to this object so that method calls can be chained together. */ public AttemptDetail withStoppedAt(Long stoppedAt) { setStoppedAt(stoppedAt); return this; } /** *

* A short, human-readable string to provide additional details for the current status of the job attempt. *

* * @param statusReason * A short, human-readable string to provide additional details for the current status of the job attempt. */ public void setStatusReason(String statusReason) { this.statusReason = statusReason; } /** *

* A short, human-readable string to provide additional details for the current status of the job attempt. *

* * @return A short, human-readable string to provide additional details for the current status of the job attempt. */ public String getStatusReason() { return this.statusReason; } /** *

* A short, human-readable string to provide additional details for the current status of the job attempt. *

* * @param statusReason * A short, human-readable string to provide additional details for the current status of the job attempt. * @return Returns a reference to this object so that method calls can be chained together. */ public AttemptDetail withStatusReason(String statusReason) { setStatusReason(statusReason); 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 (getContainer() != null) sb.append("Container: ").append(getContainer()).append(","); if (getStartedAt() != null) sb.append("StartedAt: ").append(getStartedAt()).append(","); if (getStoppedAt() != null) sb.append("StoppedAt: ").append(getStoppedAt()).append(","); if (getStatusReason() != null) sb.append("StatusReason: ").append(getStatusReason()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AttemptDetail == false) return false; AttemptDetail other = (AttemptDetail) obj; if (other.getContainer() == null ^ this.getContainer() == null) return false; if (other.getContainer() != null && other.getContainer().equals(this.getContainer()) == 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.getStoppedAt() == null ^ this.getStoppedAt() == null) return false; if (other.getStoppedAt() != null && other.getStoppedAt().equals(this.getStoppedAt()) == false) return false; if (other.getStatusReason() == null ^ this.getStatusReason() == null) return false; if (other.getStatusReason() != null && other.getStatusReason().equals(this.getStatusReason()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getContainer() == null) ? 0 : getContainer().hashCode()); hashCode = prime * hashCode + ((getStartedAt() == null) ? 0 : getStartedAt().hashCode()); hashCode = prime * hashCode + ((getStoppedAt() == null) ? 0 : getStoppedAt().hashCode()); hashCode = prime * hashCode + ((getStatusReason() == null) ? 0 : getStatusReason().hashCode()); return hashCode; } @Override public AttemptDetail clone() { try { return (AttemptDetail) 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.batch.model.transform.AttemptDetailMarshaller.getInstance().marshall(this, protocolMarshaller); } }