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

com.uber.cadence.WorkflowExecutionContinuedAsNewEventAttributes 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 WorkflowExecutionContinuedAsNewEventAttributes 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("WorkflowExecutionContinuedAsNewEventAttributes");

  private static final org.apache.thrift.protocol.TField NEW_EXECUTION_RUN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("newExecutionRunId", org.apache.thrift.protocol.TType.STRING, (short)10);
  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)20);
  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)30);
  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)40);
  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)50);
  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)60);
  private static final org.apache.thrift.protocol.TField DECISION_TASK_COMPLETED_EVENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("decisionTaskCompletedEventId", org.apache.thrift.protocol.TType.I64, (short)70);
  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)80);
  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)90);
  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)100);
  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)110);
  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)120);

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

  public String newExecutionRunId; // optional
  public WorkflowType workflowType; // optional
  public TaskList taskList; // optional
  public ByteBuffer input; // optional
  public int executionStartToCloseTimeoutSeconds; // optional
  public int taskStartToCloseTimeoutSeconds; // optional
  public long decisionTaskCompletedEventId; // optional
  public int backoffStartIntervalInSeconds; // optional
  /**
   * 
   * @see ContinueAsNewInitiator
   */
  public ContinueAsNewInitiator initiator; // optional
  public String failureReason; // optional
  public ByteBuffer failureDetails; // optional
  public ByteBuffer lastCompletionResult; // 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 {
    NEW_EXECUTION_RUN_ID((short)10, "newExecutionRunId"),
    WORKFLOW_TYPE((short)20, "workflowType"),
    TASK_LIST((short)30, "taskList"),
    INPUT((short)40, "input"),
    EXECUTION_START_TO_CLOSE_TIMEOUT_SECONDS((short)50, "executionStartToCloseTimeoutSeconds"),
    TASK_START_TO_CLOSE_TIMEOUT_SECONDS((short)60, "taskStartToCloseTimeoutSeconds"),
    DECISION_TASK_COMPLETED_EVENT_ID((short)70, "decisionTaskCompletedEventId"),
    BACKOFF_START_INTERVAL_IN_SECONDS((short)80, "backoffStartIntervalInSeconds"),
    /**
     * 
     * @see ContinueAsNewInitiator
     */
    INITIATOR((short)90, "initiator"),
    FAILURE_REASON((short)100, "failureReason"),
    FAILURE_DETAILS((short)110, "failureDetails"),
    LAST_COMPLETION_RESULT((short)120, "lastCompletionResult");

    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: // NEW_EXECUTION_RUN_ID
          return NEW_EXECUTION_RUN_ID;
        case 20: // WORKFLOW_TYPE
          return WORKFLOW_TYPE;
        case 30: // TASK_LIST
          return TASK_LIST;
        case 40: // INPUT
          return INPUT;
        case 50: // EXECUTION_START_TO_CLOSE_TIMEOUT_SECONDS
          return EXECUTION_START_TO_CLOSE_TIMEOUT_SECONDS;
        case 60: // TASK_START_TO_CLOSE_TIMEOUT_SECONDS
          return TASK_START_TO_CLOSE_TIMEOUT_SECONDS;
        case 70: // DECISION_TASK_COMPLETED_EVENT_ID
          return DECISION_TASK_COMPLETED_EVENT_ID;
        case 80: // BACKOFF_START_INTERVAL_IN_SECONDS
          return BACKOFF_START_INTERVAL_IN_SECONDS;
        case 90: // INITIATOR
          return INITIATOR;
        case 100: // FAILURE_REASON
          return FAILURE_REASON;
        case 110: // FAILURE_DETAILS
          return FAILURE_DETAILS;
        case 120: // LAST_COMPLETION_RESULT
          return LAST_COMPLETION_RESULT;
        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 __DECISIONTASKCOMPLETEDEVENTID_ISSET_ID = 2;
  private static final int __BACKOFFSTARTINTERVALINSECONDS_ISSET_ID = 3;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.NEW_EXECUTION_RUN_ID,_Fields.WORKFLOW_TYPE,_Fields.TASK_LIST,_Fields.INPUT,_Fields.EXECUTION_START_TO_CLOSE_TIMEOUT_SECONDS,_Fields.TASK_START_TO_CLOSE_TIMEOUT_SECONDS,_Fields.DECISION_TASK_COMPLETED_EVENT_ID,_Fields.BACKOFF_START_INTERVAL_IN_SECONDS,_Fields.INITIATOR,_Fields.FAILURE_REASON,_Fields.FAILURE_DETAILS,_Fields.LAST_COMPLETION_RESULT};
  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.NEW_EXECUTION_RUN_ID, new org.apache.thrift.meta_data.FieldMetaData("newExecutionRunId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    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.DECISION_TASK_COMPLETED_EVENT_ID, new org.apache.thrift.meta_data.FieldMetaData("decisionTaskCompletedEventId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    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.INITIATOR, new org.apache.thrift.meta_data.FieldMetaData("initiator", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ContinueAsNewInitiator.class)));
    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)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(WorkflowExecutionContinuedAsNewEventAttributes.class, metaDataMap);
  }

  public WorkflowExecutionContinuedAsNewEventAttributes() {
  }

  /**
   * Performs a deep copy on other.
   */
  public WorkflowExecutionContinuedAsNewEventAttributes(WorkflowExecutionContinuedAsNewEventAttributes other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetNewExecutionRunId()) {
      this.newExecutionRunId = other.newExecutionRunId;
    }
    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.decisionTaskCompletedEventId = other.decisionTaskCompletedEventId;
    this.backoffStartIntervalInSeconds = other.backoffStartIntervalInSeconds;
    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);
    }
  }

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

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

  public String getNewExecutionRunId() {
    return this.newExecutionRunId;
  }

  public WorkflowExecutionContinuedAsNewEventAttributes setNewExecutionRunId(String newExecutionRunId) {
    this.newExecutionRunId = newExecutionRunId;
    return this;
  }

  public void unsetNewExecutionRunId() {
    this.newExecutionRunId = null;
  }

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

  public void setNewExecutionRunIdIsSet(boolean value) {
    if (!value) {
      this.newExecutionRunId = null;
    }
  }

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

  public WorkflowExecutionContinuedAsNewEventAttributes 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 WorkflowExecutionContinuedAsNewEventAttributes 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 WorkflowExecutionContinuedAsNewEventAttributes setInput(byte[] input) {
    this.input = input == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(input, input.length));
    return this;
  }

  public WorkflowExecutionContinuedAsNewEventAttributes 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 WorkflowExecutionContinuedAsNewEventAttributes 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 WorkflowExecutionContinuedAsNewEventAttributes 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 long getDecisionTaskCompletedEventId() {
    return this.decisionTaskCompletedEventId;
  }

  public WorkflowExecutionContinuedAsNewEventAttributes setDecisionTaskCompletedEventId(long decisionTaskCompletedEventId) {
    this.decisionTaskCompletedEventId = decisionTaskCompletedEventId;
    setDecisionTaskCompletedEventIdIsSet(true);
    return this;
  }

  public void unsetDecisionTaskCompletedEventId() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DECISIONTASKCOMPLETEDEVENTID_ISSET_ID);
  }

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

  public void setDecisionTaskCompletedEventIdIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DECISIONTASKCOMPLETEDEVENTID_ISSET_ID, value);
  }

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

  public WorkflowExecutionContinuedAsNewEventAttributes 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);
  }

  /**
   * 
   * @see ContinueAsNewInitiator
   */
  public ContinueAsNewInitiator getInitiator() {
    return this.initiator;
  }

  /**
   * 
   * @see ContinueAsNewInitiator
   */
  public WorkflowExecutionContinuedAsNewEventAttributes 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 WorkflowExecutionContinuedAsNewEventAttributes 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 WorkflowExecutionContinuedAsNewEventAttributes setFailureDetails(byte[] failureDetails) {
    this.failureDetails = failureDetails == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(failureDetails, failureDetails.length));
    return this;
  }

  public WorkflowExecutionContinuedAsNewEventAttributes 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 WorkflowExecutionContinuedAsNewEventAttributes setLastCompletionResult(byte[] lastCompletionResult) {
    this.lastCompletionResult = lastCompletionResult == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(lastCompletionResult, lastCompletionResult.length));
    return this;
  }

  public WorkflowExecutionContinuedAsNewEventAttributes 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 void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case NEW_EXECUTION_RUN_ID:
      if (value == null) {
        unsetNewExecutionRunId();
      } else {
        setNewExecutionRunId((String)value);
      }
      break;

    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 DECISION_TASK_COMPLETED_EVENT_ID:
      if (value == null) {
        unsetDecisionTaskCompletedEventId();
      } else {
        setDecisionTaskCompletedEventId((Long)value);
      }
      break;

    case BACKOFF_START_INTERVAL_IN_SECONDS:
      if (value == null) {
        unsetBackoffStartIntervalInSeconds();
      } else {
        setBackoffStartIntervalInSeconds((Integer)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;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case NEW_EXECUTION_RUN_ID:
      return getNewExecutionRunId();

    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 DECISION_TASK_COMPLETED_EVENT_ID:
      return getDecisionTaskCompletedEventId();

    case BACKOFF_START_INTERVAL_IN_SECONDS:
      return getBackoffStartIntervalInSeconds();

    case INITIATOR:
      return getInitiator();

    case FAILURE_REASON:
      return getFailureReason();

    case FAILURE_DETAILS:
      return getFailureDetails();

    case LAST_COMPLETION_RESULT:
      return getLastCompletionResult();

    }
    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 NEW_EXECUTION_RUN_ID:
      return isSetNewExecutionRunId();
    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 DECISION_TASK_COMPLETED_EVENT_ID:
      return isSetDecisionTaskCompletedEventId();
    case BACKOFF_START_INTERVAL_IN_SECONDS:
      return isSetBackoffStartIntervalInSeconds();
    case INITIATOR:
      return isSetInitiator();
    case FAILURE_REASON:
      return isSetFailureReason();
    case FAILURE_DETAILS:
      return isSetFailureDetails();
    case LAST_COMPLETION_RESULT:
      return isSetLastCompletionResult();
    }
    throw new IllegalStateException();
  }

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

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

    boolean this_present_newExecutionRunId = true && this.isSetNewExecutionRunId();
    boolean that_present_newExecutionRunId = true && that.isSetNewExecutionRunId();
    if (this_present_newExecutionRunId || that_present_newExecutionRunId) {
      if (!(this_present_newExecutionRunId && that_present_newExecutionRunId))
        return false;
      if (!this.newExecutionRunId.equals(that.newExecutionRunId))
        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_decisionTaskCompletedEventId = true && this.isSetDecisionTaskCompletedEventId();
    boolean that_present_decisionTaskCompletedEventId = true && that.isSetDecisionTaskCompletedEventId();
    if (this_present_decisionTaskCompletedEventId || that_present_decisionTaskCompletedEventId) {
      if (!(this_present_decisionTaskCompletedEventId && that_present_decisionTaskCompletedEventId))
        return false;
      if (this.decisionTaskCompletedEventId != that.decisionTaskCompletedEventId)
        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_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;
    }

    return true;
  }

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

    boolean present_newExecutionRunId = true && (isSetNewExecutionRunId());
    list.add(present_newExecutionRunId);
    if (present_newExecutionRunId)
      list.add(newExecutionRunId);

    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_decisionTaskCompletedEventId = true && (isSetDecisionTaskCompletedEventId());
    list.add(present_decisionTaskCompletedEventId);
    if (present_decisionTaskCompletedEventId)
      list.add(decisionTaskCompletedEventId);

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

    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);

    return list.hashCode();
  }

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

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetNewExecutionRunId()).compareTo(other.isSetNewExecutionRunId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetNewExecutionRunId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.newExecutionRunId, other.newExecutionRunId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    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(isSetDecisionTaskCompletedEventId()).compareTo(other.isSetDecisionTaskCompletedEventId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDecisionTaskCompletedEventId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.decisionTaskCompletedEventId, other.decisionTaskCompletedEventId);
      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(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;
      }
    }
    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("WorkflowExecutionContinuedAsNewEventAttributes(");
    boolean first = true;

    if (isSetNewExecutionRunId()) {
      sb.append("newExecutionRunId:");
      if (this.newExecutionRunId == null) {
        sb.append("null");
      } else {
        sb.append(this.newExecutionRunId);
      }
      first = false;
    }
    if (isSetWorkflowType()) {
      if (!first) sb.append(", ");
      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 (isSetDecisionTaskCompletedEventId()) {
      if (!first) sb.append(", ");
      sb.append("decisionTaskCompletedEventId:");
      sb.append(this.decisionTaskCompletedEventId);
      first = false;
    }
    if (isSetBackoffStartIntervalInSeconds()) {
      if (!first) sb.append(", ");
      sb.append("backoffStartIntervalInSeconds:");
      sb.append(this.backoffStartIntervalInSeconds);
      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;
    }
    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 WorkflowExecutionContinuedAsNewEventAttributesStandardSchemeFactory implements SchemeFactory {
    public WorkflowExecutionContinuedAsNewEventAttributesStandardScheme getScheme() {
      return new WorkflowExecutionContinuedAsNewEventAttributesStandardScheme();
    }
  }

  private static class WorkflowExecutionContinuedAsNewEventAttributesStandardScheme extends StandardScheme {

    public void read(org.apache.thrift.protocol.TProtocol iprot, WorkflowExecutionContinuedAsNewEventAttributes 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: // NEW_EXECUTION_RUN_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.newExecutionRunId = iprot.readString();
              struct.setNewExecutionRunIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 20: // 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 30: // 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 40: // 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 50: // 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 60: // 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 70: // DECISION_TASK_COMPLETED_EVENT_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.decisionTaskCompletedEventId = iprot.readI64();
              struct.setDecisionTaskCompletedEventIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 80: // 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 90: // 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 100: // 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 110: // 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 120: // 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;
          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, WorkflowExecutionContinuedAsNewEventAttributes struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.newExecutionRunId != null) {
        if (struct.isSetNewExecutionRunId()) {
          oprot.writeFieldBegin(NEW_EXECUTION_RUN_ID_FIELD_DESC);
          oprot.writeString(struct.newExecutionRunId);
          oprot.writeFieldEnd();
        }
      }
      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.isSetDecisionTaskCompletedEventId()) {
        oprot.writeFieldBegin(DECISION_TASK_COMPLETED_EVENT_ID_FIELD_DESC);
        oprot.writeI64(struct.decisionTaskCompletedEventId);
        oprot.writeFieldEnd();
      }
      if (struct.isSetBackoffStartIntervalInSeconds()) {
        oprot.writeFieldBegin(BACKOFF_START_INTERVAL_IN_SECONDS_FIELD_DESC);
        oprot.writeI32(struct.backoffStartIntervalInSeconds);
        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();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class WorkflowExecutionContinuedAsNewEventAttributesTupleSchemeFactory implements SchemeFactory {
    public WorkflowExecutionContinuedAsNewEventAttributesTupleScheme getScheme() {
      return new WorkflowExecutionContinuedAsNewEventAttributesTupleScheme();
    }
  }

  private static class WorkflowExecutionContinuedAsNewEventAttributesTupleScheme extends TupleScheme {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, WorkflowExecutionContinuedAsNewEventAttributes struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetNewExecutionRunId()) {
        optionals.set(0);
      }
      if (struct.isSetWorkflowType()) {
        optionals.set(1);
      }
      if (struct.isSetTaskList()) {
        optionals.set(2);
      }
      if (struct.isSetInput()) {
        optionals.set(3);
      }
      if (struct.isSetExecutionStartToCloseTimeoutSeconds()) {
        optionals.set(4);
      }
      if (struct.isSetTaskStartToCloseTimeoutSeconds()) {
        optionals.set(5);
      }
      if (struct.isSetDecisionTaskCompletedEventId()) {
        optionals.set(6);
      }
      if (struct.isSetBackoffStartIntervalInSeconds()) {
        optionals.set(7);
      }
      if (struct.isSetInitiator()) {
        optionals.set(8);
      }
      if (struct.isSetFailureReason()) {
        optionals.set(9);
      }
      if (struct.isSetFailureDetails()) {
        optionals.set(10);
      }
      if (struct.isSetLastCompletionResult()) {
        optionals.set(11);
      }
      oprot.writeBitSet(optionals, 12);
      if (struct.isSetNewExecutionRunId()) {
        oprot.writeString(struct.newExecutionRunId);
      }
      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.isSetDecisionTaskCompletedEventId()) {
        oprot.writeI64(struct.decisionTaskCompletedEventId);
      }
      if (struct.isSetBackoffStartIntervalInSeconds()) {
        oprot.writeI32(struct.backoffStartIntervalInSeconds);
      }
      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);
      }
    }

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

}