
com.amazonaws.services.simpleworkflow.model.RespondDecisionTaskCompletedRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-simpleworkflow Show documentation
/*
* Copyright 2010-2016 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.simpleworkflow.model;
import java.io.Serializable;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
*/
public class RespondDecisionTaskCompletedRequest extends
AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The taskToken
from the DecisionTask.
*
* taskToken
is generated by the service and should
* be treated as an opaque value. If the task is passed to another process,
* its taskToken
must also be passed. This enables it to
* provide its progress and respond with results.
*/
private String taskToken;
/**
*
* The list of decisions (possibly empty) made by the decider while
* processing this decision task. See the docs for the decision structure
* for details.
*
*/
private java.util.List decisions;
/**
*
* User defined context to add to workflow execution.
*
*/
private String executionContext;
/**
*
* The taskToken
from the DecisionTask.
*
* taskToken
is generated by the service and should
* be treated as an opaque value. If the task is passed to another process,
* its taskToken
must also be passed. This enables it to
* provide its progress and respond with results.
*
* @param taskToken
* The taskToken
from the DecisionTask.
* taskToken
is generated by the service and
* should be treated as an opaque value. If the task is passed to
* another process, its taskToken
must also be passed.
* This enables it to provide its progress and respond with results.
*/
public void setTaskToken(String taskToken) {
this.taskToken = taskToken;
}
/**
*
* The taskToken
from the DecisionTask.
*
* taskToken
is generated by the service and should
* be treated as an opaque value. If the task is passed to another process,
* its taskToken
must also be passed. This enables it to
* provide its progress and respond with results.
*
* @return The taskToken
from the DecisionTask.
* taskToken
is generated by the service and
* should be treated as an opaque value. If the task is passed to
* another process, its taskToken
must also be passed.
* This enables it to provide its progress and respond with results.
*/
public String getTaskToken() {
return this.taskToken;
}
/**
*
* The taskToken
from the DecisionTask.
*
* taskToken
is generated by the service and should
* be treated as an opaque value. If the task is passed to another process,
* its taskToken
must also be passed. This enables it to
* provide its progress and respond with results.
*
* @param taskToken
* The taskToken
from the DecisionTask.
* taskToken
is generated by the service and
* should be treated as an opaque value. If the task is passed to
* another process, its taskToken
must also be passed.
* This enables it to provide its progress and respond with results.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public RespondDecisionTaskCompletedRequest withTaskToken(String taskToken) {
setTaskToken(taskToken);
return this;
}
/**
*
* The list of decisions (possibly empty) made by the decider while
* processing this decision task. See the docs for the decision structure
* for details.
*
*
* @return The list of decisions (possibly empty) made by the decider while
* processing this decision task. See the docs for the decision
* structure for details.
*/
public java.util.List getDecisions() {
return decisions;
}
/**
*
* The list of decisions (possibly empty) made by the decider while
* processing this decision task. See the docs for the decision structure
* for details.
*
*
* @param decisions
* The list of decisions (possibly empty) made by the decider while
* processing this decision task. See the docs for the decision
* structure for details.
*/
public void setDecisions(java.util.Collection decisions) {
if (decisions == null) {
this.decisions = null;
return;
}
this.decisions = new java.util.ArrayList(decisions);
}
/**
*
* The list of decisions (possibly empty) made by the decider while
* processing this decision task. See the docs for the decision structure
* for details.
*
*
* NOTE: This method appends the values to the existing list (if
* any). Use {@link #setDecisions(java.util.Collection)} or
* {@link #withDecisions(java.util.Collection)} if you want to override the
* existing values.
*
*
* @param decisions
* The list of decisions (possibly empty) made by the decider while
* processing this decision task. See the docs for the decision
* structure for details.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public RespondDecisionTaskCompletedRequest withDecisions(
Decision... decisions) {
if (this.decisions == null) {
setDecisions(new java.util.ArrayList(decisions.length));
}
for (Decision ele : decisions) {
this.decisions.add(ele);
}
return this;
}
/**
*
* The list of decisions (possibly empty) made by the decider while
* processing this decision task. See the docs for the decision structure
* for details.
*
*
* @param decisions
* The list of decisions (possibly empty) made by the decider while
* processing this decision task. See the docs for the decision
* structure for details.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public RespondDecisionTaskCompletedRequest withDecisions(
java.util.Collection decisions) {
setDecisions(decisions);
return this;
}
/**
*
* User defined context to add to workflow execution.
*
*
* @param executionContext
* User defined context to add to workflow execution.
*/
public void setExecutionContext(String executionContext) {
this.executionContext = executionContext;
}
/**
*
* User defined context to add to workflow execution.
*
*
* @return User defined context to add to workflow execution.
*/
public String getExecutionContext() {
return this.executionContext;
}
/**
*
* User defined context to add to workflow execution.
*
*
* @param executionContext
* User defined context to add to workflow execution.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public RespondDecisionTaskCompletedRequest withExecutionContext(
String executionContext) {
setExecutionContext(executionContext);
return this;
}
/**
* Returns a string representation of this object; useful for testing and
* debugging.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getTaskToken() != null)
sb.append("TaskToken: " + getTaskToken() + ",");
if (getDecisions() != null)
sb.append("Decisions: " + getDecisions() + ",");
if (getExecutionContext() != null)
sb.append("ExecutionContext: " + getExecutionContext());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof RespondDecisionTaskCompletedRequest == false)
return false;
RespondDecisionTaskCompletedRequest other = (RespondDecisionTaskCompletedRequest) obj;
if (other.getTaskToken() == null ^ this.getTaskToken() == null)
return false;
if (other.getTaskToken() != null
&& other.getTaskToken().equals(this.getTaskToken()) == false)
return false;
if (other.getDecisions() == null ^ this.getDecisions() == null)
return false;
if (other.getDecisions() != null
&& other.getDecisions().equals(this.getDecisions()) == false)
return false;
if (other.getExecutionContext() == null
^ this.getExecutionContext() == null)
return false;
if (other.getExecutionContext() != null
&& other.getExecutionContext().equals(
this.getExecutionContext()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode
+ ((getTaskToken() == null) ? 0 : getTaskToken().hashCode());
hashCode = prime * hashCode
+ ((getDecisions() == null) ? 0 : getDecisions().hashCode());
hashCode = prime
* hashCode
+ ((getExecutionContext() == null) ? 0 : getExecutionContext()
.hashCode());
return hashCode;
}
@Override
public RespondDecisionTaskCompletedRequest clone() {
return (RespondDecisionTaskCompletedRequest) super.clone();
}
}