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

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

  private static final org.apache.thrift.protocol.TField DECISION_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("decisionType", org.apache.thrift.protocol.TType.I32, (short)10);
  private static final org.apache.thrift.protocol.TField SCHEDULE_ACTIVITY_TASK_DECISION_ATTRIBUTES_FIELD_DESC = new org.apache.thrift.protocol.TField("scheduleActivityTaskDecisionAttributes", org.apache.thrift.protocol.TType.STRUCT, (short)20);
  private static final org.apache.thrift.protocol.TField START_TIMER_DECISION_ATTRIBUTES_FIELD_DESC = new org.apache.thrift.protocol.TField("startTimerDecisionAttributes", org.apache.thrift.protocol.TType.STRUCT, (short)25);
  private static final org.apache.thrift.protocol.TField COMPLETE_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES_FIELD_DESC = new org.apache.thrift.protocol.TField("completeWorkflowExecutionDecisionAttributes", org.apache.thrift.protocol.TType.STRUCT, (short)30);
  private static final org.apache.thrift.protocol.TField FAIL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES_FIELD_DESC = new org.apache.thrift.protocol.TField("failWorkflowExecutionDecisionAttributes", org.apache.thrift.protocol.TType.STRUCT, (short)35);
  private static final org.apache.thrift.protocol.TField REQUEST_CANCEL_ACTIVITY_TASK_DECISION_ATTRIBUTES_FIELD_DESC = new org.apache.thrift.protocol.TField("requestCancelActivityTaskDecisionAttributes", org.apache.thrift.protocol.TType.STRUCT, (short)40);
  private static final org.apache.thrift.protocol.TField CANCEL_TIMER_DECISION_ATTRIBUTES_FIELD_DESC = new org.apache.thrift.protocol.TField("cancelTimerDecisionAttributes", org.apache.thrift.protocol.TType.STRUCT, (short)50);
  private static final org.apache.thrift.protocol.TField CANCEL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES_FIELD_DESC = new org.apache.thrift.protocol.TField("cancelWorkflowExecutionDecisionAttributes", org.apache.thrift.protocol.TType.STRUCT, (short)60);
  private static final org.apache.thrift.protocol.TField REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES_FIELD_DESC = new org.apache.thrift.protocol.TField("requestCancelExternalWorkflowExecutionDecisionAttributes", org.apache.thrift.protocol.TType.STRUCT, (short)70);
  private static final org.apache.thrift.protocol.TField RECORD_MARKER_DECISION_ATTRIBUTES_FIELD_DESC = new org.apache.thrift.protocol.TField("recordMarkerDecisionAttributes", org.apache.thrift.protocol.TType.STRUCT, (short)80);
  private static final org.apache.thrift.protocol.TField CONTINUE_AS_NEW_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES_FIELD_DESC = new org.apache.thrift.protocol.TField("continueAsNewWorkflowExecutionDecisionAttributes", org.apache.thrift.protocol.TType.STRUCT, (short)90);
  private static final org.apache.thrift.protocol.TField START_CHILD_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES_FIELD_DESC = new org.apache.thrift.protocol.TField("startChildWorkflowExecutionDecisionAttributes", org.apache.thrift.protocol.TType.STRUCT, (short)100);
  private static final org.apache.thrift.protocol.TField SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES_FIELD_DESC = new org.apache.thrift.protocol.TField("signalExternalWorkflowExecutionDecisionAttributes", org.apache.thrift.protocol.TType.STRUCT, (short)110);

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

  /**
   * 
   * @see DecisionType
   */
  public DecisionType decisionType; // optional
  public ScheduleActivityTaskDecisionAttributes scheduleActivityTaskDecisionAttributes; // optional
  public StartTimerDecisionAttributes startTimerDecisionAttributes; // optional
  public CompleteWorkflowExecutionDecisionAttributes completeWorkflowExecutionDecisionAttributes; // optional
  public FailWorkflowExecutionDecisionAttributes failWorkflowExecutionDecisionAttributes; // optional
  public RequestCancelActivityTaskDecisionAttributes requestCancelActivityTaskDecisionAttributes; // optional
  public CancelTimerDecisionAttributes cancelTimerDecisionAttributes; // optional
  public CancelWorkflowExecutionDecisionAttributes cancelWorkflowExecutionDecisionAttributes; // optional
  public RequestCancelExternalWorkflowExecutionDecisionAttributes requestCancelExternalWorkflowExecutionDecisionAttributes; // optional
  public RecordMarkerDecisionAttributes recordMarkerDecisionAttributes; // optional
  public ContinueAsNewWorkflowExecutionDecisionAttributes continueAsNewWorkflowExecutionDecisionAttributes; // optional
  public StartChildWorkflowExecutionDecisionAttributes startChildWorkflowExecutionDecisionAttributes; // optional
  public SignalExternalWorkflowExecutionDecisionAttributes signalExternalWorkflowExecutionDecisionAttributes; // 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 {
    /**
     * 
     * @see DecisionType
     */
    DECISION_TYPE((short)10, "decisionType"),
    SCHEDULE_ACTIVITY_TASK_DECISION_ATTRIBUTES((short)20, "scheduleActivityTaskDecisionAttributes"),
    START_TIMER_DECISION_ATTRIBUTES((short)25, "startTimerDecisionAttributes"),
    COMPLETE_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES((short)30, "completeWorkflowExecutionDecisionAttributes"),
    FAIL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES((short)35, "failWorkflowExecutionDecisionAttributes"),
    REQUEST_CANCEL_ACTIVITY_TASK_DECISION_ATTRIBUTES((short)40, "requestCancelActivityTaskDecisionAttributes"),
    CANCEL_TIMER_DECISION_ATTRIBUTES((short)50, "cancelTimerDecisionAttributes"),
    CANCEL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES((short)60, "cancelWorkflowExecutionDecisionAttributes"),
    REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES((short)70, "requestCancelExternalWorkflowExecutionDecisionAttributes"),
    RECORD_MARKER_DECISION_ATTRIBUTES((short)80, "recordMarkerDecisionAttributes"),
    CONTINUE_AS_NEW_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES((short)90, "continueAsNewWorkflowExecutionDecisionAttributes"),
    START_CHILD_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES((short)100, "startChildWorkflowExecutionDecisionAttributes"),
    SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES((short)110, "signalExternalWorkflowExecutionDecisionAttributes");

    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: // DECISION_TYPE
          return DECISION_TYPE;
        case 20: // SCHEDULE_ACTIVITY_TASK_DECISION_ATTRIBUTES
          return SCHEDULE_ACTIVITY_TASK_DECISION_ATTRIBUTES;
        case 25: // START_TIMER_DECISION_ATTRIBUTES
          return START_TIMER_DECISION_ATTRIBUTES;
        case 30: // COMPLETE_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES
          return COMPLETE_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES;
        case 35: // FAIL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES
          return FAIL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES;
        case 40: // REQUEST_CANCEL_ACTIVITY_TASK_DECISION_ATTRIBUTES
          return REQUEST_CANCEL_ACTIVITY_TASK_DECISION_ATTRIBUTES;
        case 50: // CANCEL_TIMER_DECISION_ATTRIBUTES
          return CANCEL_TIMER_DECISION_ATTRIBUTES;
        case 60: // CANCEL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES
          return CANCEL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES;
        case 70: // REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES
          return REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES;
        case 80: // RECORD_MARKER_DECISION_ATTRIBUTES
          return RECORD_MARKER_DECISION_ATTRIBUTES;
        case 90: // CONTINUE_AS_NEW_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES
          return CONTINUE_AS_NEW_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES;
        case 100: // START_CHILD_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES
          return START_CHILD_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES;
        case 110: // SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES
          return SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES;
        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 _Fields optionals[] = {_Fields.DECISION_TYPE,_Fields.SCHEDULE_ACTIVITY_TASK_DECISION_ATTRIBUTES,_Fields.START_TIMER_DECISION_ATTRIBUTES,_Fields.COMPLETE_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES,_Fields.FAIL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES,_Fields.REQUEST_CANCEL_ACTIVITY_TASK_DECISION_ATTRIBUTES,_Fields.CANCEL_TIMER_DECISION_ATTRIBUTES,_Fields.CANCEL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES,_Fields.REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES,_Fields.RECORD_MARKER_DECISION_ATTRIBUTES,_Fields.CONTINUE_AS_NEW_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES,_Fields.START_CHILD_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES,_Fields.SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES};
  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.DECISION_TYPE, new org.apache.thrift.meta_data.FieldMetaData("decisionType", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, DecisionType.class)));
    tmpMap.put(_Fields.SCHEDULE_ACTIVITY_TASK_DECISION_ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("scheduleActivityTaskDecisionAttributes", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ScheduleActivityTaskDecisionAttributes.class)));
    tmpMap.put(_Fields.START_TIMER_DECISION_ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("startTimerDecisionAttributes", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, StartTimerDecisionAttributes.class)));
    tmpMap.put(_Fields.COMPLETE_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("completeWorkflowExecutionDecisionAttributes", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CompleteWorkflowExecutionDecisionAttributes.class)));
    tmpMap.put(_Fields.FAIL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("failWorkflowExecutionDecisionAttributes", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, FailWorkflowExecutionDecisionAttributes.class)));
    tmpMap.put(_Fields.REQUEST_CANCEL_ACTIVITY_TASK_DECISION_ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("requestCancelActivityTaskDecisionAttributes", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RequestCancelActivityTaskDecisionAttributes.class)));
    tmpMap.put(_Fields.CANCEL_TIMER_DECISION_ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("cancelTimerDecisionAttributes", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CancelTimerDecisionAttributes.class)));
    tmpMap.put(_Fields.CANCEL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("cancelWorkflowExecutionDecisionAttributes", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CancelWorkflowExecutionDecisionAttributes.class)));
    tmpMap.put(_Fields.REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("requestCancelExternalWorkflowExecutionDecisionAttributes", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RequestCancelExternalWorkflowExecutionDecisionAttributes.class)));
    tmpMap.put(_Fields.RECORD_MARKER_DECISION_ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("recordMarkerDecisionAttributes", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RecordMarkerDecisionAttributes.class)));
    tmpMap.put(_Fields.CONTINUE_AS_NEW_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("continueAsNewWorkflowExecutionDecisionAttributes", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ContinueAsNewWorkflowExecutionDecisionAttributes.class)));
    tmpMap.put(_Fields.START_CHILD_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("startChildWorkflowExecutionDecisionAttributes", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, StartChildWorkflowExecutionDecisionAttributes.class)));
    tmpMap.put(_Fields.SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("signalExternalWorkflowExecutionDecisionAttributes", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SignalExternalWorkflowExecutionDecisionAttributes.class)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Decision.class, metaDataMap);
  }

  public Decision() {
  }

  /**
   * Performs a deep copy on other.
   */
  public Decision(Decision other) {
    if (other.isSetDecisionType()) {
      this.decisionType = other.decisionType;
    }
    if (other.isSetScheduleActivityTaskDecisionAttributes()) {
      this.scheduleActivityTaskDecisionAttributes = new ScheduleActivityTaskDecisionAttributes(other.scheduleActivityTaskDecisionAttributes);
    }
    if (other.isSetStartTimerDecisionAttributes()) {
      this.startTimerDecisionAttributes = new StartTimerDecisionAttributes(other.startTimerDecisionAttributes);
    }
    if (other.isSetCompleteWorkflowExecutionDecisionAttributes()) {
      this.completeWorkflowExecutionDecisionAttributes = new CompleteWorkflowExecutionDecisionAttributes(other.completeWorkflowExecutionDecisionAttributes);
    }
    if (other.isSetFailWorkflowExecutionDecisionAttributes()) {
      this.failWorkflowExecutionDecisionAttributes = new FailWorkflowExecutionDecisionAttributes(other.failWorkflowExecutionDecisionAttributes);
    }
    if (other.isSetRequestCancelActivityTaskDecisionAttributes()) {
      this.requestCancelActivityTaskDecisionAttributes = new RequestCancelActivityTaskDecisionAttributes(other.requestCancelActivityTaskDecisionAttributes);
    }
    if (other.isSetCancelTimerDecisionAttributes()) {
      this.cancelTimerDecisionAttributes = new CancelTimerDecisionAttributes(other.cancelTimerDecisionAttributes);
    }
    if (other.isSetCancelWorkflowExecutionDecisionAttributes()) {
      this.cancelWorkflowExecutionDecisionAttributes = new CancelWorkflowExecutionDecisionAttributes(other.cancelWorkflowExecutionDecisionAttributes);
    }
    if (other.isSetRequestCancelExternalWorkflowExecutionDecisionAttributes()) {
      this.requestCancelExternalWorkflowExecutionDecisionAttributes = new RequestCancelExternalWorkflowExecutionDecisionAttributes(other.requestCancelExternalWorkflowExecutionDecisionAttributes);
    }
    if (other.isSetRecordMarkerDecisionAttributes()) {
      this.recordMarkerDecisionAttributes = new RecordMarkerDecisionAttributes(other.recordMarkerDecisionAttributes);
    }
    if (other.isSetContinueAsNewWorkflowExecutionDecisionAttributes()) {
      this.continueAsNewWorkflowExecutionDecisionAttributes = new ContinueAsNewWorkflowExecutionDecisionAttributes(other.continueAsNewWorkflowExecutionDecisionAttributes);
    }
    if (other.isSetStartChildWorkflowExecutionDecisionAttributes()) {
      this.startChildWorkflowExecutionDecisionAttributes = new StartChildWorkflowExecutionDecisionAttributes(other.startChildWorkflowExecutionDecisionAttributes);
    }
    if (other.isSetSignalExternalWorkflowExecutionDecisionAttributes()) {
      this.signalExternalWorkflowExecutionDecisionAttributes = new SignalExternalWorkflowExecutionDecisionAttributes(other.signalExternalWorkflowExecutionDecisionAttributes);
    }
  }

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

  @Override
  public void clear() {
    this.decisionType = null;
    this.scheduleActivityTaskDecisionAttributes = null;
    this.startTimerDecisionAttributes = null;
    this.completeWorkflowExecutionDecisionAttributes = null;
    this.failWorkflowExecutionDecisionAttributes = null;
    this.requestCancelActivityTaskDecisionAttributes = null;
    this.cancelTimerDecisionAttributes = null;
    this.cancelWorkflowExecutionDecisionAttributes = null;
    this.requestCancelExternalWorkflowExecutionDecisionAttributes = null;
    this.recordMarkerDecisionAttributes = null;
    this.continueAsNewWorkflowExecutionDecisionAttributes = null;
    this.startChildWorkflowExecutionDecisionAttributes = null;
    this.signalExternalWorkflowExecutionDecisionAttributes = null;
  }

  /**
   * 
   * @see DecisionType
   */
  public DecisionType getDecisionType() {
    return this.decisionType;
  }

  /**
   * 
   * @see DecisionType
   */
  public Decision setDecisionType(DecisionType decisionType) {
    this.decisionType = decisionType;
    return this;
  }

  public void unsetDecisionType() {
    this.decisionType = null;
  }

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

  public void setDecisionTypeIsSet(boolean value) {
    if (!value) {
      this.decisionType = null;
    }
  }

  public ScheduleActivityTaskDecisionAttributes getScheduleActivityTaskDecisionAttributes() {
    return this.scheduleActivityTaskDecisionAttributes;
  }

  public Decision setScheduleActivityTaskDecisionAttributes(ScheduleActivityTaskDecisionAttributes scheduleActivityTaskDecisionAttributes) {
    this.scheduleActivityTaskDecisionAttributes = scheduleActivityTaskDecisionAttributes;
    return this;
  }

  public void unsetScheduleActivityTaskDecisionAttributes() {
    this.scheduleActivityTaskDecisionAttributes = null;
  }

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

  public void setScheduleActivityTaskDecisionAttributesIsSet(boolean value) {
    if (!value) {
      this.scheduleActivityTaskDecisionAttributes = null;
    }
  }

  public StartTimerDecisionAttributes getStartTimerDecisionAttributes() {
    return this.startTimerDecisionAttributes;
  }

  public Decision setStartTimerDecisionAttributes(StartTimerDecisionAttributes startTimerDecisionAttributes) {
    this.startTimerDecisionAttributes = startTimerDecisionAttributes;
    return this;
  }

  public void unsetStartTimerDecisionAttributes() {
    this.startTimerDecisionAttributes = null;
  }

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

  public void setStartTimerDecisionAttributesIsSet(boolean value) {
    if (!value) {
      this.startTimerDecisionAttributes = null;
    }
  }

  public CompleteWorkflowExecutionDecisionAttributes getCompleteWorkflowExecutionDecisionAttributes() {
    return this.completeWorkflowExecutionDecisionAttributes;
  }

  public Decision setCompleteWorkflowExecutionDecisionAttributes(CompleteWorkflowExecutionDecisionAttributes completeWorkflowExecutionDecisionAttributes) {
    this.completeWorkflowExecutionDecisionAttributes = completeWorkflowExecutionDecisionAttributes;
    return this;
  }

  public void unsetCompleteWorkflowExecutionDecisionAttributes() {
    this.completeWorkflowExecutionDecisionAttributes = null;
  }

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

  public void setCompleteWorkflowExecutionDecisionAttributesIsSet(boolean value) {
    if (!value) {
      this.completeWorkflowExecutionDecisionAttributes = null;
    }
  }

  public FailWorkflowExecutionDecisionAttributes getFailWorkflowExecutionDecisionAttributes() {
    return this.failWorkflowExecutionDecisionAttributes;
  }

  public Decision setFailWorkflowExecutionDecisionAttributes(FailWorkflowExecutionDecisionAttributes failWorkflowExecutionDecisionAttributes) {
    this.failWorkflowExecutionDecisionAttributes = failWorkflowExecutionDecisionAttributes;
    return this;
  }

  public void unsetFailWorkflowExecutionDecisionAttributes() {
    this.failWorkflowExecutionDecisionAttributes = null;
  }

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

  public void setFailWorkflowExecutionDecisionAttributesIsSet(boolean value) {
    if (!value) {
      this.failWorkflowExecutionDecisionAttributes = null;
    }
  }

  public RequestCancelActivityTaskDecisionAttributes getRequestCancelActivityTaskDecisionAttributes() {
    return this.requestCancelActivityTaskDecisionAttributes;
  }

  public Decision setRequestCancelActivityTaskDecisionAttributes(RequestCancelActivityTaskDecisionAttributes requestCancelActivityTaskDecisionAttributes) {
    this.requestCancelActivityTaskDecisionAttributes = requestCancelActivityTaskDecisionAttributes;
    return this;
  }

  public void unsetRequestCancelActivityTaskDecisionAttributes() {
    this.requestCancelActivityTaskDecisionAttributes = null;
  }

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

  public void setRequestCancelActivityTaskDecisionAttributesIsSet(boolean value) {
    if (!value) {
      this.requestCancelActivityTaskDecisionAttributes = null;
    }
  }

  public CancelTimerDecisionAttributes getCancelTimerDecisionAttributes() {
    return this.cancelTimerDecisionAttributes;
  }

  public Decision setCancelTimerDecisionAttributes(CancelTimerDecisionAttributes cancelTimerDecisionAttributes) {
    this.cancelTimerDecisionAttributes = cancelTimerDecisionAttributes;
    return this;
  }

  public void unsetCancelTimerDecisionAttributes() {
    this.cancelTimerDecisionAttributes = null;
  }

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

  public void setCancelTimerDecisionAttributesIsSet(boolean value) {
    if (!value) {
      this.cancelTimerDecisionAttributes = null;
    }
  }

  public CancelWorkflowExecutionDecisionAttributes getCancelWorkflowExecutionDecisionAttributes() {
    return this.cancelWorkflowExecutionDecisionAttributes;
  }

  public Decision setCancelWorkflowExecutionDecisionAttributes(CancelWorkflowExecutionDecisionAttributes cancelWorkflowExecutionDecisionAttributes) {
    this.cancelWorkflowExecutionDecisionAttributes = cancelWorkflowExecutionDecisionAttributes;
    return this;
  }

  public void unsetCancelWorkflowExecutionDecisionAttributes() {
    this.cancelWorkflowExecutionDecisionAttributes = null;
  }

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

  public void setCancelWorkflowExecutionDecisionAttributesIsSet(boolean value) {
    if (!value) {
      this.cancelWorkflowExecutionDecisionAttributes = null;
    }
  }

  public RequestCancelExternalWorkflowExecutionDecisionAttributes getRequestCancelExternalWorkflowExecutionDecisionAttributes() {
    return this.requestCancelExternalWorkflowExecutionDecisionAttributes;
  }

  public Decision setRequestCancelExternalWorkflowExecutionDecisionAttributes(RequestCancelExternalWorkflowExecutionDecisionAttributes requestCancelExternalWorkflowExecutionDecisionAttributes) {
    this.requestCancelExternalWorkflowExecutionDecisionAttributes = requestCancelExternalWorkflowExecutionDecisionAttributes;
    return this;
  }

  public void unsetRequestCancelExternalWorkflowExecutionDecisionAttributes() {
    this.requestCancelExternalWorkflowExecutionDecisionAttributes = null;
  }

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

  public void setRequestCancelExternalWorkflowExecutionDecisionAttributesIsSet(boolean value) {
    if (!value) {
      this.requestCancelExternalWorkflowExecutionDecisionAttributes = null;
    }
  }

  public RecordMarkerDecisionAttributes getRecordMarkerDecisionAttributes() {
    return this.recordMarkerDecisionAttributes;
  }

  public Decision setRecordMarkerDecisionAttributes(RecordMarkerDecisionAttributes recordMarkerDecisionAttributes) {
    this.recordMarkerDecisionAttributes = recordMarkerDecisionAttributes;
    return this;
  }

  public void unsetRecordMarkerDecisionAttributes() {
    this.recordMarkerDecisionAttributes = null;
  }

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

  public void setRecordMarkerDecisionAttributesIsSet(boolean value) {
    if (!value) {
      this.recordMarkerDecisionAttributes = null;
    }
  }

  public ContinueAsNewWorkflowExecutionDecisionAttributes getContinueAsNewWorkflowExecutionDecisionAttributes() {
    return this.continueAsNewWorkflowExecutionDecisionAttributes;
  }

  public Decision setContinueAsNewWorkflowExecutionDecisionAttributes(ContinueAsNewWorkflowExecutionDecisionAttributes continueAsNewWorkflowExecutionDecisionAttributes) {
    this.continueAsNewWorkflowExecutionDecisionAttributes = continueAsNewWorkflowExecutionDecisionAttributes;
    return this;
  }

  public void unsetContinueAsNewWorkflowExecutionDecisionAttributes() {
    this.continueAsNewWorkflowExecutionDecisionAttributes = null;
  }

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

  public void setContinueAsNewWorkflowExecutionDecisionAttributesIsSet(boolean value) {
    if (!value) {
      this.continueAsNewWorkflowExecutionDecisionAttributes = null;
    }
  }

  public StartChildWorkflowExecutionDecisionAttributes getStartChildWorkflowExecutionDecisionAttributes() {
    return this.startChildWorkflowExecutionDecisionAttributes;
  }

  public Decision setStartChildWorkflowExecutionDecisionAttributes(StartChildWorkflowExecutionDecisionAttributes startChildWorkflowExecutionDecisionAttributes) {
    this.startChildWorkflowExecutionDecisionAttributes = startChildWorkflowExecutionDecisionAttributes;
    return this;
  }

  public void unsetStartChildWorkflowExecutionDecisionAttributes() {
    this.startChildWorkflowExecutionDecisionAttributes = null;
  }

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

  public void setStartChildWorkflowExecutionDecisionAttributesIsSet(boolean value) {
    if (!value) {
      this.startChildWorkflowExecutionDecisionAttributes = null;
    }
  }

  public SignalExternalWorkflowExecutionDecisionAttributes getSignalExternalWorkflowExecutionDecisionAttributes() {
    return this.signalExternalWorkflowExecutionDecisionAttributes;
  }

  public Decision setSignalExternalWorkflowExecutionDecisionAttributes(SignalExternalWorkflowExecutionDecisionAttributes signalExternalWorkflowExecutionDecisionAttributes) {
    this.signalExternalWorkflowExecutionDecisionAttributes = signalExternalWorkflowExecutionDecisionAttributes;
    return this;
  }

  public void unsetSignalExternalWorkflowExecutionDecisionAttributes() {
    this.signalExternalWorkflowExecutionDecisionAttributes = null;
  }

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

  public void setSignalExternalWorkflowExecutionDecisionAttributesIsSet(boolean value) {
    if (!value) {
      this.signalExternalWorkflowExecutionDecisionAttributes = null;
    }
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case DECISION_TYPE:
      if (value == null) {
        unsetDecisionType();
      } else {
        setDecisionType((DecisionType)value);
      }
      break;

    case SCHEDULE_ACTIVITY_TASK_DECISION_ATTRIBUTES:
      if (value == null) {
        unsetScheduleActivityTaskDecisionAttributes();
      } else {
        setScheduleActivityTaskDecisionAttributes((ScheduleActivityTaskDecisionAttributes)value);
      }
      break;

    case START_TIMER_DECISION_ATTRIBUTES:
      if (value == null) {
        unsetStartTimerDecisionAttributes();
      } else {
        setStartTimerDecisionAttributes((StartTimerDecisionAttributes)value);
      }
      break;

    case COMPLETE_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES:
      if (value == null) {
        unsetCompleteWorkflowExecutionDecisionAttributes();
      } else {
        setCompleteWorkflowExecutionDecisionAttributes((CompleteWorkflowExecutionDecisionAttributes)value);
      }
      break;

    case FAIL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES:
      if (value == null) {
        unsetFailWorkflowExecutionDecisionAttributes();
      } else {
        setFailWorkflowExecutionDecisionAttributes((FailWorkflowExecutionDecisionAttributes)value);
      }
      break;

    case REQUEST_CANCEL_ACTIVITY_TASK_DECISION_ATTRIBUTES:
      if (value == null) {
        unsetRequestCancelActivityTaskDecisionAttributes();
      } else {
        setRequestCancelActivityTaskDecisionAttributes((RequestCancelActivityTaskDecisionAttributes)value);
      }
      break;

    case CANCEL_TIMER_DECISION_ATTRIBUTES:
      if (value == null) {
        unsetCancelTimerDecisionAttributes();
      } else {
        setCancelTimerDecisionAttributes((CancelTimerDecisionAttributes)value);
      }
      break;

    case CANCEL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES:
      if (value == null) {
        unsetCancelWorkflowExecutionDecisionAttributes();
      } else {
        setCancelWorkflowExecutionDecisionAttributes((CancelWorkflowExecutionDecisionAttributes)value);
      }
      break;

    case REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES:
      if (value == null) {
        unsetRequestCancelExternalWorkflowExecutionDecisionAttributes();
      } else {
        setRequestCancelExternalWorkflowExecutionDecisionAttributes((RequestCancelExternalWorkflowExecutionDecisionAttributes)value);
      }
      break;

    case RECORD_MARKER_DECISION_ATTRIBUTES:
      if (value == null) {
        unsetRecordMarkerDecisionAttributes();
      } else {
        setRecordMarkerDecisionAttributes((RecordMarkerDecisionAttributes)value);
      }
      break;

    case CONTINUE_AS_NEW_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES:
      if (value == null) {
        unsetContinueAsNewWorkflowExecutionDecisionAttributes();
      } else {
        setContinueAsNewWorkflowExecutionDecisionAttributes((ContinueAsNewWorkflowExecutionDecisionAttributes)value);
      }
      break;

    case START_CHILD_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES:
      if (value == null) {
        unsetStartChildWorkflowExecutionDecisionAttributes();
      } else {
        setStartChildWorkflowExecutionDecisionAttributes((StartChildWorkflowExecutionDecisionAttributes)value);
      }
      break;

    case SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES:
      if (value == null) {
        unsetSignalExternalWorkflowExecutionDecisionAttributes();
      } else {
        setSignalExternalWorkflowExecutionDecisionAttributes((SignalExternalWorkflowExecutionDecisionAttributes)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case DECISION_TYPE:
      return getDecisionType();

    case SCHEDULE_ACTIVITY_TASK_DECISION_ATTRIBUTES:
      return getScheduleActivityTaskDecisionAttributes();

    case START_TIMER_DECISION_ATTRIBUTES:
      return getStartTimerDecisionAttributes();

    case COMPLETE_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES:
      return getCompleteWorkflowExecutionDecisionAttributes();

    case FAIL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES:
      return getFailWorkflowExecutionDecisionAttributes();

    case REQUEST_CANCEL_ACTIVITY_TASK_DECISION_ATTRIBUTES:
      return getRequestCancelActivityTaskDecisionAttributes();

    case CANCEL_TIMER_DECISION_ATTRIBUTES:
      return getCancelTimerDecisionAttributes();

    case CANCEL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES:
      return getCancelWorkflowExecutionDecisionAttributes();

    case REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES:
      return getRequestCancelExternalWorkflowExecutionDecisionAttributes();

    case RECORD_MARKER_DECISION_ATTRIBUTES:
      return getRecordMarkerDecisionAttributes();

    case CONTINUE_AS_NEW_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES:
      return getContinueAsNewWorkflowExecutionDecisionAttributes();

    case START_CHILD_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES:
      return getStartChildWorkflowExecutionDecisionAttributes();

    case SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES:
      return getSignalExternalWorkflowExecutionDecisionAttributes();

    }
    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 DECISION_TYPE:
      return isSetDecisionType();
    case SCHEDULE_ACTIVITY_TASK_DECISION_ATTRIBUTES:
      return isSetScheduleActivityTaskDecisionAttributes();
    case START_TIMER_DECISION_ATTRIBUTES:
      return isSetStartTimerDecisionAttributes();
    case COMPLETE_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES:
      return isSetCompleteWorkflowExecutionDecisionAttributes();
    case FAIL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES:
      return isSetFailWorkflowExecutionDecisionAttributes();
    case REQUEST_CANCEL_ACTIVITY_TASK_DECISION_ATTRIBUTES:
      return isSetRequestCancelActivityTaskDecisionAttributes();
    case CANCEL_TIMER_DECISION_ATTRIBUTES:
      return isSetCancelTimerDecisionAttributes();
    case CANCEL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES:
      return isSetCancelWorkflowExecutionDecisionAttributes();
    case REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES:
      return isSetRequestCancelExternalWorkflowExecutionDecisionAttributes();
    case RECORD_MARKER_DECISION_ATTRIBUTES:
      return isSetRecordMarkerDecisionAttributes();
    case CONTINUE_AS_NEW_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES:
      return isSetContinueAsNewWorkflowExecutionDecisionAttributes();
    case START_CHILD_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES:
      return isSetStartChildWorkflowExecutionDecisionAttributes();
    case SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES:
      return isSetSignalExternalWorkflowExecutionDecisionAttributes();
    }
    throw new IllegalStateException();
  }

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

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

    boolean this_present_decisionType = true && this.isSetDecisionType();
    boolean that_present_decisionType = true && that.isSetDecisionType();
    if (this_present_decisionType || that_present_decisionType) {
      if (!(this_present_decisionType && that_present_decisionType))
        return false;
      if (!this.decisionType.equals(that.decisionType))
        return false;
    }

    boolean this_present_scheduleActivityTaskDecisionAttributes = true && this.isSetScheduleActivityTaskDecisionAttributes();
    boolean that_present_scheduleActivityTaskDecisionAttributes = true && that.isSetScheduleActivityTaskDecisionAttributes();
    if (this_present_scheduleActivityTaskDecisionAttributes || that_present_scheduleActivityTaskDecisionAttributes) {
      if (!(this_present_scheduleActivityTaskDecisionAttributes && that_present_scheduleActivityTaskDecisionAttributes))
        return false;
      if (!this.scheduleActivityTaskDecisionAttributes.equals(that.scheduleActivityTaskDecisionAttributes))
        return false;
    }

    boolean this_present_startTimerDecisionAttributes = true && this.isSetStartTimerDecisionAttributes();
    boolean that_present_startTimerDecisionAttributes = true && that.isSetStartTimerDecisionAttributes();
    if (this_present_startTimerDecisionAttributes || that_present_startTimerDecisionAttributes) {
      if (!(this_present_startTimerDecisionAttributes && that_present_startTimerDecisionAttributes))
        return false;
      if (!this.startTimerDecisionAttributes.equals(that.startTimerDecisionAttributes))
        return false;
    }

    boolean this_present_completeWorkflowExecutionDecisionAttributes = true && this.isSetCompleteWorkflowExecutionDecisionAttributes();
    boolean that_present_completeWorkflowExecutionDecisionAttributes = true && that.isSetCompleteWorkflowExecutionDecisionAttributes();
    if (this_present_completeWorkflowExecutionDecisionAttributes || that_present_completeWorkflowExecutionDecisionAttributes) {
      if (!(this_present_completeWorkflowExecutionDecisionAttributes && that_present_completeWorkflowExecutionDecisionAttributes))
        return false;
      if (!this.completeWorkflowExecutionDecisionAttributes.equals(that.completeWorkflowExecutionDecisionAttributes))
        return false;
    }

    boolean this_present_failWorkflowExecutionDecisionAttributes = true && this.isSetFailWorkflowExecutionDecisionAttributes();
    boolean that_present_failWorkflowExecutionDecisionAttributes = true && that.isSetFailWorkflowExecutionDecisionAttributes();
    if (this_present_failWorkflowExecutionDecisionAttributes || that_present_failWorkflowExecutionDecisionAttributes) {
      if (!(this_present_failWorkflowExecutionDecisionAttributes && that_present_failWorkflowExecutionDecisionAttributes))
        return false;
      if (!this.failWorkflowExecutionDecisionAttributes.equals(that.failWorkflowExecutionDecisionAttributes))
        return false;
    }

    boolean this_present_requestCancelActivityTaskDecisionAttributes = true && this.isSetRequestCancelActivityTaskDecisionAttributes();
    boolean that_present_requestCancelActivityTaskDecisionAttributes = true && that.isSetRequestCancelActivityTaskDecisionAttributes();
    if (this_present_requestCancelActivityTaskDecisionAttributes || that_present_requestCancelActivityTaskDecisionAttributes) {
      if (!(this_present_requestCancelActivityTaskDecisionAttributes && that_present_requestCancelActivityTaskDecisionAttributes))
        return false;
      if (!this.requestCancelActivityTaskDecisionAttributes.equals(that.requestCancelActivityTaskDecisionAttributes))
        return false;
    }

    boolean this_present_cancelTimerDecisionAttributes = true && this.isSetCancelTimerDecisionAttributes();
    boolean that_present_cancelTimerDecisionAttributes = true && that.isSetCancelTimerDecisionAttributes();
    if (this_present_cancelTimerDecisionAttributes || that_present_cancelTimerDecisionAttributes) {
      if (!(this_present_cancelTimerDecisionAttributes && that_present_cancelTimerDecisionAttributes))
        return false;
      if (!this.cancelTimerDecisionAttributes.equals(that.cancelTimerDecisionAttributes))
        return false;
    }

    boolean this_present_cancelWorkflowExecutionDecisionAttributes = true && this.isSetCancelWorkflowExecutionDecisionAttributes();
    boolean that_present_cancelWorkflowExecutionDecisionAttributes = true && that.isSetCancelWorkflowExecutionDecisionAttributes();
    if (this_present_cancelWorkflowExecutionDecisionAttributes || that_present_cancelWorkflowExecutionDecisionAttributes) {
      if (!(this_present_cancelWorkflowExecutionDecisionAttributes && that_present_cancelWorkflowExecutionDecisionAttributes))
        return false;
      if (!this.cancelWorkflowExecutionDecisionAttributes.equals(that.cancelWorkflowExecutionDecisionAttributes))
        return false;
    }

    boolean this_present_requestCancelExternalWorkflowExecutionDecisionAttributes = true && this.isSetRequestCancelExternalWorkflowExecutionDecisionAttributes();
    boolean that_present_requestCancelExternalWorkflowExecutionDecisionAttributes = true && that.isSetRequestCancelExternalWorkflowExecutionDecisionAttributes();
    if (this_present_requestCancelExternalWorkflowExecutionDecisionAttributes || that_present_requestCancelExternalWorkflowExecutionDecisionAttributes) {
      if (!(this_present_requestCancelExternalWorkflowExecutionDecisionAttributes && that_present_requestCancelExternalWorkflowExecutionDecisionAttributes))
        return false;
      if (!this.requestCancelExternalWorkflowExecutionDecisionAttributes.equals(that.requestCancelExternalWorkflowExecutionDecisionAttributes))
        return false;
    }

    boolean this_present_recordMarkerDecisionAttributes = true && this.isSetRecordMarkerDecisionAttributes();
    boolean that_present_recordMarkerDecisionAttributes = true && that.isSetRecordMarkerDecisionAttributes();
    if (this_present_recordMarkerDecisionAttributes || that_present_recordMarkerDecisionAttributes) {
      if (!(this_present_recordMarkerDecisionAttributes && that_present_recordMarkerDecisionAttributes))
        return false;
      if (!this.recordMarkerDecisionAttributes.equals(that.recordMarkerDecisionAttributes))
        return false;
    }

    boolean this_present_continueAsNewWorkflowExecutionDecisionAttributes = true && this.isSetContinueAsNewWorkflowExecutionDecisionAttributes();
    boolean that_present_continueAsNewWorkflowExecutionDecisionAttributes = true && that.isSetContinueAsNewWorkflowExecutionDecisionAttributes();
    if (this_present_continueAsNewWorkflowExecutionDecisionAttributes || that_present_continueAsNewWorkflowExecutionDecisionAttributes) {
      if (!(this_present_continueAsNewWorkflowExecutionDecisionAttributes && that_present_continueAsNewWorkflowExecutionDecisionAttributes))
        return false;
      if (!this.continueAsNewWorkflowExecutionDecisionAttributes.equals(that.continueAsNewWorkflowExecutionDecisionAttributes))
        return false;
    }

    boolean this_present_startChildWorkflowExecutionDecisionAttributes = true && this.isSetStartChildWorkflowExecutionDecisionAttributes();
    boolean that_present_startChildWorkflowExecutionDecisionAttributes = true && that.isSetStartChildWorkflowExecutionDecisionAttributes();
    if (this_present_startChildWorkflowExecutionDecisionAttributes || that_present_startChildWorkflowExecutionDecisionAttributes) {
      if (!(this_present_startChildWorkflowExecutionDecisionAttributes && that_present_startChildWorkflowExecutionDecisionAttributes))
        return false;
      if (!this.startChildWorkflowExecutionDecisionAttributes.equals(that.startChildWorkflowExecutionDecisionAttributes))
        return false;
    }

    boolean this_present_signalExternalWorkflowExecutionDecisionAttributes = true && this.isSetSignalExternalWorkflowExecutionDecisionAttributes();
    boolean that_present_signalExternalWorkflowExecutionDecisionAttributes = true && that.isSetSignalExternalWorkflowExecutionDecisionAttributes();
    if (this_present_signalExternalWorkflowExecutionDecisionAttributes || that_present_signalExternalWorkflowExecutionDecisionAttributes) {
      if (!(this_present_signalExternalWorkflowExecutionDecisionAttributes && that_present_signalExternalWorkflowExecutionDecisionAttributes))
        return false;
      if (!this.signalExternalWorkflowExecutionDecisionAttributes.equals(that.signalExternalWorkflowExecutionDecisionAttributes))
        return false;
    }

    return true;
  }

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

    boolean present_decisionType = true && (isSetDecisionType());
    list.add(present_decisionType);
    if (present_decisionType)
      list.add(decisionType.getValue());

    boolean present_scheduleActivityTaskDecisionAttributes = true && (isSetScheduleActivityTaskDecisionAttributes());
    list.add(present_scheduleActivityTaskDecisionAttributes);
    if (present_scheduleActivityTaskDecisionAttributes)
      list.add(scheduleActivityTaskDecisionAttributes);

    boolean present_startTimerDecisionAttributes = true && (isSetStartTimerDecisionAttributes());
    list.add(present_startTimerDecisionAttributes);
    if (present_startTimerDecisionAttributes)
      list.add(startTimerDecisionAttributes);

    boolean present_completeWorkflowExecutionDecisionAttributes = true && (isSetCompleteWorkflowExecutionDecisionAttributes());
    list.add(present_completeWorkflowExecutionDecisionAttributes);
    if (present_completeWorkflowExecutionDecisionAttributes)
      list.add(completeWorkflowExecutionDecisionAttributes);

    boolean present_failWorkflowExecutionDecisionAttributes = true && (isSetFailWorkflowExecutionDecisionAttributes());
    list.add(present_failWorkflowExecutionDecisionAttributes);
    if (present_failWorkflowExecutionDecisionAttributes)
      list.add(failWorkflowExecutionDecisionAttributes);

    boolean present_requestCancelActivityTaskDecisionAttributes = true && (isSetRequestCancelActivityTaskDecisionAttributes());
    list.add(present_requestCancelActivityTaskDecisionAttributes);
    if (present_requestCancelActivityTaskDecisionAttributes)
      list.add(requestCancelActivityTaskDecisionAttributes);

    boolean present_cancelTimerDecisionAttributes = true && (isSetCancelTimerDecisionAttributes());
    list.add(present_cancelTimerDecisionAttributes);
    if (present_cancelTimerDecisionAttributes)
      list.add(cancelTimerDecisionAttributes);

    boolean present_cancelWorkflowExecutionDecisionAttributes = true && (isSetCancelWorkflowExecutionDecisionAttributes());
    list.add(present_cancelWorkflowExecutionDecisionAttributes);
    if (present_cancelWorkflowExecutionDecisionAttributes)
      list.add(cancelWorkflowExecutionDecisionAttributes);

    boolean present_requestCancelExternalWorkflowExecutionDecisionAttributes = true && (isSetRequestCancelExternalWorkflowExecutionDecisionAttributes());
    list.add(present_requestCancelExternalWorkflowExecutionDecisionAttributes);
    if (present_requestCancelExternalWorkflowExecutionDecisionAttributes)
      list.add(requestCancelExternalWorkflowExecutionDecisionAttributes);

    boolean present_recordMarkerDecisionAttributes = true && (isSetRecordMarkerDecisionAttributes());
    list.add(present_recordMarkerDecisionAttributes);
    if (present_recordMarkerDecisionAttributes)
      list.add(recordMarkerDecisionAttributes);

    boolean present_continueAsNewWorkflowExecutionDecisionAttributes = true && (isSetContinueAsNewWorkflowExecutionDecisionAttributes());
    list.add(present_continueAsNewWorkflowExecutionDecisionAttributes);
    if (present_continueAsNewWorkflowExecutionDecisionAttributes)
      list.add(continueAsNewWorkflowExecutionDecisionAttributes);

    boolean present_startChildWorkflowExecutionDecisionAttributes = true && (isSetStartChildWorkflowExecutionDecisionAttributes());
    list.add(present_startChildWorkflowExecutionDecisionAttributes);
    if (present_startChildWorkflowExecutionDecisionAttributes)
      list.add(startChildWorkflowExecutionDecisionAttributes);

    boolean present_signalExternalWorkflowExecutionDecisionAttributes = true && (isSetSignalExternalWorkflowExecutionDecisionAttributes());
    list.add(present_signalExternalWorkflowExecutionDecisionAttributes);
    if (present_signalExternalWorkflowExecutionDecisionAttributes)
      list.add(signalExternalWorkflowExecutionDecisionAttributes);

    return list.hashCode();
  }

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

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetDecisionType()).compareTo(other.isSetDecisionType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDecisionType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.decisionType, other.decisionType);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetScheduleActivityTaskDecisionAttributes()).compareTo(other.isSetScheduleActivityTaskDecisionAttributes());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetScheduleActivityTaskDecisionAttributes()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scheduleActivityTaskDecisionAttributes, other.scheduleActivityTaskDecisionAttributes);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetStartTimerDecisionAttributes()).compareTo(other.isSetStartTimerDecisionAttributes());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStartTimerDecisionAttributes()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startTimerDecisionAttributes, other.startTimerDecisionAttributes);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCompleteWorkflowExecutionDecisionAttributes()).compareTo(other.isSetCompleteWorkflowExecutionDecisionAttributes());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCompleteWorkflowExecutionDecisionAttributes()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.completeWorkflowExecutionDecisionAttributes, other.completeWorkflowExecutionDecisionAttributes);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetFailWorkflowExecutionDecisionAttributes()).compareTo(other.isSetFailWorkflowExecutionDecisionAttributes());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFailWorkflowExecutionDecisionAttributes()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.failWorkflowExecutionDecisionAttributes, other.failWorkflowExecutionDecisionAttributes);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetRequestCancelActivityTaskDecisionAttributes()).compareTo(other.isSetRequestCancelActivityTaskDecisionAttributes());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRequestCancelActivityTaskDecisionAttributes()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.requestCancelActivityTaskDecisionAttributes, other.requestCancelActivityTaskDecisionAttributes);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCancelTimerDecisionAttributes()).compareTo(other.isSetCancelTimerDecisionAttributes());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCancelTimerDecisionAttributes()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cancelTimerDecisionAttributes, other.cancelTimerDecisionAttributes);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCancelWorkflowExecutionDecisionAttributes()).compareTo(other.isSetCancelWorkflowExecutionDecisionAttributes());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCancelWorkflowExecutionDecisionAttributes()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cancelWorkflowExecutionDecisionAttributes, other.cancelWorkflowExecutionDecisionAttributes);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetRequestCancelExternalWorkflowExecutionDecisionAttributes()).compareTo(other.isSetRequestCancelExternalWorkflowExecutionDecisionAttributes());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRequestCancelExternalWorkflowExecutionDecisionAttributes()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.requestCancelExternalWorkflowExecutionDecisionAttributes, other.requestCancelExternalWorkflowExecutionDecisionAttributes);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetRecordMarkerDecisionAttributes()).compareTo(other.isSetRecordMarkerDecisionAttributes());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRecordMarkerDecisionAttributes()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.recordMarkerDecisionAttributes, other.recordMarkerDecisionAttributes);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetContinueAsNewWorkflowExecutionDecisionAttributes()).compareTo(other.isSetContinueAsNewWorkflowExecutionDecisionAttributes());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetContinueAsNewWorkflowExecutionDecisionAttributes()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.continueAsNewWorkflowExecutionDecisionAttributes, other.continueAsNewWorkflowExecutionDecisionAttributes);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetStartChildWorkflowExecutionDecisionAttributes()).compareTo(other.isSetStartChildWorkflowExecutionDecisionAttributes());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStartChildWorkflowExecutionDecisionAttributes()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startChildWorkflowExecutionDecisionAttributes, other.startChildWorkflowExecutionDecisionAttributes);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSignalExternalWorkflowExecutionDecisionAttributes()).compareTo(other.isSetSignalExternalWorkflowExecutionDecisionAttributes());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSignalExternalWorkflowExecutionDecisionAttributes()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.signalExternalWorkflowExecutionDecisionAttributes, other.signalExternalWorkflowExecutionDecisionAttributes);
      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("Decision(");
    boolean first = true;

    if (isSetDecisionType()) {
      sb.append("decisionType:");
      if (this.decisionType == null) {
        sb.append("null");
      } else {
        sb.append(this.decisionType);
      }
      first = false;
    }
    if (isSetScheduleActivityTaskDecisionAttributes()) {
      if (!first) sb.append(", ");
      sb.append("scheduleActivityTaskDecisionAttributes:");
      if (this.scheduleActivityTaskDecisionAttributes == null) {
        sb.append("null");
      } else {
        sb.append(this.scheduleActivityTaskDecisionAttributes);
      }
      first = false;
    }
    if (isSetStartTimerDecisionAttributes()) {
      if (!first) sb.append(", ");
      sb.append("startTimerDecisionAttributes:");
      if (this.startTimerDecisionAttributes == null) {
        sb.append("null");
      } else {
        sb.append(this.startTimerDecisionAttributes);
      }
      first = false;
    }
    if (isSetCompleteWorkflowExecutionDecisionAttributes()) {
      if (!first) sb.append(", ");
      sb.append("completeWorkflowExecutionDecisionAttributes:");
      if (this.completeWorkflowExecutionDecisionAttributes == null) {
        sb.append("null");
      } else {
        sb.append(this.completeWorkflowExecutionDecisionAttributes);
      }
      first = false;
    }
    if (isSetFailWorkflowExecutionDecisionAttributes()) {
      if (!first) sb.append(", ");
      sb.append("failWorkflowExecutionDecisionAttributes:");
      if (this.failWorkflowExecutionDecisionAttributes == null) {
        sb.append("null");
      } else {
        sb.append(this.failWorkflowExecutionDecisionAttributes);
      }
      first = false;
    }
    if (isSetRequestCancelActivityTaskDecisionAttributes()) {
      if (!first) sb.append(", ");
      sb.append("requestCancelActivityTaskDecisionAttributes:");
      if (this.requestCancelActivityTaskDecisionAttributes == null) {
        sb.append("null");
      } else {
        sb.append(this.requestCancelActivityTaskDecisionAttributes);
      }
      first = false;
    }
    if (isSetCancelTimerDecisionAttributes()) {
      if (!first) sb.append(", ");
      sb.append("cancelTimerDecisionAttributes:");
      if (this.cancelTimerDecisionAttributes == null) {
        sb.append("null");
      } else {
        sb.append(this.cancelTimerDecisionAttributes);
      }
      first = false;
    }
    if (isSetCancelWorkflowExecutionDecisionAttributes()) {
      if (!first) sb.append(", ");
      sb.append("cancelWorkflowExecutionDecisionAttributes:");
      if (this.cancelWorkflowExecutionDecisionAttributes == null) {
        sb.append("null");
      } else {
        sb.append(this.cancelWorkflowExecutionDecisionAttributes);
      }
      first = false;
    }
    if (isSetRequestCancelExternalWorkflowExecutionDecisionAttributes()) {
      if (!first) sb.append(", ");
      sb.append("requestCancelExternalWorkflowExecutionDecisionAttributes:");
      if (this.requestCancelExternalWorkflowExecutionDecisionAttributes == null) {
        sb.append("null");
      } else {
        sb.append(this.requestCancelExternalWorkflowExecutionDecisionAttributes);
      }
      first = false;
    }
    if (isSetRecordMarkerDecisionAttributes()) {
      if (!first) sb.append(", ");
      sb.append("recordMarkerDecisionAttributes:");
      if (this.recordMarkerDecisionAttributes == null) {
        sb.append("null");
      } else {
        sb.append(this.recordMarkerDecisionAttributes);
      }
      first = false;
    }
    if (isSetContinueAsNewWorkflowExecutionDecisionAttributes()) {
      if (!first) sb.append(", ");
      sb.append("continueAsNewWorkflowExecutionDecisionAttributes:");
      if (this.continueAsNewWorkflowExecutionDecisionAttributes == null) {
        sb.append("null");
      } else {
        sb.append(this.continueAsNewWorkflowExecutionDecisionAttributes);
      }
      first = false;
    }
    if (isSetStartChildWorkflowExecutionDecisionAttributes()) {
      if (!first) sb.append(", ");
      sb.append("startChildWorkflowExecutionDecisionAttributes:");
      if (this.startChildWorkflowExecutionDecisionAttributes == null) {
        sb.append("null");
      } else {
        sb.append(this.startChildWorkflowExecutionDecisionAttributes);
      }
      first = false;
    }
    if (isSetSignalExternalWorkflowExecutionDecisionAttributes()) {
      if (!first) sb.append(", ");
      sb.append("signalExternalWorkflowExecutionDecisionAttributes:");
      if (this.signalExternalWorkflowExecutionDecisionAttributes == null) {
        sb.append("null");
      } else {
        sb.append(this.signalExternalWorkflowExecutionDecisionAttributes);
      }
      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 (scheduleActivityTaskDecisionAttributes != null) {
      scheduleActivityTaskDecisionAttributes.validate();
    }
    if (startTimerDecisionAttributes != null) {
      startTimerDecisionAttributes.validate();
    }
    if (completeWorkflowExecutionDecisionAttributes != null) {
      completeWorkflowExecutionDecisionAttributes.validate();
    }
    if (failWorkflowExecutionDecisionAttributes != null) {
      failWorkflowExecutionDecisionAttributes.validate();
    }
    if (requestCancelActivityTaskDecisionAttributes != null) {
      requestCancelActivityTaskDecisionAttributes.validate();
    }
    if (cancelTimerDecisionAttributes != null) {
      cancelTimerDecisionAttributes.validate();
    }
    if (cancelWorkflowExecutionDecisionAttributes != null) {
      cancelWorkflowExecutionDecisionAttributes.validate();
    }
    if (requestCancelExternalWorkflowExecutionDecisionAttributes != null) {
      requestCancelExternalWorkflowExecutionDecisionAttributes.validate();
    }
    if (recordMarkerDecisionAttributes != null) {
      recordMarkerDecisionAttributes.validate();
    }
    if (continueAsNewWorkflowExecutionDecisionAttributes != null) {
      continueAsNewWorkflowExecutionDecisionAttributes.validate();
    }
    if (startChildWorkflowExecutionDecisionAttributes != null) {
      startChildWorkflowExecutionDecisionAttributes.validate();
    }
    if (signalExternalWorkflowExecutionDecisionAttributes != null) {
      signalExternalWorkflowExecutionDecisionAttributes.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 {
      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 DecisionStandardSchemeFactory implements SchemeFactory {
    public DecisionStandardScheme getScheme() {
      return new DecisionStandardScheme();
    }
  }

  private static class DecisionStandardScheme extends StandardScheme {

    public void read(org.apache.thrift.protocol.TProtocol iprot, Decision 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: // DECISION_TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.decisionType = com.uber.cadence.DecisionType.findByValue(iprot.readI32());
              struct.setDecisionTypeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 20: // SCHEDULE_ACTIVITY_TASK_DECISION_ATTRIBUTES
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.scheduleActivityTaskDecisionAttributes = new ScheduleActivityTaskDecisionAttributes();
              struct.scheduleActivityTaskDecisionAttributes.read(iprot);
              struct.setScheduleActivityTaskDecisionAttributesIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 25: // START_TIMER_DECISION_ATTRIBUTES
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.startTimerDecisionAttributes = new StartTimerDecisionAttributes();
              struct.startTimerDecisionAttributes.read(iprot);
              struct.setStartTimerDecisionAttributesIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 30: // COMPLETE_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.completeWorkflowExecutionDecisionAttributes = new CompleteWorkflowExecutionDecisionAttributes();
              struct.completeWorkflowExecutionDecisionAttributes.read(iprot);
              struct.setCompleteWorkflowExecutionDecisionAttributesIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 35: // FAIL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.failWorkflowExecutionDecisionAttributes = new FailWorkflowExecutionDecisionAttributes();
              struct.failWorkflowExecutionDecisionAttributes.read(iprot);
              struct.setFailWorkflowExecutionDecisionAttributesIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 40: // REQUEST_CANCEL_ACTIVITY_TASK_DECISION_ATTRIBUTES
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.requestCancelActivityTaskDecisionAttributes = new RequestCancelActivityTaskDecisionAttributes();
              struct.requestCancelActivityTaskDecisionAttributes.read(iprot);
              struct.setRequestCancelActivityTaskDecisionAttributesIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 50: // CANCEL_TIMER_DECISION_ATTRIBUTES
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.cancelTimerDecisionAttributes = new CancelTimerDecisionAttributes();
              struct.cancelTimerDecisionAttributes.read(iprot);
              struct.setCancelTimerDecisionAttributesIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 60: // CANCEL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.cancelWorkflowExecutionDecisionAttributes = new CancelWorkflowExecutionDecisionAttributes();
              struct.cancelWorkflowExecutionDecisionAttributes.read(iprot);
              struct.setCancelWorkflowExecutionDecisionAttributesIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 70: // REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.requestCancelExternalWorkflowExecutionDecisionAttributes = new RequestCancelExternalWorkflowExecutionDecisionAttributes();
              struct.requestCancelExternalWorkflowExecutionDecisionAttributes.read(iprot);
              struct.setRequestCancelExternalWorkflowExecutionDecisionAttributesIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 80: // RECORD_MARKER_DECISION_ATTRIBUTES
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.recordMarkerDecisionAttributes = new RecordMarkerDecisionAttributes();
              struct.recordMarkerDecisionAttributes.read(iprot);
              struct.setRecordMarkerDecisionAttributesIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 90: // CONTINUE_AS_NEW_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.continueAsNewWorkflowExecutionDecisionAttributes = new ContinueAsNewWorkflowExecutionDecisionAttributes();
              struct.continueAsNewWorkflowExecutionDecisionAttributes.read(iprot);
              struct.setContinueAsNewWorkflowExecutionDecisionAttributesIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 100: // START_CHILD_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.startChildWorkflowExecutionDecisionAttributes = new StartChildWorkflowExecutionDecisionAttributes();
              struct.startChildWorkflowExecutionDecisionAttributes.read(iprot);
              struct.setStartChildWorkflowExecutionDecisionAttributesIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 110: // SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.signalExternalWorkflowExecutionDecisionAttributes = new SignalExternalWorkflowExecutionDecisionAttributes();
              struct.signalExternalWorkflowExecutionDecisionAttributes.read(iprot);
              struct.setSignalExternalWorkflowExecutionDecisionAttributesIsSet(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, Decision struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.decisionType != null) {
        if (struct.isSetDecisionType()) {
          oprot.writeFieldBegin(DECISION_TYPE_FIELD_DESC);
          oprot.writeI32(struct.decisionType.getValue());
          oprot.writeFieldEnd();
        }
      }
      if (struct.scheduleActivityTaskDecisionAttributes != null) {
        if (struct.isSetScheduleActivityTaskDecisionAttributes()) {
          oprot.writeFieldBegin(SCHEDULE_ACTIVITY_TASK_DECISION_ATTRIBUTES_FIELD_DESC);
          struct.scheduleActivityTaskDecisionAttributes.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.startTimerDecisionAttributes != null) {
        if (struct.isSetStartTimerDecisionAttributes()) {
          oprot.writeFieldBegin(START_TIMER_DECISION_ATTRIBUTES_FIELD_DESC);
          struct.startTimerDecisionAttributes.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.completeWorkflowExecutionDecisionAttributes != null) {
        if (struct.isSetCompleteWorkflowExecutionDecisionAttributes()) {
          oprot.writeFieldBegin(COMPLETE_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES_FIELD_DESC);
          struct.completeWorkflowExecutionDecisionAttributes.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.failWorkflowExecutionDecisionAttributes != null) {
        if (struct.isSetFailWorkflowExecutionDecisionAttributes()) {
          oprot.writeFieldBegin(FAIL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES_FIELD_DESC);
          struct.failWorkflowExecutionDecisionAttributes.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.requestCancelActivityTaskDecisionAttributes != null) {
        if (struct.isSetRequestCancelActivityTaskDecisionAttributes()) {
          oprot.writeFieldBegin(REQUEST_CANCEL_ACTIVITY_TASK_DECISION_ATTRIBUTES_FIELD_DESC);
          struct.requestCancelActivityTaskDecisionAttributes.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.cancelTimerDecisionAttributes != null) {
        if (struct.isSetCancelTimerDecisionAttributes()) {
          oprot.writeFieldBegin(CANCEL_TIMER_DECISION_ATTRIBUTES_FIELD_DESC);
          struct.cancelTimerDecisionAttributes.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.cancelWorkflowExecutionDecisionAttributes != null) {
        if (struct.isSetCancelWorkflowExecutionDecisionAttributes()) {
          oprot.writeFieldBegin(CANCEL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES_FIELD_DESC);
          struct.cancelWorkflowExecutionDecisionAttributes.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.requestCancelExternalWorkflowExecutionDecisionAttributes != null) {
        if (struct.isSetRequestCancelExternalWorkflowExecutionDecisionAttributes()) {
          oprot.writeFieldBegin(REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES_FIELD_DESC);
          struct.requestCancelExternalWorkflowExecutionDecisionAttributes.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.recordMarkerDecisionAttributes != null) {
        if (struct.isSetRecordMarkerDecisionAttributes()) {
          oprot.writeFieldBegin(RECORD_MARKER_DECISION_ATTRIBUTES_FIELD_DESC);
          struct.recordMarkerDecisionAttributes.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.continueAsNewWorkflowExecutionDecisionAttributes != null) {
        if (struct.isSetContinueAsNewWorkflowExecutionDecisionAttributes()) {
          oprot.writeFieldBegin(CONTINUE_AS_NEW_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES_FIELD_DESC);
          struct.continueAsNewWorkflowExecutionDecisionAttributes.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.startChildWorkflowExecutionDecisionAttributes != null) {
        if (struct.isSetStartChildWorkflowExecutionDecisionAttributes()) {
          oprot.writeFieldBegin(START_CHILD_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES_FIELD_DESC);
          struct.startChildWorkflowExecutionDecisionAttributes.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.signalExternalWorkflowExecutionDecisionAttributes != null) {
        if (struct.isSetSignalExternalWorkflowExecutionDecisionAttributes()) {
          oprot.writeFieldBegin(SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_DECISION_ATTRIBUTES_FIELD_DESC);
          struct.signalExternalWorkflowExecutionDecisionAttributes.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class DecisionTupleSchemeFactory implements SchemeFactory {
    public DecisionTupleScheme getScheme() {
      return new DecisionTupleScheme();
    }
  }

  private static class DecisionTupleScheme extends TupleScheme {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, Decision struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetDecisionType()) {
        optionals.set(0);
      }
      if (struct.isSetScheduleActivityTaskDecisionAttributes()) {
        optionals.set(1);
      }
      if (struct.isSetStartTimerDecisionAttributes()) {
        optionals.set(2);
      }
      if (struct.isSetCompleteWorkflowExecutionDecisionAttributes()) {
        optionals.set(3);
      }
      if (struct.isSetFailWorkflowExecutionDecisionAttributes()) {
        optionals.set(4);
      }
      if (struct.isSetRequestCancelActivityTaskDecisionAttributes()) {
        optionals.set(5);
      }
      if (struct.isSetCancelTimerDecisionAttributes()) {
        optionals.set(6);
      }
      if (struct.isSetCancelWorkflowExecutionDecisionAttributes()) {
        optionals.set(7);
      }
      if (struct.isSetRequestCancelExternalWorkflowExecutionDecisionAttributes()) {
        optionals.set(8);
      }
      if (struct.isSetRecordMarkerDecisionAttributes()) {
        optionals.set(9);
      }
      if (struct.isSetContinueAsNewWorkflowExecutionDecisionAttributes()) {
        optionals.set(10);
      }
      if (struct.isSetStartChildWorkflowExecutionDecisionAttributes()) {
        optionals.set(11);
      }
      if (struct.isSetSignalExternalWorkflowExecutionDecisionAttributes()) {
        optionals.set(12);
      }
      oprot.writeBitSet(optionals, 13);
      if (struct.isSetDecisionType()) {
        oprot.writeI32(struct.decisionType.getValue());
      }
      if (struct.isSetScheduleActivityTaskDecisionAttributes()) {
        struct.scheduleActivityTaskDecisionAttributes.write(oprot);
      }
      if (struct.isSetStartTimerDecisionAttributes()) {
        struct.startTimerDecisionAttributes.write(oprot);
      }
      if (struct.isSetCompleteWorkflowExecutionDecisionAttributes()) {
        struct.completeWorkflowExecutionDecisionAttributes.write(oprot);
      }
      if (struct.isSetFailWorkflowExecutionDecisionAttributes()) {
        struct.failWorkflowExecutionDecisionAttributes.write(oprot);
      }
      if (struct.isSetRequestCancelActivityTaskDecisionAttributes()) {
        struct.requestCancelActivityTaskDecisionAttributes.write(oprot);
      }
      if (struct.isSetCancelTimerDecisionAttributes()) {
        struct.cancelTimerDecisionAttributes.write(oprot);
      }
      if (struct.isSetCancelWorkflowExecutionDecisionAttributes()) {
        struct.cancelWorkflowExecutionDecisionAttributes.write(oprot);
      }
      if (struct.isSetRequestCancelExternalWorkflowExecutionDecisionAttributes()) {
        struct.requestCancelExternalWorkflowExecutionDecisionAttributes.write(oprot);
      }
      if (struct.isSetRecordMarkerDecisionAttributes()) {
        struct.recordMarkerDecisionAttributes.write(oprot);
      }
      if (struct.isSetContinueAsNewWorkflowExecutionDecisionAttributes()) {
        struct.continueAsNewWorkflowExecutionDecisionAttributes.write(oprot);
      }
      if (struct.isSetStartChildWorkflowExecutionDecisionAttributes()) {
        struct.startChildWorkflowExecutionDecisionAttributes.write(oprot);
      }
      if (struct.isSetSignalExternalWorkflowExecutionDecisionAttributes()) {
        struct.signalExternalWorkflowExecutionDecisionAttributes.write(oprot);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, Decision struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(13);
      if (incoming.get(0)) {
        struct.decisionType = com.uber.cadence.DecisionType.findByValue(iprot.readI32());
        struct.setDecisionTypeIsSet(true);
      }
      if (incoming.get(1)) {
        struct.scheduleActivityTaskDecisionAttributes = new ScheduleActivityTaskDecisionAttributes();
        struct.scheduleActivityTaskDecisionAttributes.read(iprot);
        struct.setScheduleActivityTaskDecisionAttributesIsSet(true);
      }
      if (incoming.get(2)) {
        struct.startTimerDecisionAttributes = new StartTimerDecisionAttributes();
        struct.startTimerDecisionAttributes.read(iprot);
        struct.setStartTimerDecisionAttributesIsSet(true);
      }
      if (incoming.get(3)) {
        struct.completeWorkflowExecutionDecisionAttributes = new CompleteWorkflowExecutionDecisionAttributes();
        struct.completeWorkflowExecutionDecisionAttributes.read(iprot);
        struct.setCompleteWorkflowExecutionDecisionAttributesIsSet(true);
      }
      if (incoming.get(4)) {
        struct.failWorkflowExecutionDecisionAttributes = new FailWorkflowExecutionDecisionAttributes();
        struct.failWorkflowExecutionDecisionAttributes.read(iprot);
        struct.setFailWorkflowExecutionDecisionAttributesIsSet(true);
      }
      if (incoming.get(5)) {
        struct.requestCancelActivityTaskDecisionAttributes = new RequestCancelActivityTaskDecisionAttributes();
        struct.requestCancelActivityTaskDecisionAttributes.read(iprot);
        struct.setRequestCancelActivityTaskDecisionAttributesIsSet(true);
      }
      if (incoming.get(6)) {
        struct.cancelTimerDecisionAttributes = new CancelTimerDecisionAttributes();
        struct.cancelTimerDecisionAttributes.read(iprot);
        struct.setCancelTimerDecisionAttributesIsSet(true);
      }
      if (incoming.get(7)) {
        struct.cancelWorkflowExecutionDecisionAttributes = new CancelWorkflowExecutionDecisionAttributes();
        struct.cancelWorkflowExecutionDecisionAttributes.read(iprot);
        struct.setCancelWorkflowExecutionDecisionAttributesIsSet(true);
      }
      if (incoming.get(8)) {
        struct.requestCancelExternalWorkflowExecutionDecisionAttributes = new RequestCancelExternalWorkflowExecutionDecisionAttributes();
        struct.requestCancelExternalWorkflowExecutionDecisionAttributes.read(iprot);
        struct.setRequestCancelExternalWorkflowExecutionDecisionAttributesIsSet(true);
      }
      if (incoming.get(9)) {
        struct.recordMarkerDecisionAttributes = new RecordMarkerDecisionAttributes();
        struct.recordMarkerDecisionAttributes.read(iprot);
        struct.setRecordMarkerDecisionAttributesIsSet(true);
      }
      if (incoming.get(10)) {
        struct.continueAsNewWorkflowExecutionDecisionAttributes = new ContinueAsNewWorkflowExecutionDecisionAttributes();
        struct.continueAsNewWorkflowExecutionDecisionAttributes.read(iprot);
        struct.setContinueAsNewWorkflowExecutionDecisionAttributesIsSet(true);
      }
      if (incoming.get(11)) {
        struct.startChildWorkflowExecutionDecisionAttributes = new StartChildWorkflowExecutionDecisionAttributes();
        struct.startChildWorkflowExecutionDecisionAttributes.read(iprot);
        struct.setStartChildWorkflowExecutionDecisionAttributesIsSet(true);
      }
      if (incoming.get(12)) {
        struct.signalExternalWorkflowExecutionDecisionAttributes = new SignalExternalWorkflowExecutionDecisionAttributes();
        struct.signalExternalWorkflowExecutionDecisionAttributes.read(iprot);
        struct.setSignalExternalWorkflowExecutionDecisionAttributesIsSet(true);
      }
    }
  }

}