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

com.uber.cadence.ContinueAsNewWorkflowExecutionDecisionAttributes Maven / Gradle / Ivy

There is a newer version: 3.12.5
Show newest version
/**
 * Autogenerated by Thrift Compiler (0.9.3)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package com.uber.cadence;

import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;

import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.server.AbstractNonblockingServer.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import javax.annotation.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2019-06-18")
public class ContinueAsNewWorkflowExecutionDecisionAttributes implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ContinueAsNewWorkflowExecutionDecisionAttributes");

  private static final org.apache.thrift.protocol.TField WORKFLOW_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("workflowType", org.apache.thrift.protocol.TType.STRUCT, (short)10);
  private static final org.apache.thrift.protocol.TField TASK_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("taskList", org.apache.thrift.protocol.TType.STRUCT, (short)20);
  private static final org.apache.thrift.protocol.TField INPUT_FIELD_DESC = new org.apache.thrift.protocol.TField("input", org.apache.thrift.protocol.TType.STRING, (short)30);
  private static final org.apache.thrift.protocol.TField EXECUTION_START_TO_CLOSE_TIMEOUT_SECONDS_FIELD_DESC = new org.apache.thrift.protocol.TField("executionStartToCloseTimeoutSeconds", org.apache.thrift.protocol.TType.I32, (short)40);
  private static final org.apache.thrift.protocol.TField TASK_START_TO_CLOSE_TIMEOUT_SECONDS_FIELD_DESC = new org.apache.thrift.protocol.TField("taskStartToCloseTimeoutSeconds", org.apache.thrift.protocol.TType.I32, (short)50);
  private static final org.apache.thrift.protocol.TField BACKOFF_START_INTERVAL_IN_SECONDS_FIELD_DESC = new org.apache.thrift.protocol.TField("backoffStartIntervalInSeconds", org.apache.thrift.protocol.TType.I32, (short)60);
  private static final org.apache.thrift.protocol.TField RETRY_POLICY_FIELD_DESC = new org.apache.thrift.protocol.TField("retryPolicy", org.apache.thrift.protocol.TType.STRUCT, (short)70);
  private static final org.apache.thrift.protocol.TField INITIATOR_FIELD_DESC = new org.apache.thrift.protocol.TField("initiator", org.apache.thrift.protocol.TType.I32, (short)80);
  private static final org.apache.thrift.protocol.TField FAILURE_REASON_FIELD_DESC = new org.apache.thrift.protocol.TField("failureReason", org.apache.thrift.protocol.TType.STRING, (short)90);
  private static final org.apache.thrift.protocol.TField FAILURE_DETAILS_FIELD_DESC = new org.apache.thrift.protocol.TField("failureDetails", org.apache.thrift.protocol.TType.STRING, (short)100);
  private static final org.apache.thrift.protocol.TField LAST_COMPLETION_RESULT_FIELD_DESC = new org.apache.thrift.protocol.TField("lastCompletionResult", org.apache.thrift.protocol.TType.STRING, (short)110);
  private static final org.apache.thrift.protocol.TField CRON_SCHEDULE_FIELD_DESC = new org.apache.thrift.protocol.TField("cronSchedule", org.apache.thrift.protocol.TType.STRING, (short)120);

  private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
  static {
    schemes.put(StandardScheme.class, new ContinueAsNewWorkflowExecutionDecisionAttributesStandardSchemeFactory());
    schemes.put(TupleScheme.class, new ContinueAsNewWorkflowExecutionDecisionAttributesTupleSchemeFactory());
  }

  public WorkflowType workflowType; // optional
  public TaskList taskList; // optional
  public ByteBuffer input; // optional
  public int executionStartToCloseTimeoutSeconds; // optional
  public int taskStartToCloseTimeoutSeconds; // optional
  public int backoffStartIntervalInSeconds; // optional
  public RetryPolicy retryPolicy; // optional
  public ContinueAsNewInitiator initiator; // optional
  public String failureReason; // optional
  public ByteBuffer failureDetails; // optional
  public ByteBuffer lastCompletionResult; // optional
  public String cronSchedule; // optional

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    WORKFLOW_TYPE((short)10, "workflowType"),
    TASK_LIST((short)20, "taskList"),
    INPUT((short)30, "input"),
    EXECUTION_START_TO_CLOSE_TIMEOUT_SECONDS((short)40, "executionStartToCloseTimeoutSeconds"),
    TASK_START_TO_CLOSE_TIMEOUT_SECONDS((short)50, "taskStartToCloseTimeoutSeconds"),
    BACKOFF_START_INTERVAL_IN_SECONDS((short)60, "backoffStartIntervalInSeconds"),
    RETRY_POLICY((short)70, "retryPolicy"),
    INITIATOR((short)80, "initiator"),
    FAILURE_REASON((short)90, "failureReason"),
    FAILURE_DETAILS((short)100, "failureDetails"),
    LAST_COMPLETION_RESULT((short)110, "lastCompletionResult"),
    CRON_SCHEDULE((short)120, "cronSchedule");

    private static final Map byName = new HashMap();

    static {
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
        byName.put(field.getFieldName(), field);
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 10: // WORKFLOW_TYPE
          return WORKFLOW_TYPE;
        case 20: // TASK_LIST
          return TASK_LIST;
        case 30: // INPUT
          return INPUT;
        case 40: // EXECUTION_START_TO_CLOSE_TIMEOUT_SECONDS
          return EXECUTION_START_TO_CLOSE_TIMEOUT_SECONDS;
        case 50: // TASK_START_TO_CLOSE_TIMEOUT_SECONDS
          return TASK_START_TO_CLOSE_TIMEOUT_SECONDS;
        case 60: // BACKOFF_START_INTERVAL_IN_SECONDS
          return BACKOFF_START_INTERVAL_IN_SECONDS;
        case 70: // RETRY_POLICY
          return RETRY_POLICY;
        case 80: // INITIATOR
          return INITIATOR;
        case 90: // FAILURE_REASON
          return FAILURE_REASON;
        case 100: // FAILURE_DETAILS
          return FAILURE_DETAILS;
        case 110: // LAST_COMPLETION_RESULT
          return LAST_COMPLETION_RESULT;
        case 120: // CRON_SCHEDULE
          return CRON_SCHEDULE;
        default:
          return null;
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, throwing an exception
     * if it is not found.
     */
    public static _Fields findByThriftIdOrThrow(int fieldId) {
      _Fields fields = findByThriftId(fieldId);
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
      return fields;
    }

    /**
     * Find the _Fields constant that matches name, or null if its not found.
     */
    public static _Fields findByName(String name) {
      return byName.get(name);
    }

    private final short _thriftId;
    private final String _fieldName;

    _Fields(short thriftId, String fieldName) {
      _thriftId = thriftId;
      _fieldName = fieldName;
    }

    public short getThriftFieldId() {
      return _thriftId;
    }

    public String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final int __EXECUTIONSTARTTOCLOSETIMEOUTSECONDS_ISSET_ID = 0;
  private static final int __TASKSTARTTOCLOSETIMEOUTSECONDS_ISSET_ID = 1;
  private static final int __BACKOFFSTARTINTERVALINSECONDS_ISSET_ID = 2;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.WORKFLOW_TYPE,_Fields.TASK_LIST,_Fields.INPUT,_Fields.EXECUTION_START_TO_CLOSE_TIMEOUT_SECONDS,_Fields.TASK_START_TO_CLOSE_TIMEOUT_SECONDS,_Fields.BACKOFF_START_INTERVAL_IN_SECONDS,_Fields.RETRY_POLICY,_Fields.INITIATOR,_Fields.FAILURE_REASON,_Fields.FAILURE_DETAILS,_Fields.LAST_COMPLETION_RESULT,_Fields.CRON_SCHEDULE};
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.WORKFLOW_TYPE, new org.apache.thrift.meta_data.FieldMetaData("workflowType", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, WorkflowType.class)));
    tmpMap.put(_Fields.TASK_LIST, new org.apache.thrift.meta_data.FieldMetaData("taskList", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TaskList.class)));
    tmpMap.put(_Fields.INPUT, new org.apache.thrift.meta_data.FieldMetaData("input", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , true)));
    tmpMap.put(_Fields.EXECUTION_START_TO_CLOSE_TIMEOUT_SECONDS, new org.apache.thrift.meta_data.FieldMetaData("executionStartToCloseTimeoutSeconds", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.TASK_START_TO_CLOSE_TIMEOUT_SECONDS, new org.apache.thrift.meta_data.FieldMetaData("taskStartToCloseTimeoutSeconds", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.BACKOFF_START_INTERVAL_IN_SECONDS, new org.apache.thrift.meta_data.FieldMetaData("backoffStartIntervalInSeconds", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.RETRY_POLICY, new org.apache.thrift.meta_data.FieldMetaData("retryPolicy", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT        , "RetryPolicy")));
    tmpMap.put(_Fields.INITIATOR, new org.apache.thrift.meta_data.FieldMetaData("initiator", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.ENUM        , "ContinueAsNewInitiator")));
    tmpMap.put(_Fields.FAILURE_REASON, new org.apache.thrift.meta_data.FieldMetaData("failureReason", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.FAILURE_DETAILS, new org.apache.thrift.meta_data.FieldMetaData("failureDetails", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , true)));
    tmpMap.put(_Fields.LAST_COMPLETION_RESULT, new org.apache.thrift.meta_data.FieldMetaData("lastCompletionResult", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , true)));
    tmpMap.put(_Fields.CRON_SCHEDULE, new org.apache.thrift.meta_data.FieldMetaData("cronSchedule", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ContinueAsNewWorkflowExecutionDecisionAttributes.class, metaDataMap);
  }

  public ContinueAsNewWorkflowExecutionDecisionAttributes() {
  }

  /**
   * Performs a deep copy on other.
   */
  public ContinueAsNewWorkflowExecutionDecisionAttributes(ContinueAsNewWorkflowExecutionDecisionAttributes other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetWorkflowType()) {
      this.workflowType = new WorkflowType(other.workflowType);
    }
    if (other.isSetTaskList()) {
      this.taskList = new TaskList(other.taskList);
    }
    if (other.isSetInput()) {
      this.input = org.apache.thrift.TBaseHelper.copyBinary(other.input);
    }
    this.executionStartToCloseTimeoutSeconds = other.executionStartToCloseTimeoutSeconds;
    this.taskStartToCloseTimeoutSeconds = other.taskStartToCloseTimeoutSeconds;
    this.backoffStartIntervalInSeconds = other.backoffStartIntervalInSeconds;
    if (other.isSetRetryPolicy()) {
      this.retryPolicy = other.retryPolicy;
    }
    if (other.isSetInitiator()) {
      this.initiator = other.initiator;
    }
    if (other.isSetFailureReason()) {
      this.failureReason = other.failureReason;
    }
    if (other.isSetFailureDetails()) {
      this.failureDetails = org.apache.thrift.TBaseHelper.copyBinary(other.failureDetails);
    }
    if (other.isSetLastCompletionResult()) {
      this.lastCompletionResult = org.apache.thrift.TBaseHelper.copyBinary(other.lastCompletionResult);
    }
    if (other.isSetCronSchedule()) {
      this.cronSchedule = other.cronSchedule;
    }
  }

  public ContinueAsNewWorkflowExecutionDecisionAttributes deepCopy() {
    return new ContinueAsNewWorkflowExecutionDecisionAttributes(this);
  }

  @Override
  public void clear() {
    this.workflowType = null;
    this.taskList = null;
    this.input = null;
    setExecutionStartToCloseTimeoutSecondsIsSet(false);
    this.executionStartToCloseTimeoutSeconds = 0;
    setTaskStartToCloseTimeoutSecondsIsSet(false);
    this.taskStartToCloseTimeoutSeconds = 0;
    setBackoffStartIntervalInSecondsIsSet(false);
    this.backoffStartIntervalInSeconds = 0;
    this.retryPolicy = null;
    this.initiator = null;
    this.failureReason = null;
    this.failureDetails = null;
    this.lastCompletionResult = null;
    this.cronSchedule = null;
  }

  public WorkflowType getWorkflowType() {
    return this.workflowType;
  }

  public ContinueAsNewWorkflowExecutionDecisionAttributes setWorkflowType(WorkflowType workflowType) {
    this.workflowType = workflowType;
    return this;
  }

  public void unsetWorkflowType() {
    this.workflowType = null;
  }

  /** Returns true if field workflowType is set (has been assigned a value) and false otherwise */
  public boolean isSetWorkflowType() {
    return this.workflowType != null;
  }

  public void setWorkflowTypeIsSet(boolean value) {
    if (!value) {
      this.workflowType = null;
    }
  }

  public TaskList getTaskList() {
    return this.taskList;
  }

  public ContinueAsNewWorkflowExecutionDecisionAttributes setTaskList(TaskList taskList) {
    this.taskList = taskList;
    return this;
  }

  public void unsetTaskList() {
    this.taskList = null;
  }

  /** Returns true if field taskList is set (has been assigned a value) and false otherwise */
  public boolean isSetTaskList() {
    return this.taskList != null;
  }

  public void setTaskListIsSet(boolean value) {
    if (!value) {
      this.taskList = null;
    }
  }

  public byte[] getInput() {
    setInput(org.apache.thrift.TBaseHelper.rightSize(input));
    return input == null ? null : input.array();
  }

  public ByteBuffer bufferForInput() {
    return org.apache.thrift.TBaseHelper.copyBinary(input);
  }

  public ContinueAsNewWorkflowExecutionDecisionAttributes setInput(byte[] input) {
    this.input = input == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(input, input.length));
    return this;
  }

  public ContinueAsNewWorkflowExecutionDecisionAttributes setInput(ByteBuffer input) {
    this.input = org.apache.thrift.TBaseHelper.copyBinary(input);
    return this;
  }

  public void unsetInput() {
    this.input = null;
  }

  /** Returns true if field input is set (has been assigned a value) and false otherwise */
  public boolean isSetInput() {
    return this.input != null;
  }

  public void setInputIsSet(boolean value) {
    if (!value) {
      this.input = null;
    }
  }

  public int getExecutionStartToCloseTimeoutSeconds() {
    return this.executionStartToCloseTimeoutSeconds;
  }

  public ContinueAsNewWorkflowExecutionDecisionAttributes setExecutionStartToCloseTimeoutSeconds(int executionStartToCloseTimeoutSeconds) {
    this.executionStartToCloseTimeoutSeconds = executionStartToCloseTimeoutSeconds;
    setExecutionStartToCloseTimeoutSecondsIsSet(true);
    return this;
  }

  public void unsetExecutionStartToCloseTimeoutSeconds() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __EXECUTIONSTARTTOCLOSETIMEOUTSECONDS_ISSET_ID);
  }

  /** Returns true if field executionStartToCloseTimeoutSeconds is set (has been assigned a value) and false otherwise */
  public boolean isSetExecutionStartToCloseTimeoutSeconds() {
    return EncodingUtils.testBit(__isset_bitfield, __EXECUTIONSTARTTOCLOSETIMEOUTSECONDS_ISSET_ID);
  }

  public void setExecutionStartToCloseTimeoutSecondsIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __EXECUTIONSTARTTOCLOSETIMEOUTSECONDS_ISSET_ID, value);
  }

  public int getTaskStartToCloseTimeoutSeconds() {
    return this.taskStartToCloseTimeoutSeconds;
  }

  public ContinueAsNewWorkflowExecutionDecisionAttributes setTaskStartToCloseTimeoutSeconds(int taskStartToCloseTimeoutSeconds) {
    this.taskStartToCloseTimeoutSeconds = taskStartToCloseTimeoutSeconds;
    setTaskStartToCloseTimeoutSecondsIsSet(true);
    return this;
  }

  public void unsetTaskStartToCloseTimeoutSeconds() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TASKSTARTTOCLOSETIMEOUTSECONDS_ISSET_ID);
  }

  /** Returns true if field taskStartToCloseTimeoutSeconds is set (has been assigned a value) and false otherwise */
  public boolean isSetTaskStartToCloseTimeoutSeconds() {
    return EncodingUtils.testBit(__isset_bitfield, __TASKSTARTTOCLOSETIMEOUTSECONDS_ISSET_ID);
  }

  public void setTaskStartToCloseTimeoutSecondsIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TASKSTARTTOCLOSETIMEOUTSECONDS_ISSET_ID, value);
  }

  public int getBackoffStartIntervalInSeconds() {
    return this.backoffStartIntervalInSeconds;
  }

  public ContinueAsNewWorkflowExecutionDecisionAttributes setBackoffStartIntervalInSeconds(int backoffStartIntervalInSeconds) {
    this.backoffStartIntervalInSeconds = backoffStartIntervalInSeconds;
    setBackoffStartIntervalInSecondsIsSet(true);
    return this;
  }

  public void unsetBackoffStartIntervalInSeconds() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BACKOFFSTARTINTERVALINSECONDS_ISSET_ID);
  }

  /** Returns true if field backoffStartIntervalInSeconds is set (has been assigned a value) and false otherwise */
  public boolean isSetBackoffStartIntervalInSeconds() {
    return EncodingUtils.testBit(__isset_bitfield, __BACKOFFSTARTINTERVALINSECONDS_ISSET_ID);
  }

  public void setBackoffStartIntervalInSecondsIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BACKOFFSTARTINTERVALINSECONDS_ISSET_ID, value);
  }

  public RetryPolicy getRetryPolicy() {
    return this.retryPolicy;
  }

  public ContinueAsNewWorkflowExecutionDecisionAttributes setRetryPolicy(RetryPolicy retryPolicy) {
    this.retryPolicy = retryPolicy;
    return this;
  }

  public void unsetRetryPolicy() {
    this.retryPolicy = null;
  }

  /** Returns true if field retryPolicy is set (has been assigned a value) and false otherwise */
  public boolean isSetRetryPolicy() {
    return this.retryPolicy != null;
  }

  public void setRetryPolicyIsSet(boolean value) {
    if (!value) {
      this.retryPolicy = null;
    }
  }

  public ContinueAsNewInitiator getInitiator() {
    return this.initiator;
  }

  public ContinueAsNewWorkflowExecutionDecisionAttributes setInitiator(ContinueAsNewInitiator initiator) {
    this.initiator = initiator;
    return this;
  }

  public void unsetInitiator() {
    this.initiator = null;
  }

  /** Returns true if field initiator is set (has been assigned a value) and false otherwise */
  public boolean isSetInitiator() {
    return this.initiator != null;
  }

  public void setInitiatorIsSet(boolean value) {
    if (!value) {
      this.initiator = null;
    }
  }

  public String getFailureReason() {
    return this.failureReason;
  }

  public ContinueAsNewWorkflowExecutionDecisionAttributes setFailureReason(String failureReason) {
    this.failureReason = failureReason;
    return this;
  }

  public void unsetFailureReason() {
    this.failureReason = null;
  }

  /** Returns true if field failureReason is set (has been assigned a value) and false otherwise */
  public boolean isSetFailureReason() {
    return this.failureReason != null;
  }

  public void setFailureReasonIsSet(boolean value) {
    if (!value) {
      this.failureReason = null;
    }
  }

  public byte[] getFailureDetails() {
    setFailureDetails(org.apache.thrift.TBaseHelper.rightSize(failureDetails));
    return failureDetails == null ? null : failureDetails.array();
  }

  public ByteBuffer bufferForFailureDetails() {
    return org.apache.thrift.TBaseHelper.copyBinary(failureDetails);
  }

  public ContinueAsNewWorkflowExecutionDecisionAttributes setFailureDetails(byte[] failureDetails) {
    this.failureDetails = failureDetails == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(failureDetails, failureDetails.length));
    return this;
  }

  public ContinueAsNewWorkflowExecutionDecisionAttributes setFailureDetails(ByteBuffer failureDetails) {
    this.failureDetails = org.apache.thrift.TBaseHelper.copyBinary(failureDetails);
    return this;
  }

  public void unsetFailureDetails() {
    this.failureDetails = null;
  }

  /** Returns true if field failureDetails is set (has been assigned a value) and false otherwise */
  public boolean isSetFailureDetails() {
    return this.failureDetails != null;
  }

  public void setFailureDetailsIsSet(boolean value) {
    if (!value) {
      this.failureDetails = null;
    }
  }

  public byte[] getLastCompletionResult() {
    setLastCompletionResult(org.apache.thrift.TBaseHelper.rightSize(lastCompletionResult));
    return lastCompletionResult == null ? null : lastCompletionResult.array();
  }

  public ByteBuffer bufferForLastCompletionResult() {
    return org.apache.thrift.TBaseHelper.copyBinary(lastCompletionResult);
  }

  public ContinueAsNewWorkflowExecutionDecisionAttributes setLastCompletionResult(byte[] lastCompletionResult) {
    this.lastCompletionResult = lastCompletionResult == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(lastCompletionResult, lastCompletionResult.length));
    return this;
  }

  public ContinueAsNewWorkflowExecutionDecisionAttributes setLastCompletionResult(ByteBuffer lastCompletionResult) {
    this.lastCompletionResult = org.apache.thrift.TBaseHelper.copyBinary(lastCompletionResult);
    return this;
  }

  public void unsetLastCompletionResult() {
    this.lastCompletionResult = null;
  }

  /** Returns true if field lastCompletionResult is set (has been assigned a value) and false otherwise */
  public boolean isSetLastCompletionResult() {
    return this.lastCompletionResult != null;
  }

  public void setLastCompletionResultIsSet(boolean value) {
    if (!value) {
      this.lastCompletionResult = null;
    }
  }

  public String getCronSchedule() {
    return this.cronSchedule;
  }

  public ContinueAsNewWorkflowExecutionDecisionAttributes setCronSchedule(String cronSchedule) {
    this.cronSchedule = cronSchedule;
    return this;
  }

  public void unsetCronSchedule() {
    this.cronSchedule = null;
  }

  /** Returns true if field cronSchedule is set (has been assigned a value) and false otherwise */
  public boolean isSetCronSchedule() {
    return this.cronSchedule != null;
  }

  public void setCronScheduleIsSet(boolean value) {
    if (!value) {
      this.cronSchedule = null;
    }
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case WORKFLOW_TYPE:
      if (value == null) {
        unsetWorkflowType();
      } else {
        setWorkflowType((WorkflowType)value);
      }
      break;

    case TASK_LIST:
      if (value == null) {
        unsetTaskList();
      } else {
        setTaskList((TaskList)value);
      }
      break;

    case INPUT:
      if (value == null) {
        unsetInput();
      } else {
        setInput((ByteBuffer)value);
      }
      break;

    case EXECUTION_START_TO_CLOSE_TIMEOUT_SECONDS:
      if (value == null) {
        unsetExecutionStartToCloseTimeoutSeconds();
      } else {
        setExecutionStartToCloseTimeoutSeconds((Integer)value);
      }
      break;

    case TASK_START_TO_CLOSE_TIMEOUT_SECONDS:
      if (value == null) {
        unsetTaskStartToCloseTimeoutSeconds();
      } else {
        setTaskStartToCloseTimeoutSeconds((Integer)value);
      }
      break;

    case BACKOFF_START_INTERVAL_IN_SECONDS:
      if (value == null) {
        unsetBackoffStartIntervalInSeconds();
      } else {
        setBackoffStartIntervalInSeconds((Integer)value);
      }
      break;

    case RETRY_POLICY:
      if (value == null) {
        unsetRetryPolicy();
      } else {
        setRetryPolicy((RetryPolicy)value);
      }
      break;

    case INITIATOR:
      if (value == null) {
        unsetInitiator();
      } else {
        setInitiator((ContinueAsNewInitiator)value);
      }
      break;

    case FAILURE_REASON:
      if (value == null) {
        unsetFailureReason();
      } else {
        setFailureReason((String)value);
      }
      break;

    case FAILURE_DETAILS:
      if (value == null) {
        unsetFailureDetails();
      } else {
        setFailureDetails((ByteBuffer)value);
      }
      break;

    case LAST_COMPLETION_RESULT:
      if (value == null) {
        unsetLastCompletionResult();
      } else {
        setLastCompletionResult((ByteBuffer)value);
      }
      break;

    case CRON_SCHEDULE:
      if (value == null) {
        unsetCronSchedule();
      } else {
        setCronSchedule((String)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case WORKFLOW_TYPE:
      return getWorkflowType();

    case TASK_LIST:
      return getTaskList();

    case INPUT:
      return getInput();

    case EXECUTION_START_TO_CLOSE_TIMEOUT_SECONDS:
      return getExecutionStartToCloseTimeoutSeconds();

    case TASK_START_TO_CLOSE_TIMEOUT_SECONDS:
      return getTaskStartToCloseTimeoutSeconds();

    case BACKOFF_START_INTERVAL_IN_SECONDS:
      return getBackoffStartIntervalInSeconds();

    case RETRY_POLICY:
      return getRetryPolicy();

    case INITIATOR:
      return getInitiator();

    case FAILURE_REASON:
      return getFailureReason();

    case FAILURE_DETAILS:
      return getFailureDetails();

    case LAST_COMPLETION_RESULT:
      return getLastCompletionResult();

    case CRON_SCHEDULE:
      return getCronSchedule();

    }
    throw new IllegalStateException();
  }

  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
  public boolean isSet(_Fields field) {
    if (field == null) {
      throw new IllegalArgumentException();
    }

    switch (field) {
    case WORKFLOW_TYPE:
      return isSetWorkflowType();
    case TASK_LIST:
      return isSetTaskList();
    case INPUT:
      return isSetInput();
    case EXECUTION_START_TO_CLOSE_TIMEOUT_SECONDS:
      return isSetExecutionStartToCloseTimeoutSeconds();
    case TASK_START_TO_CLOSE_TIMEOUT_SECONDS:
      return isSetTaskStartToCloseTimeoutSeconds();
    case BACKOFF_START_INTERVAL_IN_SECONDS:
      return isSetBackoffStartIntervalInSeconds();
    case RETRY_POLICY:
      return isSetRetryPolicy();
    case INITIATOR:
      return isSetInitiator();
    case FAILURE_REASON:
      return isSetFailureReason();
    case FAILURE_DETAILS:
      return isSetFailureDetails();
    case LAST_COMPLETION_RESULT:
      return isSetLastCompletionResult();
    case CRON_SCHEDULE:
      return isSetCronSchedule();
    }
    throw new IllegalStateException();
  }

  @Override
  public boolean equals(Object that) {
    if (that == null)
      return false;
    if (that instanceof ContinueAsNewWorkflowExecutionDecisionAttributes)
      return this.equals((ContinueAsNewWorkflowExecutionDecisionAttributes)that);
    return false;
  }

  public boolean equals(ContinueAsNewWorkflowExecutionDecisionAttributes that) {
    if (that == null)
      return false;

    boolean this_present_workflowType = true && this.isSetWorkflowType();
    boolean that_present_workflowType = true && that.isSetWorkflowType();
    if (this_present_workflowType || that_present_workflowType) {
      if (!(this_present_workflowType && that_present_workflowType))
        return false;
      if (!this.workflowType.equals(that.workflowType))
        return false;
    }

    boolean this_present_taskList = true && this.isSetTaskList();
    boolean that_present_taskList = true && that.isSetTaskList();
    if (this_present_taskList || that_present_taskList) {
      if (!(this_present_taskList && that_present_taskList))
        return false;
      if (!this.taskList.equals(that.taskList))
        return false;
    }

    boolean this_present_input = true && this.isSetInput();
    boolean that_present_input = true && that.isSetInput();
    if (this_present_input || that_present_input) {
      if (!(this_present_input && that_present_input))
        return false;
      if (!this.input.equals(that.input))
        return false;
    }

    boolean this_present_executionStartToCloseTimeoutSeconds = true && this.isSetExecutionStartToCloseTimeoutSeconds();
    boolean that_present_executionStartToCloseTimeoutSeconds = true && that.isSetExecutionStartToCloseTimeoutSeconds();
    if (this_present_executionStartToCloseTimeoutSeconds || that_present_executionStartToCloseTimeoutSeconds) {
      if (!(this_present_executionStartToCloseTimeoutSeconds && that_present_executionStartToCloseTimeoutSeconds))
        return false;
      if (this.executionStartToCloseTimeoutSeconds != that.executionStartToCloseTimeoutSeconds)
        return false;
    }

    boolean this_present_taskStartToCloseTimeoutSeconds = true && this.isSetTaskStartToCloseTimeoutSeconds();
    boolean that_present_taskStartToCloseTimeoutSeconds = true && that.isSetTaskStartToCloseTimeoutSeconds();
    if (this_present_taskStartToCloseTimeoutSeconds || that_present_taskStartToCloseTimeoutSeconds) {
      if (!(this_present_taskStartToCloseTimeoutSeconds && that_present_taskStartToCloseTimeoutSeconds))
        return false;
      if (this.taskStartToCloseTimeoutSeconds != that.taskStartToCloseTimeoutSeconds)
        return false;
    }

    boolean this_present_backoffStartIntervalInSeconds = true && this.isSetBackoffStartIntervalInSeconds();
    boolean that_present_backoffStartIntervalInSeconds = true && that.isSetBackoffStartIntervalInSeconds();
    if (this_present_backoffStartIntervalInSeconds || that_present_backoffStartIntervalInSeconds) {
      if (!(this_present_backoffStartIntervalInSeconds && that_present_backoffStartIntervalInSeconds))
        return false;
      if (this.backoffStartIntervalInSeconds != that.backoffStartIntervalInSeconds)
        return false;
    }

    boolean this_present_retryPolicy = true && this.isSetRetryPolicy();
    boolean that_present_retryPolicy = true && that.isSetRetryPolicy();
    if (this_present_retryPolicy || that_present_retryPolicy) {
      if (!(this_present_retryPolicy && that_present_retryPolicy))
        return false;
      if (!this.retryPolicy.equals(that.retryPolicy))
        return false;
    }

    boolean this_present_initiator = true && this.isSetInitiator();
    boolean that_present_initiator = true && that.isSetInitiator();
    if (this_present_initiator || that_present_initiator) {
      if (!(this_present_initiator && that_present_initiator))
        return false;
      if (!this.initiator.equals(that.initiator))
        return false;
    }

    boolean this_present_failureReason = true && this.isSetFailureReason();
    boolean that_present_failureReason = true && that.isSetFailureReason();
    if (this_present_failureReason || that_present_failureReason) {
      if (!(this_present_failureReason && that_present_failureReason))
        return false;
      if (!this.failureReason.equals(that.failureReason))
        return false;
    }

    boolean this_present_failureDetails = true && this.isSetFailureDetails();
    boolean that_present_failureDetails = true && that.isSetFailureDetails();
    if (this_present_failureDetails || that_present_failureDetails) {
      if (!(this_present_failureDetails && that_present_failureDetails))
        return false;
      if (!this.failureDetails.equals(that.failureDetails))
        return false;
    }

    boolean this_present_lastCompletionResult = true && this.isSetLastCompletionResult();
    boolean that_present_lastCompletionResult = true && that.isSetLastCompletionResult();
    if (this_present_lastCompletionResult || that_present_lastCompletionResult) {
      if (!(this_present_lastCompletionResult && that_present_lastCompletionResult))
        return false;
      if (!this.lastCompletionResult.equals(that.lastCompletionResult))
        return false;
    }

    boolean this_present_cronSchedule = true && this.isSetCronSchedule();
    boolean that_present_cronSchedule = true && that.isSetCronSchedule();
    if (this_present_cronSchedule || that_present_cronSchedule) {
      if (!(this_present_cronSchedule && that_present_cronSchedule))
        return false;
      if (!this.cronSchedule.equals(that.cronSchedule))
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    List list = new ArrayList();

    boolean present_workflowType = true && (isSetWorkflowType());
    list.add(present_workflowType);
    if (present_workflowType)
      list.add(workflowType);

    boolean present_taskList = true && (isSetTaskList());
    list.add(present_taskList);
    if (present_taskList)
      list.add(taskList);

    boolean present_input = true && (isSetInput());
    list.add(present_input);
    if (present_input)
      list.add(input);

    boolean present_executionStartToCloseTimeoutSeconds = true && (isSetExecutionStartToCloseTimeoutSeconds());
    list.add(present_executionStartToCloseTimeoutSeconds);
    if (present_executionStartToCloseTimeoutSeconds)
      list.add(executionStartToCloseTimeoutSeconds);

    boolean present_taskStartToCloseTimeoutSeconds = true && (isSetTaskStartToCloseTimeoutSeconds());
    list.add(present_taskStartToCloseTimeoutSeconds);
    if (present_taskStartToCloseTimeoutSeconds)
      list.add(taskStartToCloseTimeoutSeconds);

    boolean present_backoffStartIntervalInSeconds = true && (isSetBackoffStartIntervalInSeconds());
    list.add(present_backoffStartIntervalInSeconds);
    if (present_backoffStartIntervalInSeconds)
      list.add(backoffStartIntervalInSeconds);

    boolean present_retryPolicy = true && (isSetRetryPolicy());
    list.add(present_retryPolicy);
    if (present_retryPolicy)
      list.add(retryPolicy);

    boolean present_initiator = true && (isSetInitiator());
    list.add(present_initiator);
    if (present_initiator)
      list.add(initiator.getValue());

    boolean present_failureReason = true && (isSetFailureReason());
    list.add(present_failureReason);
    if (present_failureReason)
      list.add(failureReason);

    boolean present_failureDetails = true && (isSetFailureDetails());
    list.add(present_failureDetails);
    if (present_failureDetails)
      list.add(failureDetails);

    boolean present_lastCompletionResult = true && (isSetLastCompletionResult());
    list.add(present_lastCompletionResult);
    if (present_lastCompletionResult)
      list.add(lastCompletionResult);

    boolean present_cronSchedule = true && (isSetCronSchedule());
    list.add(present_cronSchedule);
    if (present_cronSchedule)
      list.add(cronSchedule);

    return list.hashCode();
  }

  @Override
  public int compareTo(ContinueAsNewWorkflowExecutionDecisionAttributes other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetWorkflowType()).compareTo(other.isSetWorkflowType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetWorkflowType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.workflowType, other.workflowType);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTaskList()).compareTo(other.isSetTaskList());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTaskList()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.taskList, other.taskList);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetInput()).compareTo(other.isSetInput());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetInput()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.input, other.input);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetExecutionStartToCloseTimeoutSeconds()).compareTo(other.isSetExecutionStartToCloseTimeoutSeconds());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetExecutionStartToCloseTimeoutSeconds()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.executionStartToCloseTimeoutSeconds, other.executionStartToCloseTimeoutSeconds);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTaskStartToCloseTimeoutSeconds()).compareTo(other.isSetTaskStartToCloseTimeoutSeconds());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTaskStartToCloseTimeoutSeconds()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.taskStartToCloseTimeoutSeconds, other.taskStartToCloseTimeoutSeconds);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetBackoffStartIntervalInSeconds()).compareTo(other.isSetBackoffStartIntervalInSeconds());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBackoffStartIntervalInSeconds()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.backoffStartIntervalInSeconds, other.backoffStartIntervalInSeconds);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetRetryPolicy()).compareTo(other.isSetRetryPolicy());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRetryPolicy()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.retryPolicy, other.retryPolicy);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetInitiator()).compareTo(other.isSetInitiator());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetInitiator()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.initiator, other.initiator);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetFailureReason()).compareTo(other.isSetFailureReason());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFailureReason()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.failureReason, other.failureReason);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetFailureDetails()).compareTo(other.isSetFailureDetails());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFailureDetails()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.failureDetails, other.failureDetails);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetLastCompletionResult()).compareTo(other.isSetLastCompletionResult());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLastCompletionResult()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lastCompletionResult, other.lastCompletionResult);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCronSchedule()).compareTo(other.isSetCronSchedule());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCronSchedule()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cronSchedule, other.cronSchedule);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  public _Fields fieldForId(int fieldId) {
    return _Fields.findByThriftId(fieldId);
  }

  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
  }

  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder("ContinueAsNewWorkflowExecutionDecisionAttributes(");
    boolean first = true;

    if (isSetWorkflowType()) {
      sb.append("workflowType:");
      if (this.workflowType == null) {
        sb.append("null");
      } else {
        sb.append(this.workflowType);
      }
      first = false;
    }
    if (isSetTaskList()) {
      if (!first) sb.append(", ");
      sb.append("taskList:");
      if (this.taskList == null) {
        sb.append("null");
      } else {
        sb.append(this.taskList);
      }
      first = false;
    }
    if (isSetInput()) {
      if (!first) sb.append(", ");
      sb.append("input:");
      if (this.input == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.input, sb);
      }
      first = false;
    }
    if (isSetExecutionStartToCloseTimeoutSeconds()) {
      if (!first) sb.append(", ");
      sb.append("executionStartToCloseTimeoutSeconds:");
      sb.append(this.executionStartToCloseTimeoutSeconds);
      first = false;
    }
    if (isSetTaskStartToCloseTimeoutSeconds()) {
      if (!first) sb.append(", ");
      sb.append("taskStartToCloseTimeoutSeconds:");
      sb.append(this.taskStartToCloseTimeoutSeconds);
      first = false;
    }
    if (isSetBackoffStartIntervalInSeconds()) {
      if (!first) sb.append(", ");
      sb.append("backoffStartIntervalInSeconds:");
      sb.append(this.backoffStartIntervalInSeconds);
      first = false;
    }
    if (isSetRetryPolicy()) {
      if (!first) sb.append(", ");
      sb.append("retryPolicy:");
      if (this.retryPolicy == null) {
        sb.append("null");
      } else {
        sb.append(this.retryPolicy);
      }
      first = false;
    }
    if (isSetInitiator()) {
      if (!first) sb.append(", ");
      sb.append("initiator:");
      if (this.initiator == null) {
        sb.append("null");
      } else {
        sb.append(this.initiator);
      }
      first = false;
    }
    if (isSetFailureReason()) {
      if (!first) sb.append(", ");
      sb.append("failureReason:");
      if (this.failureReason == null) {
        sb.append("null");
      } else {
        sb.append(this.failureReason);
      }
      first = false;
    }
    if (isSetFailureDetails()) {
      if (!first) sb.append(", ");
      sb.append("failureDetails:");
      if (this.failureDetails == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.failureDetails, sb);
      }
      first = false;
    }
    if (isSetLastCompletionResult()) {
      if (!first) sb.append(", ");
      sb.append("lastCompletionResult:");
      if (this.lastCompletionResult == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.lastCompletionResult, sb);
      }
      first = false;
    }
    if (isSetCronSchedule()) {
      if (!first) sb.append(", ");
      sb.append("cronSchedule:");
      if (this.cronSchedule == null) {
        sb.append("null");
      } else {
        sb.append(this.cronSchedule);
      }
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // check for sub-struct validity
    if (workflowType != null) {
      workflowType.validate();
    }
    if (taskList != null) {
      taskList.validate();
    }
  }

  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
    try {
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
    try {
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
      __isset_bitfield = 0;
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private static class ContinueAsNewWorkflowExecutionDecisionAttributesStandardSchemeFactory implements SchemeFactory {
    public ContinueAsNewWorkflowExecutionDecisionAttributesStandardScheme getScheme() {
      return new ContinueAsNewWorkflowExecutionDecisionAttributesStandardScheme();
    }
  }

  private static class ContinueAsNewWorkflowExecutionDecisionAttributesStandardScheme extends StandardScheme {

    public void read(org.apache.thrift.protocol.TProtocol iprot, ContinueAsNewWorkflowExecutionDecisionAttributes struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true)
      {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (schemeField.id) {
          case 10: // WORKFLOW_TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.workflowType = new WorkflowType();
              struct.workflowType.read(iprot);
              struct.setWorkflowTypeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 20: // TASK_LIST
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.taskList = new TaskList();
              struct.taskList.read(iprot);
              struct.setTaskListIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 30: // INPUT
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.input = iprot.readBinary();
              struct.setInputIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 40: // EXECUTION_START_TO_CLOSE_TIMEOUT_SECONDS
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.executionStartToCloseTimeoutSeconds = iprot.readI32();
              struct.setExecutionStartToCloseTimeoutSecondsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 50: // TASK_START_TO_CLOSE_TIMEOUT_SECONDS
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.taskStartToCloseTimeoutSeconds = iprot.readI32();
              struct.setTaskStartToCloseTimeoutSecondsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 60: // BACKOFF_START_INTERVAL_IN_SECONDS
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.backoffStartIntervalInSeconds = iprot.readI32();
              struct.setBackoffStartIntervalInSecondsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 70: // RETRY_POLICY
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.retryPolicy = new RetryPolicy();
              struct.retryPolicy.read(iprot);
              struct.setRetryPolicyIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 80: // INITIATOR
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.initiator = com.uber.cadence.ContinueAsNewInitiator.findByValue(iprot.readI32());
              struct.setInitiatorIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 90: // FAILURE_REASON
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.failureReason = iprot.readString();
              struct.setFailureReasonIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 100: // FAILURE_DETAILS
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.failureDetails = iprot.readBinary();
              struct.setFailureDetailsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 110: // LAST_COMPLETION_RESULT
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.lastCompletionResult = iprot.readBinary();
              struct.setLastCompletionResultIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 120: // CRON_SCHEDULE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.cronSchedule = iprot.readString();
              struct.setCronScheduleIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      struct.validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot, ContinueAsNewWorkflowExecutionDecisionAttributes struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.workflowType != null) {
        if (struct.isSetWorkflowType()) {
          oprot.writeFieldBegin(WORKFLOW_TYPE_FIELD_DESC);
          struct.workflowType.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.taskList != null) {
        if (struct.isSetTaskList()) {
          oprot.writeFieldBegin(TASK_LIST_FIELD_DESC);
          struct.taskList.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.input != null) {
        if (struct.isSetInput()) {
          oprot.writeFieldBegin(INPUT_FIELD_DESC);
          oprot.writeBinary(struct.input);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetExecutionStartToCloseTimeoutSeconds()) {
        oprot.writeFieldBegin(EXECUTION_START_TO_CLOSE_TIMEOUT_SECONDS_FIELD_DESC);
        oprot.writeI32(struct.executionStartToCloseTimeoutSeconds);
        oprot.writeFieldEnd();
      }
      if (struct.isSetTaskStartToCloseTimeoutSeconds()) {
        oprot.writeFieldBegin(TASK_START_TO_CLOSE_TIMEOUT_SECONDS_FIELD_DESC);
        oprot.writeI32(struct.taskStartToCloseTimeoutSeconds);
        oprot.writeFieldEnd();
      }
      if (struct.isSetBackoffStartIntervalInSeconds()) {
        oprot.writeFieldBegin(BACKOFF_START_INTERVAL_IN_SECONDS_FIELD_DESC);
        oprot.writeI32(struct.backoffStartIntervalInSeconds);
        oprot.writeFieldEnd();
      }
      if (struct.retryPolicy != null) {
        if (struct.isSetRetryPolicy()) {
          oprot.writeFieldBegin(RETRY_POLICY_FIELD_DESC);
          struct.retryPolicy.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.initiator != null) {
        if (struct.isSetInitiator()) {
          oprot.writeFieldBegin(INITIATOR_FIELD_DESC);
          oprot.writeI32(struct.initiator.getValue());
          oprot.writeFieldEnd();
        }
      }
      if (struct.failureReason != null) {
        if (struct.isSetFailureReason()) {
          oprot.writeFieldBegin(FAILURE_REASON_FIELD_DESC);
          oprot.writeString(struct.failureReason);
          oprot.writeFieldEnd();
        }
      }
      if (struct.failureDetails != null) {
        if (struct.isSetFailureDetails()) {
          oprot.writeFieldBegin(FAILURE_DETAILS_FIELD_DESC);
          oprot.writeBinary(struct.failureDetails);
          oprot.writeFieldEnd();
        }
      }
      if (struct.lastCompletionResult != null) {
        if (struct.isSetLastCompletionResult()) {
          oprot.writeFieldBegin(LAST_COMPLETION_RESULT_FIELD_DESC);
          oprot.writeBinary(struct.lastCompletionResult);
          oprot.writeFieldEnd();
        }
      }
      if (struct.cronSchedule != null) {
        if (struct.isSetCronSchedule()) {
          oprot.writeFieldBegin(CRON_SCHEDULE_FIELD_DESC);
          oprot.writeString(struct.cronSchedule);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class ContinueAsNewWorkflowExecutionDecisionAttributesTupleSchemeFactory implements SchemeFactory {
    public ContinueAsNewWorkflowExecutionDecisionAttributesTupleScheme getScheme() {
      return new ContinueAsNewWorkflowExecutionDecisionAttributesTupleScheme();
    }
  }

  private static class ContinueAsNewWorkflowExecutionDecisionAttributesTupleScheme extends TupleScheme {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, ContinueAsNewWorkflowExecutionDecisionAttributes struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetWorkflowType()) {
        optionals.set(0);
      }
      if (struct.isSetTaskList()) {
        optionals.set(1);
      }
      if (struct.isSetInput()) {
        optionals.set(2);
      }
      if (struct.isSetExecutionStartToCloseTimeoutSeconds()) {
        optionals.set(3);
      }
      if (struct.isSetTaskStartToCloseTimeoutSeconds()) {
        optionals.set(4);
      }
      if (struct.isSetBackoffStartIntervalInSeconds()) {
        optionals.set(5);
      }
      if (struct.isSetRetryPolicy()) {
        optionals.set(6);
      }
      if (struct.isSetInitiator()) {
        optionals.set(7);
      }
      if (struct.isSetFailureReason()) {
        optionals.set(8);
      }
      if (struct.isSetFailureDetails()) {
        optionals.set(9);
      }
      if (struct.isSetLastCompletionResult()) {
        optionals.set(10);
      }
      if (struct.isSetCronSchedule()) {
        optionals.set(11);
      }
      oprot.writeBitSet(optionals, 12);
      if (struct.isSetWorkflowType()) {
        struct.workflowType.write(oprot);
      }
      if (struct.isSetTaskList()) {
        struct.taskList.write(oprot);
      }
      if (struct.isSetInput()) {
        oprot.writeBinary(struct.input);
      }
      if (struct.isSetExecutionStartToCloseTimeoutSeconds()) {
        oprot.writeI32(struct.executionStartToCloseTimeoutSeconds);
      }
      if (struct.isSetTaskStartToCloseTimeoutSeconds()) {
        oprot.writeI32(struct.taskStartToCloseTimeoutSeconds);
      }
      if (struct.isSetBackoffStartIntervalInSeconds()) {
        oprot.writeI32(struct.backoffStartIntervalInSeconds);
      }
      if (struct.isSetRetryPolicy()) {
        struct.retryPolicy.write(oprot);
      }
      if (struct.isSetInitiator()) {
        oprot.writeI32(struct.initiator.getValue());
      }
      if (struct.isSetFailureReason()) {
        oprot.writeString(struct.failureReason);
      }
      if (struct.isSetFailureDetails()) {
        oprot.writeBinary(struct.failureDetails);
      }
      if (struct.isSetLastCompletionResult()) {
        oprot.writeBinary(struct.lastCompletionResult);
      }
      if (struct.isSetCronSchedule()) {
        oprot.writeString(struct.cronSchedule);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, ContinueAsNewWorkflowExecutionDecisionAttributes struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(12);
      if (incoming.get(0)) {
        struct.workflowType = new WorkflowType();
        struct.workflowType.read(iprot);
        struct.setWorkflowTypeIsSet(true);
      }
      if (incoming.get(1)) {
        struct.taskList = new TaskList();
        struct.taskList.read(iprot);
        struct.setTaskListIsSet(true);
      }
      if (incoming.get(2)) {
        struct.input = iprot.readBinary();
        struct.setInputIsSet(true);
      }
      if (incoming.get(3)) {
        struct.executionStartToCloseTimeoutSeconds = iprot.readI32();
        struct.setExecutionStartToCloseTimeoutSecondsIsSet(true);
      }
      if (incoming.get(4)) {
        struct.taskStartToCloseTimeoutSeconds = iprot.readI32();
        struct.setTaskStartToCloseTimeoutSecondsIsSet(true);
      }
      if (incoming.get(5)) {
        struct.backoffStartIntervalInSeconds = iprot.readI32();
        struct.setBackoffStartIntervalInSecondsIsSet(true);
      }
      if (incoming.get(6)) {
        struct.retryPolicy = new RetryPolicy();
        struct.retryPolicy.read(iprot);
        struct.setRetryPolicyIsSet(true);
      }
      if (incoming.get(7)) {
        struct.initiator = com.uber.cadence.ContinueAsNewInitiator.findByValue(iprot.readI32());
        struct.setInitiatorIsSet(true);
      }
      if (incoming.get(8)) {
        struct.failureReason = iprot.readString();
        struct.setFailureReasonIsSet(true);
      }
      if (incoming.get(9)) {
        struct.failureDetails = iprot.readBinary();
        struct.setFailureDetailsIsSet(true);
      }
      if (incoming.get(10)) {
        struct.lastCompletionResult = iprot.readBinary();
        struct.setLastCompletionResultIsSet(true);
      }
      if (incoming.get(11)) {
        struct.cronSchedule = iprot.readString();
        struct.setCronScheduleIsSet(true);
      }
    }
  }

}