
software.amazon.awssdk.services.swf.model.DecisionTaskScheduledEventAttributes Maven / Gradle / Ivy
/*
* Copyright 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 software.amazon.awssdk.services.swf.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Provides details about the DecisionTaskScheduled
event.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class DecisionTaskScheduledEventAttributes implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField TASK_LIST_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.getter(getter(DecisionTaskScheduledEventAttributes::taskList)).setter(setter(Builder::taskList))
.constructor(TaskList::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("taskList").build()).build();
private static final SdkField TASK_PRIORITY_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(DecisionTaskScheduledEventAttributes::taskPriority)).setter(setter(Builder::taskPriority))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("taskPriority").build()).build();
private static final SdkField START_TO_CLOSE_TIMEOUT_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(DecisionTaskScheduledEventAttributes::startToCloseTimeout))
.setter(setter(Builder::startToCloseTimeout))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("startToCloseTimeout").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(TASK_LIST_FIELD,
TASK_PRIORITY_FIELD, START_TO_CLOSE_TIMEOUT_FIELD));
private static final long serialVersionUID = 1L;
private final TaskList taskList;
private final String taskPriority;
private final String startToCloseTimeout;
private DecisionTaskScheduledEventAttributes(BuilderImpl builder) {
this.taskList = builder.taskList;
this.taskPriority = builder.taskPriority;
this.startToCloseTimeout = builder.startToCloseTimeout;
}
/**
*
* The name of the task list in which the decision task was scheduled.
*
*
* @return The name of the task list in which the decision task was scheduled.
*/
public TaskList taskList() {
return taskList;
}
/**
*
* A task priority that, if set, specifies the priority for this decision task. Valid values are integers that range
* from Java's Integer.MIN_VALUE
(-2147483648) to Integer.MAX_VALUE
(2147483647). Higher
* numbers indicate higher priority.
*
*
* For more information about setting task priority, see Setting Task
* Priority in the Amazon SWF Developer Guide.
*
*
* @return A task priority that, if set, specifies the priority for this decision task. Valid values are integers
* that range from Java's Integer.MIN_VALUE
(-2147483648) to Integer.MAX_VALUE
* (2147483647). Higher numbers indicate higher priority.
*
* For more information about setting task priority, see Setting Task
* Priority in the Amazon SWF Developer Guide.
*/
public String taskPriority() {
return taskPriority;
}
/**
*
* The maximum duration for this decision task. The task is considered timed out if it doesn't completed within this
* duration.
*
*
* The duration is specified in seconds, an integer greater than or equal to 0
. You can use
* NONE
to specify unlimited duration.
*
*
* @return The maximum duration for this decision task. The task is considered timed out if it doesn't completed
* within this duration.
*
* The duration is specified in seconds, an integer greater than or equal to 0
. You can use
* NONE
to specify unlimited duration.
*/
public String startToCloseTimeout() {
return startToCloseTimeout;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(taskList());
hashCode = 31 * hashCode + Objects.hashCode(taskPriority());
hashCode = 31 * hashCode + Objects.hashCode(startToCloseTimeout());
return hashCode;
}
@Override
public boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof DecisionTaskScheduledEventAttributes)) {
return false;
}
DecisionTaskScheduledEventAttributes other = (DecisionTaskScheduledEventAttributes) obj;
return Objects.equals(taskList(), other.taskList()) && Objects.equals(taskPriority(), other.taskPriority())
&& Objects.equals(startToCloseTimeout(), other.startToCloseTimeout());
}
/**
* 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.
*/
@Override
public String toString() {
return ToString.builder("DecisionTaskScheduledEventAttributes").add("TaskList", taskList())
.add("TaskPriority", taskPriority()).add("StartToCloseTimeout", startToCloseTimeout()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "taskList":
return Optional.ofNullable(clazz.cast(taskList()));
case "taskPriority":
return Optional.ofNullable(clazz.cast(taskPriority()));
case "startToCloseTimeout":
return Optional.ofNullable(clazz.cast(startToCloseTimeout()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function
*
* For more information about setting task priority, see Setting
* Task Priority in the Amazon SWF Developer Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder taskPriority(String taskPriority);
/**
*
* The maximum duration for this decision task. The task is considered timed out if it doesn't completed within
* this duration.
*
*
* The duration is specified in seconds, an integer greater than or equal to 0
. You can use
* NONE
to specify unlimited duration.
*
*
* @param startToCloseTimeout
* The maximum duration for this decision task. The task is considered timed out if it doesn't completed
* within this duration.
*
* The duration is specified in seconds, an integer greater than or equal to 0
. You can use
* NONE
to specify unlimited duration.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder startToCloseTimeout(String startToCloseTimeout);
}
static final class BuilderImpl implements Builder {
private TaskList taskList;
private String taskPriority;
private String startToCloseTimeout;
private BuilderImpl() {
}
private BuilderImpl(DecisionTaskScheduledEventAttributes model) {
taskList(model.taskList);
taskPriority(model.taskPriority);
startToCloseTimeout(model.startToCloseTimeout);
}
public final TaskList.Builder getTaskList() {
return taskList != null ? taskList.toBuilder() : null;
}
@Override
public final Builder taskList(TaskList taskList) {
this.taskList = taskList;
return this;
}
public final void setTaskList(TaskList.BuilderImpl taskList) {
this.taskList = taskList != null ? taskList.build() : null;
}
public final String getTaskPriority() {
return taskPriority;
}
@Override
public final Builder taskPriority(String taskPriority) {
this.taskPriority = taskPriority;
return this;
}
public final void setTaskPriority(String taskPriority) {
this.taskPriority = taskPriority;
}
public final String getStartToCloseTimeout() {
return startToCloseTimeout;
}
@Override
public final Builder startToCloseTimeout(String startToCloseTimeout) {
this.startToCloseTimeout = startToCloseTimeout;
return this;
}
public final void setStartToCloseTimeout(String startToCloseTimeout) {
this.startToCloseTimeout = startToCloseTimeout;
}
@Override
public DecisionTaskScheduledEventAttributes build() {
return new DecisionTaskScheduledEventAttributes(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}