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

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

  private static final org.apache.thrift.protocol.TField ACTIVITY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("activityId", org.apache.thrift.protocol.TType.STRING, (short)10);
  private static final org.apache.thrift.protocol.TField ACTIVITY_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("activityType", org.apache.thrift.protocol.TType.STRUCT, (short)20);
  private static final org.apache.thrift.protocol.TField DOMAIN_FIELD_DESC = new org.apache.thrift.protocol.TField("domain", org.apache.thrift.protocol.TType.STRING, (short)25);
  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 SCHEDULE_TO_CLOSE_TIMEOUT_SECONDS_FIELD_DESC = new org.apache.thrift.protocol.TField("scheduleToCloseTimeoutSeconds", org.apache.thrift.protocol.TType.I32, (short)45);
  private static final org.apache.thrift.protocol.TField SCHEDULE_TO_START_TIMEOUT_SECONDS_FIELD_DESC = new org.apache.thrift.protocol.TField("scheduleToStartTimeoutSeconds", org.apache.thrift.protocol.TType.I32, (short)50);
  private static final org.apache.thrift.protocol.TField START_TO_CLOSE_TIMEOUT_SECONDS_FIELD_DESC = new org.apache.thrift.protocol.TField("startToCloseTimeoutSeconds", org.apache.thrift.protocol.TType.I32, (short)55);
  private static final org.apache.thrift.protocol.TField HEARTBEAT_TIMEOUT_SECONDS_FIELD_DESC = new org.apache.thrift.protocol.TField("heartbeatTimeoutSeconds", org.apache.thrift.protocol.TType.I32, (short)60);
  private static final org.apache.thrift.protocol.TField RETRY_POLICY_FIELD_DESC = new org.apache.thrift.protocol.TField("retryPolicy", org.apache.thrift.protocol.TType.STRUCT, (short)70);

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

  public String activityId; // optional
  public ActivityType activityType; // optional
  public String domain; // optional
  public TaskList taskList; // optional
  public ByteBuffer input; // optional
  public int scheduleToCloseTimeoutSeconds; // optional
  public int scheduleToStartTimeoutSeconds; // optional
  public int startToCloseTimeoutSeconds; // optional
  public int heartbeatTimeoutSeconds; // optional
  public RetryPolicy retryPolicy; // 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 {
    ACTIVITY_ID((short)10, "activityId"),
    ACTIVITY_TYPE((short)20, "activityType"),
    DOMAIN((short)25, "domain"),
    TASK_LIST((short)30, "taskList"),
    INPUT((short)40, "input"),
    SCHEDULE_TO_CLOSE_TIMEOUT_SECONDS((short)45, "scheduleToCloseTimeoutSeconds"),
    SCHEDULE_TO_START_TIMEOUT_SECONDS((short)50, "scheduleToStartTimeoutSeconds"),
    START_TO_CLOSE_TIMEOUT_SECONDS((short)55, "startToCloseTimeoutSeconds"),
    HEARTBEAT_TIMEOUT_SECONDS((short)60, "heartbeatTimeoutSeconds"),
    RETRY_POLICY((short)70, "retryPolicy");

    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: // ACTIVITY_ID
          return ACTIVITY_ID;
        case 20: // ACTIVITY_TYPE
          return ACTIVITY_TYPE;
        case 25: // DOMAIN
          return DOMAIN;
        case 30: // TASK_LIST
          return TASK_LIST;
        case 40: // INPUT
          return INPUT;
        case 45: // SCHEDULE_TO_CLOSE_TIMEOUT_SECONDS
          return SCHEDULE_TO_CLOSE_TIMEOUT_SECONDS;
        case 50: // SCHEDULE_TO_START_TIMEOUT_SECONDS
          return SCHEDULE_TO_START_TIMEOUT_SECONDS;
        case 55: // START_TO_CLOSE_TIMEOUT_SECONDS
          return START_TO_CLOSE_TIMEOUT_SECONDS;
        case 60: // HEARTBEAT_TIMEOUT_SECONDS
          return HEARTBEAT_TIMEOUT_SECONDS;
        case 70: // RETRY_POLICY
          return RETRY_POLICY;
        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 __SCHEDULETOCLOSETIMEOUTSECONDS_ISSET_ID = 0;
  private static final int __SCHEDULETOSTARTTIMEOUTSECONDS_ISSET_ID = 1;
  private static final int __STARTTOCLOSETIMEOUTSECONDS_ISSET_ID = 2;
  private static final int __HEARTBEATTIMEOUTSECONDS_ISSET_ID = 3;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.ACTIVITY_ID,_Fields.ACTIVITY_TYPE,_Fields.DOMAIN,_Fields.TASK_LIST,_Fields.INPUT,_Fields.SCHEDULE_TO_CLOSE_TIMEOUT_SECONDS,_Fields.SCHEDULE_TO_START_TIMEOUT_SECONDS,_Fields.START_TO_CLOSE_TIMEOUT_SECONDS,_Fields.HEARTBEAT_TIMEOUT_SECONDS,_Fields.RETRY_POLICY};
  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.ACTIVITY_ID, new org.apache.thrift.meta_data.FieldMetaData("activityId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.ACTIVITY_TYPE, new org.apache.thrift.meta_data.FieldMetaData("activityType", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ActivityType.class)));
    tmpMap.put(_Fields.DOMAIN, new org.apache.thrift.meta_data.FieldMetaData("domain", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    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.SCHEDULE_TO_CLOSE_TIMEOUT_SECONDS, new org.apache.thrift.meta_data.FieldMetaData("scheduleToCloseTimeoutSeconds", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.SCHEDULE_TO_START_TIMEOUT_SECONDS, new org.apache.thrift.meta_data.FieldMetaData("scheduleToStartTimeoutSeconds", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.START_TO_CLOSE_TIMEOUT_SECONDS, new org.apache.thrift.meta_data.FieldMetaData("startToCloseTimeoutSeconds", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.HEARTBEAT_TIMEOUT_SECONDS, new org.apache.thrift.meta_data.FieldMetaData("heartbeatTimeoutSeconds", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.RETRY_POLICY, new org.apache.thrift.meta_data.FieldMetaData("retryPolicy", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT        , "RetryPolicy")));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ScheduleActivityTaskDecisionAttributes.class, metaDataMap);
  }

  public ScheduleActivityTaskDecisionAttributes() {
  }

  /**
   * Performs a deep copy on other.
   */
  public ScheduleActivityTaskDecisionAttributes(ScheduleActivityTaskDecisionAttributes other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetActivityId()) {
      this.activityId = other.activityId;
    }
    if (other.isSetActivityType()) {
      this.activityType = new ActivityType(other.activityType);
    }
    if (other.isSetDomain()) {
      this.domain = other.domain;
    }
    if (other.isSetTaskList()) {
      this.taskList = new TaskList(other.taskList);
    }
    if (other.isSetInput()) {
      this.input = org.apache.thrift.TBaseHelper.copyBinary(other.input);
    }
    this.scheduleToCloseTimeoutSeconds = other.scheduleToCloseTimeoutSeconds;
    this.scheduleToStartTimeoutSeconds = other.scheduleToStartTimeoutSeconds;
    this.startToCloseTimeoutSeconds = other.startToCloseTimeoutSeconds;
    this.heartbeatTimeoutSeconds = other.heartbeatTimeoutSeconds;
    if (other.isSetRetryPolicy()) {
      this.retryPolicy = other.retryPolicy;
    }
  }

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

  @Override
  public void clear() {
    this.activityId = null;
    this.activityType = null;
    this.domain = null;
    this.taskList = null;
    this.input = null;
    setScheduleToCloseTimeoutSecondsIsSet(false);
    this.scheduleToCloseTimeoutSeconds = 0;
    setScheduleToStartTimeoutSecondsIsSet(false);
    this.scheduleToStartTimeoutSeconds = 0;
    setStartToCloseTimeoutSecondsIsSet(false);
    this.startToCloseTimeoutSeconds = 0;
    setHeartbeatTimeoutSecondsIsSet(false);
    this.heartbeatTimeoutSeconds = 0;
    this.retryPolicy = null;
  }

  public String getActivityId() {
    return this.activityId;
  }

  public ScheduleActivityTaskDecisionAttributes setActivityId(String activityId) {
    this.activityId = activityId;
    return this;
  }

  public void unsetActivityId() {
    this.activityId = null;
  }

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

  public void setActivityIdIsSet(boolean value) {
    if (!value) {
      this.activityId = null;
    }
  }

  public ActivityType getActivityType() {
    return this.activityType;
  }

  public ScheduleActivityTaskDecisionAttributes setActivityType(ActivityType activityType) {
    this.activityType = activityType;
    return this;
  }

  public void unsetActivityType() {
    this.activityType = null;
  }

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

  public void setActivityTypeIsSet(boolean value) {
    if (!value) {
      this.activityType = null;
    }
  }

  public String getDomain() {
    return this.domain;
  }

  public ScheduleActivityTaskDecisionAttributes setDomain(String domain) {
    this.domain = domain;
    return this;
  }

  public void unsetDomain() {
    this.domain = null;
  }

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

  public void setDomainIsSet(boolean value) {
    if (!value) {
      this.domain = null;
    }
  }

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

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

  public ScheduleActivityTaskDecisionAttributes 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 getScheduleToCloseTimeoutSeconds() {
    return this.scheduleToCloseTimeoutSeconds;
  }

  public ScheduleActivityTaskDecisionAttributes setScheduleToCloseTimeoutSeconds(int scheduleToCloseTimeoutSeconds) {
    this.scheduleToCloseTimeoutSeconds = scheduleToCloseTimeoutSeconds;
    setScheduleToCloseTimeoutSecondsIsSet(true);
    return this;
  }

  public void unsetScheduleToCloseTimeoutSeconds() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SCHEDULETOCLOSETIMEOUTSECONDS_ISSET_ID);
  }

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

  public void setScheduleToCloseTimeoutSecondsIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SCHEDULETOCLOSETIMEOUTSECONDS_ISSET_ID, value);
  }

  public int getScheduleToStartTimeoutSeconds() {
    return this.scheduleToStartTimeoutSeconds;
  }

  public ScheduleActivityTaskDecisionAttributes setScheduleToStartTimeoutSeconds(int scheduleToStartTimeoutSeconds) {
    this.scheduleToStartTimeoutSeconds = scheduleToStartTimeoutSeconds;
    setScheduleToStartTimeoutSecondsIsSet(true);
    return this;
  }

  public void unsetScheduleToStartTimeoutSeconds() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SCHEDULETOSTARTTIMEOUTSECONDS_ISSET_ID);
  }

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

  public void setScheduleToStartTimeoutSecondsIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SCHEDULETOSTARTTIMEOUTSECONDS_ISSET_ID, value);
  }

  public int getStartToCloseTimeoutSeconds() {
    return this.startToCloseTimeoutSeconds;
  }

  public ScheduleActivityTaskDecisionAttributes setStartToCloseTimeoutSeconds(int startToCloseTimeoutSeconds) {
    this.startToCloseTimeoutSeconds = startToCloseTimeoutSeconds;
    setStartToCloseTimeoutSecondsIsSet(true);
    return this;
  }

  public void unsetStartToCloseTimeoutSeconds() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STARTTOCLOSETIMEOUTSECONDS_ISSET_ID);
  }

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

  public void setStartToCloseTimeoutSecondsIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STARTTOCLOSETIMEOUTSECONDS_ISSET_ID, value);
  }

  public int getHeartbeatTimeoutSeconds() {
    return this.heartbeatTimeoutSeconds;
  }

  public ScheduleActivityTaskDecisionAttributes setHeartbeatTimeoutSeconds(int heartbeatTimeoutSeconds) {
    this.heartbeatTimeoutSeconds = heartbeatTimeoutSeconds;
    setHeartbeatTimeoutSecondsIsSet(true);
    return this;
  }

  public void unsetHeartbeatTimeoutSeconds() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __HEARTBEATTIMEOUTSECONDS_ISSET_ID);
  }

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

  public void setHeartbeatTimeoutSecondsIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __HEARTBEATTIMEOUTSECONDS_ISSET_ID, value);
  }

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

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

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

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

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

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case ACTIVITY_ID:
      if (value == null) {
        unsetActivityId();
      } else {
        setActivityId((String)value);
      }
      break;

    case ACTIVITY_TYPE:
      if (value == null) {
        unsetActivityType();
      } else {
        setActivityType((ActivityType)value);
      }
      break;

    case DOMAIN:
      if (value == null) {
        unsetDomain();
      } else {
        setDomain((String)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 SCHEDULE_TO_CLOSE_TIMEOUT_SECONDS:
      if (value == null) {
        unsetScheduleToCloseTimeoutSeconds();
      } else {
        setScheduleToCloseTimeoutSeconds((Integer)value);
      }
      break;

    case SCHEDULE_TO_START_TIMEOUT_SECONDS:
      if (value == null) {
        unsetScheduleToStartTimeoutSeconds();
      } else {
        setScheduleToStartTimeoutSeconds((Integer)value);
      }
      break;

    case START_TO_CLOSE_TIMEOUT_SECONDS:
      if (value == null) {
        unsetStartToCloseTimeoutSeconds();
      } else {
        setStartToCloseTimeoutSeconds((Integer)value);
      }
      break;

    case HEARTBEAT_TIMEOUT_SECONDS:
      if (value == null) {
        unsetHeartbeatTimeoutSeconds();
      } else {
        setHeartbeatTimeoutSeconds((Integer)value);
      }
      break;

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

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case ACTIVITY_ID:
      return getActivityId();

    case ACTIVITY_TYPE:
      return getActivityType();

    case DOMAIN:
      return getDomain();

    case TASK_LIST:
      return getTaskList();

    case INPUT:
      return getInput();

    case SCHEDULE_TO_CLOSE_TIMEOUT_SECONDS:
      return getScheduleToCloseTimeoutSeconds();

    case SCHEDULE_TO_START_TIMEOUT_SECONDS:
      return getScheduleToStartTimeoutSeconds();

    case START_TO_CLOSE_TIMEOUT_SECONDS:
      return getStartToCloseTimeoutSeconds();

    case HEARTBEAT_TIMEOUT_SECONDS:
      return getHeartbeatTimeoutSeconds();

    case RETRY_POLICY:
      return getRetryPolicy();

    }
    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 ACTIVITY_ID:
      return isSetActivityId();
    case ACTIVITY_TYPE:
      return isSetActivityType();
    case DOMAIN:
      return isSetDomain();
    case TASK_LIST:
      return isSetTaskList();
    case INPUT:
      return isSetInput();
    case SCHEDULE_TO_CLOSE_TIMEOUT_SECONDS:
      return isSetScheduleToCloseTimeoutSeconds();
    case SCHEDULE_TO_START_TIMEOUT_SECONDS:
      return isSetScheduleToStartTimeoutSeconds();
    case START_TO_CLOSE_TIMEOUT_SECONDS:
      return isSetStartToCloseTimeoutSeconds();
    case HEARTBEAT_TIMEOUT_SECONDS:
      return isSetHeartbeatTimeoutSeconds();
    case RETRY_POLICY:
      return isSetRetryPolicy();
    }
    throw new IllegalStateException();
  }

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

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

    boolean this_present_activityId = true && this.isSetActivityId();
    boolean that_present_activityId = true && that.isSetActivityId();
    if (this_present_activityId || that_present_activityId) {
      if (!(this_present_activityId && that_present_activityId))
        return false;
      if (!this.activityId.equals(that.activityId))
        return false;
    }

    boolean this_present_activityType = true && this.isSetActivityType();
    boolean that_present_activityType = true && that.isSetActivityType();
    if (this_present_activityType || that_present_activityType) {
      if (!(this_present_activityType && that_present_activityType))
        return false;
      if (!this.activityType.equals(that.activityType))
        return false;
    }

    boolean this_present_domain = true && this.isSetDomain();
    boolean that_present_domain = true && that.isSetDomain();
    if (this_present_domain || that_present_domain) {
      if (!(this_present_domain && that_present_domain))
        return false;
      if (!this.domain.equals(that.domain))
        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_scheduleToCloseTimeoutSeconds = true && this.isSetScheduleToCloseTimeoutSeconds();
    boolean that_present_scheduleToCloseTimeoutSeconds = true && that.isSetScheduleToCloseTimeoutSeconds();
    if (this_present_scheduleToCloseTimeoutSeconds || that_present_scheduleToCloseTimeoutSeconds) {
      if (!(this_present_scheduleToCloseTimeoutSeconds && that_present_scheduleToCloseTimeoutSeconds))
        return false;
      if (this.scheduleToCloseTimeoutSeconds != that.scheduleToCloseTimeoutSeconds)
        return false;
    }

    boolean this_present_scheduleToStartTimeoutSeconds = true && this.isSetScheduleToStartTimeoutSeconds();
    boolean that_present_scheduleToStartTimeoutSeconds = true && that.isSetScheduleToStartTimeoutSeconds();
    if (this_present_scheduleToStartTimeoutSeconds || that_present_scheduleToStartTimeoutSeconds) {
      if (!(this_present_scheduleToStartTimeoutSeconds && that_present_scheduleToStartTimeoutSeconds))
        return false;
      if (this.scheduleToStartTimeoutSeconds != that.scheduleToStartTimeoutSeconds)
        return false;
    }

    boolean this_present_startToCloseTimeoutSeconds = true && this.isSetStartToCloseTimeoutSeconds();
    boolean that_present_startToCloseTimeoutSeconds = true && that.isSetStartToCloseTimeoutSeconds();
    if (this_present_startToCloseTimeoutSeconds || that_present_startToCloseTimeoutSeconds) {
      if (!(this_present_startToCloseTimeoutSeconds && that_present_startToCloseTimeoutSeconds))
        return false;
      if (this.startToCloseTimeoutSeconds != that.startToCloseTimeoutSeconds)
        return false;
    }

    boolean this_present_heartbeatTimeoutSeconds = true && this.isSetHeartbeatTimeoutSeconds();
    boolean that_present_heartbeatTimeoutSeconds = true && that.isSetHeartbeatTimeoutSeconds();
    if (this_present_heartbeatTimeoutSeconds || that_present_heartbeatTimeoutSeconds) {
      if (!(this_present_heartbeatTimeoutSeconds && that_present_heartbeatTimeoutSeconds))
        return false;
      if (this.heartbeatTimeoutSeconds != that.heartbeatTimeoutSeconds)
        return false;
    }

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

    return true;
  }

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

    boolean present_activityId = true && (isSetActivityId());
    list.add(present_activityId);
    if (present_activityId)
      list.add(activityId);

    boolean present_activityType = true && (isSetActivityType());
    list.add(present_activityType);
    if (present_activityType)
      list.add(activityType);

    boolean present_domain = true && (isSetDomain());
    list.add(present_domain);
    if (present_domain)
      list.add(domain);

    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_scheduleToCloseTimeoutSeconds = true && (isSetScheduleToCloseTimeoutSeconds());
    list.add(present_scheduleToCloseTimeoutSeconds);
    if (present_scheduleToCloseTimeoutSeconds)
      list.add(scheduleToCloseTimeoutSeconds);

    boolean present_scheduleToStartTimeoutSeconds = true && (isSetScheduleToStartTimeoutSeconds());
    list.add(present_scheduleToStartTimeoutSeconds);
    if (present_scheduleToStartTimeoutSeconds)
      list.add(scheduleToStartTimeoutSeconds);

    boolean present_startToCloseTimeoutSeconds = true && (isSetStartToCloseTimeoutSeconds());
    list.add(present_startToCloseTimeoutSeconds);
    if (present_startToCloseTimeoutSeconds)
      list.add(startToCloseTimeoutSeconds);

    boolean present_heartbeatTimeoutSeconds = true && (isSetHeartbeatTimeoutSeconds());
    list.add(present_heartbeatTimeoutSeconds);
    if (present_heartbeatTimeoutSeconds)
      list.add(heartbeatTimeoutSeconds);

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

    return list.hashCode();
  }

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

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetActivityId()).compareTo(other.isSetActivityId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetActivityId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.activityId, other.activityId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetActivityType()).compareTo(other.isSetActivityType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetActivityType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.activityType, other.activityType);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDomain()).compareTo(other.isSetDomain());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDomain()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domain, other.domain);
      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(isSetScheduleToCloseTimeoutSeconds()).compareTo(other.isSetScheduleToCloseTimeoutSeconds());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetScheduleToCloseTimeoutSeconds()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scheduleToCloseTimeoutSeconds, other.scheduleToCloseTimeoutSeconds);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetScheduleToStartTimeoutSeconds()).compareTo(other.isSetScheduleToStartTimeoutSeconds());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetScheduleToStartTimeoutSeconds()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scheduleToStartTimeoutSeconds, other.scheduleToStartTimeoutSeconds);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetStartToCloseTimeoutSeconds()).compareTo(other.isSetStartToCloseTimeoutSeconds());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStartToCloseTimeoutSeconds()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startToCloseTimeoutSeconds, other.startToCloseTimeoutSeconds);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetHeartbeatTimeoutSeconds()).compareTo(other.isSetHeartbeatTimeoutSeconds());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetHeartbeatTimeoutSeconds()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.heartbeatTimeoutSeconds, other.heartbeatTimeoutSeconds);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetRetryPolicy()).compareTo(other.isSetRetryPolicy());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRetryPolicy()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.retryPolicy, other.retryPolicy);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    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("ScheduleActivityTaskDecisionAttributes(");
    boolean first = true;

    if (isSetActivityId()) {
      sb.append("activityId:");
      if (this.activityId == null) {
        sb.append("null");
      } else {
        sb.append(this.activityId);
      }
      first = false;
    }
    if (isSetActivityType()) {
      if (!first) sb.append(", ");
      sb.append("activityType:");
      if (this.activityType == null) {
        sb.append("null");
      } else {
        sb.append(this.activityType);
      }
      first = false;
    }
    if (isSetDomain()) {
      if (!first) sb.append(", ");
      sb.append("domain:");
      if (this.domain == null) {
        sb.append("null");
      } else {
        sb.append(this.domain);
      }
      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 (isSetScheduleToCloseTimeoutSeconds()) {
      if (!first) sb.append(", ");
      sb.append("scheduleToCloseTimeoutSeconds:");
      sb.append(this.scheduleToCloseTimeoutSeconds);
      first = false;
    }
    if (isSetScheduleToStartTimeoutSeconds()) {
      if (!first) sb.append(", ");
      sb.append("scheduleToStartTimeoutSeconds:");
      sb.append(this.scheduleToStartTimeoutSeconds);
      first = false;
    }
    if (isSetStartToCloseTimeoutSeconds()) {
      if (!first) sb.append(", ");
      sb.append("startToCloseTimeoutSeconds:");
      sb.append(this.startToCloseTimeoutSeconds);
      first = false;
    }
    if (isSetHeartbeatTimeoutSeconds()) {
      if (!first) sb.append(", ");
      sb.append("heartbeatTimeoutSeconds:");
      sb.append(this.heartbeatTimeoutSeconds);
      first = false;
    }
    if (isSetRetryPolicy()) {
      if (!first) sb.append(", ");
      sb.append("retryPolicy:");
      if (this.retryPolicy == null) {
        sb.append("null");
      } else {
        sb.append(this.retryPolicy);
      }
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // check for sub-struct validity
    if (activityType != null) {
      activityType.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 ScheduleActivityTaskDecisionAttributesStandardSchemeFactory implements SchemeFactory {
    public ScheduleActivityTaskDecisionAttributesStandardScheme getScheme() {
      return new ScheduleActivityTaskDecisionAttributesStandardScheme();
    }
  }

  private static class ScheduleActivityTaskDecisionAttributesStandardScheme extends StandardScheme {

    public void read(org.apache.thrift.protocol.TProtocol iprot, ScheduleActivityTaskDecisionAttributes 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: // ACTIVITY_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.activityId = iprot.readString();
              struct.setActivityIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 20: // ACTIVITY_TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.activityType = new ActivityType();
              struct.activityType.read(iprot);
              struct.setActivityTypeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 25: // DOMAIN
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.domain = iprot.readString();
              struct.setDomainIsSet(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 45: // SCHEDULE_TO_CLOSE_TIMEOUT_SECONDS
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.scheduleToCloseTimeoutSeconds = iprot.readI32();
              struct.setScheduleToCloseTimeoutSecondsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 50: // SCHEDULE_TO_START_TIMEOUT_SECONDS
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.scheduleToStartTimeoutSeconds = iprot.readI32();
              struct.setScheduleToStartTimeoutSecondsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 55: // START_TO_CLOSE_TIMEOUT_SECONDS
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.startToCloseTimeoutSeconds = iprot.readI32();
              struct.setStartToCloseTimeoutSecondsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 60: // HEARTBEAT_TIMEOUT_SECONDS
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.heartbeatTimeoutSeconds = iprot.readI32();
              struct.setHeartbeatTimeoutSecondsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 70: // RETRY_POLICY
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.retryPolicy = new RetryPolicy();
              struct.retryPolicy.read(iprot);
              struct.setRetryPolicyIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          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, ScheduleActivityTaskDecisionAttributes struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.activityId != null) {
        if (struct.isSetActivityId()) {
          oprot.writeFieldBegin(ACTIVITY_ID_FIELD_DESC);
          oprot.writeString(struct.activityId);
          oprot.writeFieldEnd();
        }
      }
      if (struct.activityType != null) {
        if (struct.isSetActivityType()) {
          oprot.writeFieldBegin(ACTIVITY_TYPE_FIELD_DESC);
          struct.activityType.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.domain != null) {
        if (struct.isSetDomain()) {
          oprot.writeFieldBegin(DOMAIN_FIELD_DESC);
          oprot.writeString(struct.domain);
          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.isSetScheduleToCloseTimeoutSeconds()) {
        oprot.writeFieldBegin(SCHEDULE_TO_CLOSE_TIMEOUT_SECONDS_FIELD_DESC);
        oprot.writeI32(struct.scheduleToCloseTimeoutSeconds);
        oprot.writeFieldEnd();
      }
      if (struct.isSetScheduleToStartTimeoutSeconds()) {
        oprot.writeFieldBegin(SCHEDULE_TO_START_TIMEOUT_SECONDS_FIELD_DESC);
        oprot.writeI32(struct.scheduleToStartTimeoutSeconds);
        oprot.writeFieldEnd();
      }
      if (struct.isSetStartToCloseTimeoutSeconds()) {
        oprot.writeFieldBegin(START_TO_CLOSE_TIMEOUT_SECONDS_FIELD_DESC);
        oprot.writeI32(struct.startToCloseTimeoutSeconds);
        oprot.writeFieldEnd();
      }
      if (struct.isSetHeartbeatTimeoutSeconds()) {
        oprot.writeFieldBegin(HEARTBEAT_TIMEOUT_SECONDS_FIELD_DESC);
        oprot.writeI32(struct.heartbeatTimeoutSeconds);
        oprot.writeFieldEnd();
      }
      if (struct.retryPolicy != null) {
        if (struct.isSetRetryPolicy()) {
          oprot.writeFieldBegin(RETRY_POLICY_FIELD_DESC);
          struct.retryPolicy.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class ScheduleActivityTaskDecisionAttributesTupleSchemeFactory implements SchemeFactory {
    public ScheduleActivityTaskDecisionAttributesTupleScheme getScheme() {
      return new ScheduleActivityTaskDecisionAttributesTupleScheme();
    }
  }

  private static class ScheduleActivityTaskDecisionAttributesTupleScheme extends TupleScheme {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, ScheduleActivityTaskDecisionAttributes struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetActivityId()) {
        optionals.set(0);
      }
      if (struct.isSetActivityType()) {
        optionals.set(1);
      }
      if (struct.isSetDomain()) {
        optionals.set(2);
      }
      if (struct.isSetTaskList()) {
        optionals.set(3);
      }
      if (struct.isSetInput()) {
        optionals.set(4);
      }
      if (struct.isSetScheduleToCloseTimeoutSeconds()) {
        optionals.set(5);
      }
      if (struct.isSetScheduleToStartTimeoutSeconds()) {
        optionals.set(6);
      }
      if (struct.isSetStartToCloseTimeoutSeconds()) {
        optionals.set(7);
      }
      if (struct.isSetHeartbeatTimeoutSeconds()) {
        optionals.set(8);
      }
      if (struct.isSetRetryPolicy()) {
        optionals.set(9);
      }
      oprot.writeBitSet(optionals, 10);
      if (struct.isSetActivityId()) {
        oprot.writeString(struct.activityId);
      }
      if (struct.isSetActivityType()) {
        struct.activityType.write(oprot);
      }
      if (struct.isSetDomain()) {
        oprot.writeString(struct.domain);
      }
      if (struct.isSetTaskList()) {
        struct.taskList.write(oprot);
      }
      if (struct.isSetInput()) {
        oprot.writeBinary(struct.input);
      }
      if (struct.isSetScheduleToCloseTimeoutSeconds()) {
        oprot.writeI32(struct.scheduleToCloseTimeoutSeconds);
      }
      if (struct.isSetScheduleToStartTimeoutSeconds()) {
        oprot.writeI32(struct.scheduleToStartTimeoutSeconds);
      }
      if (struct.isSetStartToCloseTimeoutSeconds()) {
        oprot.writeI32(struct.startToCloseTimeoutSeconds);
      }
      if (struct.isSetHeartbeatTimeoutSeconds()) {
        oprot.writeI32(struct.heartbeatTimeoutSeconds);
      }
      if (struct.isSetRetryPolicy()) {
        struct.retryPolicy.write(oprot);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, ScheduleActivityTaskDecisionAttributes struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(10);
      if (incoming.get(0)) {
        struct.activityId = iprot.readString();
        struct.setActivityIdIsSet(true);
      }
      if (incoming.get(1)) {
        struct.activityType = new ActivityType();
        struct.activityType.read(iprot);
        struct.setActivityTypeIsSet(true);
      }
      if (incoming.get(2)) {
        struct.domain = iprot.readString();
        struct.setDomainIsSet(true);
      }
      if (incoming.get(3)) {
        struct.taskList = new TaskList();
        struct.taskList.read(iprot);
        struct.setTaskListIsSet(true);
      }
      if (incoming.get(4)) {
        struct.input = iprot.readBinary();
        struct.setInputIsSet(true);
      }
      if (incoming.get(5)) {
        struct.scheduleToCloseTimeoutSeconds = iprot.readI32();
        struct.setScheduleToCloseTimeoutSecondsIsSet(true);
      }
      if (incoming.get(6)) {
        struct.scheduleToStartTimeoutSeconds = iprot.readI32();
        struct.setScheduleToStartTimeoutSecondsIsSet(true);
      }
      if (incoming.get(7)) {
        struct.startToCloseTimeoutSeconds = iprot.readI32();
        struct.setStartToCloseTimeoutSecondsIsSet(true);
      }
      if (incoming.get(8)) {
        struct.heartbeatTimeoutSeconds = iprot.readI32();
        struct.setHeartbeatTimeoutSecondsIsSet(true);
      }
      if (incoming.get(9)) {
        struct.retryPolicy = new RetryPolicy();
        struct.retryPolicy.read(iprot);
        struct.setRetryPolicyIsSet(true);
      }
    }
  }

}