/* * 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.config.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Name of the step from the SSM document. *
* * @see AWS * API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class RemediationExecutionStep implements Serializable, Cloneable, StructuredPojo { /** ** The details of the step. *
*/ private String name; /** ** The valid status of the step. *
*/ private String state; /** ** An error message if the step was interrupted during execution. *
*/ private String errorMessage; /** ** The time when the step started. *
*/ private java.util.Date startTime; /** ** The time when the step stopped. *
*/ private java.util.Date stopTime; /** ** The details of the step. *
* * @param name * The details of the step. */ public void setName(String name) { this.name = name; } /** ** The details of the step. *
* * @return The details of the step. */ public String getName() { return this.name; } /** ** The details of the step. *
* * @param name * The details of the step. * @return Returns a reference to this object so that method calls can be chained together. */ public RemediationExecutionStep withName(String name) { setName(name); return this; } /** ** The valid status of the step. *
* * @param state * The valid status of the step. * @see RemediationExecutionStepState */ public void setState(String state) { this.state = state; } /** ** The valid status of the step. *
* * @return The valid status of the step. * @see RemediationExecutionStepState */ public String getState() { return this.state; } /** ** The valid status of the step. *
* * @param state * The valid status of the step. * @return Returns a reference to this object so that method calls can be chained together. * @see RemediationExecutionStepState */ public RemediationExecutionStep withState(String state) { setState(state); return this; } /** ** The valid status of the step. *
* * @param state * The valid status of the step. * @return Returns a reference to this object so that method calls can be chained together. * @see RemediationExecutionStepState */ public RemediationExecutionStep withState(RemediationExecutionStepState state) { this.state = state.toString(); return this; } /** ** An error message if the step was interrupted during execution. *
* * @param errorMessage * An error message if the step was interrupted during execution. */ public void setErrorMessage(String errorMessage) { this.errorMessage = errorMessage; } /** ** An error message if the step was interrupted during execution. *
* * @return An error message if the step was interrupted during execution. */ public String getErrorMessage() { return this.errorMessage; } /** ** An error message if the step was interrupted during execution. *
* * @param errorMessage * An error message if the step was interrupted during execution. * @return Returns a reference to this object so that method calls can be chained together. */ public RemediationExecutionStep withErrorMessage(String errorMessage) { setErrorMessage(errorMessage); return this; } /** ** The time when the step started. *
* * @param startTime * The time when the step started. */ public void setStartTime(java.util.Date startTime) { this.startTime = startTime; } /** ** The time when the step started. *
* * @return The time when the step started. */ public java.util.Date getStartTime() { return this.startTime; } /** ** The time when the step started. *
* * @param startTime * The time when the step started. * @return Returns a reference to this object so that method calls can be chained together. */ public RemediationExecutionStep withStartTime(java.util.Date startTime) { setStartTime(startTime); return this; } /** ** The time when the step stopped. *
* * @param stopTime * The time when the step stopped. */ public void setStopTime(java.util.Date stopTime) { this.stopTime = stopTime; } /** ** The time when the step stopped. *
* * @return The time when the step stopped. */ public java.util.Date getStopTime() { return this.stopTime; } /** ** The time when the step stopped. *
* * @param stopTime * The time when the step stopped. * @return Returns a reference to this object so that method calls can be chained together. */ public RemediationExecutionStep withStopTime(java.util.Date stopTime) { setStopTime(stopTime); 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 (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getState() != null) sb.append("State: ").append(getState()).append(","); if (getErrorMessage() != null) sb.append("ErrorMessage: ").append(getErrorMessage()).append(","); if (getStartTime() != null) sb.append("StartTime: ").append(getStartTime()).append(","); if (getStopTime() != null) sb.append("StopTime: ").append(getStopTime()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof RemediationExecutionStep == false) return false; RemediationExecutionStep other = (RemediationExecutionStep) obj; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getState() == null ^ this.getState() == null) return false; if (other.getState() != null && other.getState().equals(this.getState()) == false) return false; if (other.getErrorMessage() == null ^ this.getErrorMessage() == null) return false; if (other.getErrorMessage() != null && other.getErrorMessage().equals(this.getErrorMessage()) == false) return false; if (other.getStartTime() == null ^ this.getStartTime() == null) return false; if (other.getStartTime() != null && other.getStartTime().equals(this.getStartTime()) == false) return false; if (other.getStopTime() == null ^ this.getStopTime() == null) return false; if (other.getStopTime() != null && other.getStopTime().equals(this.getStopTime()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode()); hashCode = prime * hashCode + ((getErrorMessage() == null) ? 0 : getErrorMessage().hashCode()); hashCode = prime * hashCode + ((getStartTime() == null) ? 0 : getStartTime().hashCode()); hashCode = prime * hashCode + ((getStopTime() == null) ? 0 : getStopTime().hashCode()); return hashCode; } @Override public RemediationExecutionStep clone() { try { return (RemediationExecutionStep) 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.config.model.transform.RemediationExecutionStepMarshaller.getInstance().marshall(this, protocolMarshaller); } }