com.amazonaws.services.fis.model.ExperimentTemplateAction Maven / Gradle / Ivy
Show all versions of aws-java-sdk-fis Show documentation
/*
* Copyright 2019-2024 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 an action for an experiment template.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ExperimentTemplateAction implements Serializable, Cloneable, StructuredPojo {
/**
*
* The ID of the action.
*
*/
private String actionId;
/**
*
* A 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 the current action starts.
*
*/
private java.util.List startAfter;
/**
*
* 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 ExperimentTemplateAction withActionId(String actionId) {
setActionId(actionId);
return this;
}
/**
*
* A description for the action.
*
*
* @param description
* A description for the action.
*/
public void setDescription(String description) {
this.description = description;
}
/**
*
* A description for the action.
*
*
* @return A description for the action.
*/
public String getDescription() {
return this.description;
}
/**
*
* A description for the action.
*
*
* @param description
* A description for the action.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ExperimentTemplateAction 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 ExperimentTemplateAction withParameters(java.util.Map parameters) {
setParameters(parameters);
return this;
}
/**
* Add a single Parameters entry
*
* @see ExperimentTemplateAction#withParameters
* @returns a reference to this object so that method calls can be chained together.
*/
public ExperimentTemplateAction 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 ExperimentTemplateAction 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 ExperimentTemplateAction withTargets(java.util.Map targets) {
setTargets(targets);
return this;
}
/**
* Add a single Targets entry
*
* @see ExperimentTemplateAction#withTargets
* @returns a reference to this object so that method calls can be chained together.
*/
public ExperimentTemplateAction 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 ExperimentTemplateAction clearTargetsEntries() {
this.targets = null;
return this;
}
/**
*
* The name of the action that must be completed before the current action starts.
*
*
* @return The name of the action that must be completed before the current action starts.
*/
public java.util.List getStartAfter() {
return startAfter;
}
/**
*
* The name of the action that must be completed before the current action starts.
*
*
* @param startAfter
* The name of the action that must be completed before the current 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 the current 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 the current action starts.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ExperimentTemplateAction 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 the current action starts.
*
*
* @param startAfter
* The name of the action that must be completed before the current action starts.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ExperimentTemplateAction withStartAfter(java.util.Collection startAfter) {
setStartAfter(startAfter);
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());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ExperimentTemplateAction == false)
return false;
ExperimentTemplateAction other = (ExperimentTemplateAction) 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;
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());
return hashCode;
}
@Override
public ExperimentTemplateAction clone() {
try {
return (ExperimentTemplateAction) 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.ExperimentTemplateActionMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}