All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazonaws.services.fis.model.ExperimentAction Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS Fault Injection Simulator module holds the client classes that are used for communicating with AWS Fault Injection Simulator Service

There is a newer version: 1.12.772
Show newest version
/*
 * Copyright 2016-2021 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.fis.model;

import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;

/**
 * 

* Describes the action for an experiment. *

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

* The ID of the action. *

*/ private String actionId; /** *

* The description for the action. *

*/ private String description; /** *

* The parameters for the action. *

*/ private java.util.Map parameters; /** *

* The targets for the action. *

*/ private java.util.Map targets; /** *

* The name of the action that must be completed before this action starts. *

*/ private java.util.List startAfter; /** *

* The state of the action. *

*/ private ExperimentActionState state; /** *

* The ID of the action. *

* * @param actionId * The ID of the action. */ public void setActionId(String actionId) { this.actionId = actionId; } /** *

* The ID of the action. *

* * @return The ID of the action. */ public String getActionId() { return this.actionId; } /** *

* The ID of the action. *

* * @param actionId * The ID of the action. * @return Returns a reference to this object so that method calls can be chained together. */ public ExperimentAction withActionId(String actionId) { setActionId(actionId); return this; } /** *

* The description for the action. *

* * @param description * The description for the action. */ public void setDescription(String description) { this.description = description; } /** *

* The description for the action. *

* * @return The description for the action. */ public String getDescription() { return this.description; } /** *

* The description for the action. *

* * @param description * The description for the action. * @return Returns a reference to this object so that method calls can be chained together. */ public ExperimentAction withDescription(String description) { setDescription(description); return this; } /** *

* The parameters for the action. *

* * @return The parameters for the action. */ public java.util.Map getParameters() { return parameters; } /** *

* The parameters for the action. *

* * @param parameters * The parameters for the action. */ public void setParameters(java.util.Map parameters) { this.parameters = parameters; } /** *

* The parameters for the action. *

* * @param parameters * The parameters for the action. * @return Returns a reference to this object so that method calls can be chained together. */ public ExperimentAction withParameters(java.util.Map parameters) { setParameters(parameters); return this; } /** * Add a single Parameters entry * * @see ExperimentAction#withParameters * @returns a reference to this object so that method calls can be chained together. */ public ExperimentAction addParametersEntry(String key, String value) { if (null == this.parameters) { this.parameters = new java.util.HashMap(); } if (this.parameters.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.parameters.put(key, value); return this; } /** * Removes all the entries added into Parameters. * * @return Returns a reference to this object so that method calls can be chained together. */ public ExperimentAction clearParametersEntries() { this.parameters = null; return this; } /** *

* The targets for the action. *

* * @return The targets for the action. */ public java.util.Map getTargets() { return targets; } /** *

* The targets for the action. *

* * @param targets * The targets for the action. */ public void setTargets(java.util.Map targets) { this.targets = targets; } /** *

* The targets for the action. *

* * @param targets * The targets for the action. * @return Returns a reference to this object so that method calls can be chained together. */ public ExperimentAction withTargets(java.util.Map targets) { setTargets(targets); return this; } /** * Add a single Targets entry * * @see ExperimentAction#withTargets * @returns a reference to this object so that method calls can be chained together. */ public ExperimentAction addTargetsEntry(String key, String value) { if (null == this.targets) { this.targets = new java.util.HashMap(); } if (this.targets.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.targets.put(key, value); return this; } /** * Removes all the entries added into Targets. * * @return Returns a reference to this object so that method calls can be chained together. */ public ExperimentAction clearTargetsEntries() { this.targets = null; return this; } /** *

* The name of the action that must be completed before this action starts. *

* * @return The name of the action that must be completed before this action starts. */ public java.util.List getStartAfter() { return startAfter; } /** *

* The name of the action that must be completed before this action starts. *

* * @param startAfter * The name of the action that must be completed before this action starts. */ public void setStartAfter(java.util.Collection startAfter) { if (startAfter == null) { this.startAfter = null; return; } this.startAfter = new java.util.ArrayList(startAfter); } /** *

* The name of the action that must be completed before this action starts. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setStartAfter(java.util.Collection)} or {@link #withStartAfter(java.util.Collection)} if you want to * override the existing values. *

* * @param startAfter * The name of the action that must be completed before this action starts. * @return Returns a reference to this object so that method calls can be chained together. */ public ExperimentAction withStartAfter(String... startAfter) { if (this.startAfter == null) { setStartAfter(new java.util.ArrayList(startAfter.length)); } for (String ele : startAfter) { this.startAfter.add(ele); } return this; } /** *

* The name of the action that must be completed before this action starts. *

* * @param startAfter * The name of the action that must be completed before this action starts. * @return Returns a reference to this object so that method calls can be chained together. */ public ExperimentAction withStartAfter(java.util.Collection startAfter) { setStartAfter(startAfter); return this; } /** *

* The state of the action. *

* * @param state * The state of the action. */ public void setState(ExperimentActionState state) { this.state = state; } /** *

* The state of the action. *

* * @return The state of the action. */ public ExperimentActionState getState() { return this.state; } /** *

* The state of the action. *

* * @param state * The state of the action. * @return Returns a reference to this object so that method calls can be chained together. */ public ExperimentAction withState(ExperimentActionState state) { setState(state); 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 (getActionId() != null) sb.append("ActionId: ").append(getActionId()).append(","); if (getDescription() != null) sb.append("Description: ").append(getDescription()).append(","); if (getParameters() != null) sb.append("Parameters: ").append(getParameters()).append(","); if (getTargets() != null) sb.append("Targets: ").append(getTargets()).append(","); if (getStartAfter() != null) sb.append("StartAfter: ").append(getStartAfter()).append(","); if (getState() != null) sb.append("State: ").append(getState()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ExperimentAction == false) return false; ExperimentAction other = (ExperimentAction) obj; if (other.getActionId() == null ^ this.getActionId() == null) return false; if (other.getActionId() != null && other.getActionId().equals(this.getActionId()) == false) return false; if (other.getDescription() == null ^ this.getDescription() == null) return false; if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false) return false; if (other.getParameters() == null ^ this.getParameters() == null) return false; if (other.getParameters() != null && other.getParameters().equals(this.getParameters()) == false) return false; if (other.getTargets() == null ^ this.getTargets() == null) return false; if (other.getTargets() != null && other.getTargets().equals(this.getTargets()) == false) return false; if (other.getStartAfter() == null ^ this.getStartAfter() == null) return false; if (other.getStartAfter() != null && other.getStartAfter().equals(this.getStartAfter()) == false) return false; if (other.getState() == null ^ this.getState() == null) return false; if (other.getState() != null && other.getState().equals(this.getState()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getActionId() == null) ? 0 : getActionId().hashCode()); hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getParameters() == null) ? 0 : getParameters().hashCode()); hashCode = prime * hashCode + ((getTargets() == null) ? 0 : getTargets().hashCode()); hashCode = prime * hashCode + ((getStartAfter() == null) ? 0 : getStartAfter().hashCode()); hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode()); return hashCode; } @Override public ExperimentAction clone() { try { return (ExperimentAction) 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.fis.model.transform.ExperimentActionMarshaller.getInstance().marshall(this, protocolMarshaller); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy