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

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

  private static final org.apache.thrift.protocol.TField TASK_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("taskToken", org.apache.thrift.protocol.TType.STRING, (short)10);
  private static final org.apache.thrift.protocol.TField WORKFLOW_EXECUTION_FIELD_DESC = new org.apache.thrift.protocol.TField("workflowExecution", org.apache.thrift.protocol.TType.STRUCT, (short)20);
  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)30);
  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)40);
  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)50);
  private static final org.apache.thrift.protocol.TField SCHEDULED_TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("scheduledTimestamp", org.apache.thrift.protocol.TType.I64, (short)70);
  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)80);
  private static final org.apache.thrift.protocol.TField STARTED_TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("startedTimestamp", org.apache.thrift.protocol.TType.I64, (short)90);
  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)100);
  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)110);
  private static final org.apache.thrift.protocol.TField ATTEMPT_FIELD_DESC = new org.apache.thrift.protocol.TField("attempt", org.apache.thrift.protocol.TType.I32, (short)120);
  private static final org.apache.thrift.protocol.TField SCHEDULED_TIMESTAMP_OF_THIS_ATTEMPT_FIELD_DESC = new org.apache.thrift.protocol.TField("scheduledTimestampOfThisAttempt", org.apache.thrift.protocol.TType.I64, (short)130);
  private static final org.apache.thrift.protocol.TField HEARTBEAT_DETAILS_FIELD_DESC = new org.apache.thrift.protocol.TField("heartbeatDetails", org.apache.thrift.protocol.TType.STRING, (short)140);
  private static final org.apache.thrift.protocol.TField WORKFLOW_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("workflowType", org.apache.thrift.protocol.TType.STRUCT, (short)150);
  private static final org.apache.thrift.protocol.TField WORKFLOW_DOMAIN_FIELD_DESC = new org.apache.thrift.protocol.TField("workflowDomain", org.apache.thrift.protocol.TType.STRING, (short)160);

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

  public ByteBuffer taskToken; // optional
  public WorkflowExecution workflowExecution; // optional
  public String activityId; // optional
  public ActivityType activityType; // optional
  public ByteBuffer input; // optional
  public long scheduledTimestamp; // optional
  public int scheduleToCloseTimeoutSeconds; // optional
  public long startedTimestamp; // optional
  public int startToCloseTimeoutSeconds; // optional
  public int heartbeatTimeoutSeconds; // optional
  public int attempt; // optional
  public long scheduledTimestampOfThisAttempt; // optional
  public ByteBuffer heartbeatDetails; // optional
  public WorkflowType workflowType; // optional
  public String workflowDomain; // 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 {
    TASK_TOKEN((short)10, "taskToken"),
    WORKFLOW_EXECUTION((short)20, "workflowExecution"),
    ACTIVITY_ID((short)30, "activityId"),
    ACTIVITY_TYPE((short)40, "activityType"),
    INPUT((short)50, "input"),
    SCHEDULED_TIMESTAMP((short)70, "scheduledTimestamp"),
    SCHEDULE_TO_CLOSE_TIMEOUT_SECONDS((short)80, "scheduleToCloseTimeoutSeconds"),
    STARTED_TIMESTAMP((short)90, "startedTimestamp"),
    START_TO_CLOSE_TIMEOUT_SECONDS((short)100, "startToCloseTimeoutSeconds"),
    HEARTBEAT_TIMEOUT_SECONDS((short)110, "heartbeatTimeoutSeconds"),
    ATTEMPT((short)120, "attempt"),
    SCHEDULED_TIMESTAMP_OF_THIS_ATTEMPT((short)130, "scheduledTimestampOfThisAttempt"),
    HEARTBEAT_DETAILS((short)140, "heartbeatDetails"),
    WORKFLOW_TYPE((short)150, "workflowType"),
    WORKFLOW_DOMAIN((short)160, "workflowDomain");

    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: // TASK_TOKEN
          return TASK_TOKEN;
        case 20: // WORKFLOW_EXECUTION
          return WORKFLOW_EXECUTION;
        case 30: // ACTIVITY_ID
          return ACTIVITY_ID;
        case 40: // ACTIVITY_TYPE
          return ACTIVITY_TYPE;
        case 50: // INPUT
          return INPUT;
        case 70: // SCHEDULED_TIMESTAMP
          return SCHEDULED_TIMESTAMP;
        case 80: // SCHEDULE_TO_CLOSE_TIMEOUT_SECONDS
          return SCHEDULE_TO_CLOSE_TIMEOUT_SECONDS;
        case 90: // STARTED_TIMESTAMP
          return STARTED_TIMESTAMP;
        case 100: // START_TO_CLOSE_TIMEOUT_SECONDS
          return START_TO_CLOSE_TIMEOUT_SECONDS;
        case 110: // HEARTBEAT_TIMEOUT_SECONDS
          return HEARTBEAT_TIMEOUT_SECONDS;
        case 120: // ATTEMPT
          return ATTEMPT;
        case 130: // SCHEDULED_TIMESTAMP_OF_THIS_ATTEMPT
          return SCHEDULED_TIMESTAMP_OF_THIS_ATTEMPT;
        case 140: // HEARTBEAT_DETAILS
          return HEARTBEAT_DETAILS;
        case 150: // WORKFLOW_TYPE
          return WORKFLOW_TYPE;
        case 160: // WORKFLOW_DOMAIN
          return WORKFLOW_DOMAIN;
        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 __SCHEDULEDTIMESTAMP_ISSET_ID = 0;
  private static final int __SCHEDULETOCLOSETIMEOUTSECONDS_ISSET_ID = 1;
  private static final int __STARTEDTIMESTAMP_ISSET_ID = 2;
  private static final int __STARTTOCLOSETIMEOUTSECONDS_ISSET_ID = 3;
  private static final int __HEARTBEATTIMEOUTSECONDS_ISSET_ID = 4;
  private static final int __ATTEMPT_ISSET_ID = 5;
  private static final int __SCHEDULEDTIMESTAMPOFTHISATTEMPT_ISSET_ID = 6;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.TASK_TOKEN,_Fields.WORKFLOW_EXECUTION,_Fields.ACTIVITY_ID,_Fields.ACTIVITY_TYPE,_Fields.INPUT,_Fields.SCHEDULED_TIMESTAMP,_Fields.SCHEDULE_TO_CLOSE_TIMEOUT_SECONDS,_Fields.STARTED_TIMESTAMP,_Fields.START_TO_CLOSE_TIMEOUT_SECONDS,_Fields.HEARTBEAT_TIMEOUT_SECONDS,_Fields.ATTEMPT,_Fields.SCHEDULED_TIMESTAMP_OF_THIS_ATTEMPT,_Fields.HEARTBEAT_DETAILS,_Fields.WORKFLOW_TYPE,_Fields.WORKFLOW_DOMAIN};
  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.TASK_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("taskToken", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , true)));
    tmpMap.put(_Fields.WORKFLOW_EXECUTION, new org.apache.thrift.meta_data.FieldMetaData("workflowExecution", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, WorkflowExecution.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.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.SCHEDULED_TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("scheduledTimestamp", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    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.STARTED_TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("startedTimestamp", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    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.ATTEMPT, new org.apache.thrift.meta_data.FieldMetaData("attempt", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.SCHEDULED_TIMESTAMP_OF_THIS_ATTEMPT, new org.apache.thrift.meta_data.FieldMetaData("scheduledTimestampOfThisAttempt", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.HEARTBEAT_DETAILS, new org.apache.thrift.meta_data.FieldMetaData("heartbeatDetails", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , true)));
    tmpMap.put(_Fields.WORKFLOW_TYPE, new org.apache.thrift.meta_data.FieldMetaData("workflowType", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, WorkflowType.class)));
    tmpMap.put(_Fields.WORKFLOW_DOMAIN, new org.apache.thrift.meta_data.FieldMetaData("workflowDomain", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PollForActivityTaskResponse.class, metaDataMap);
  }

  public PollForActivityTaskResponse() {
  }

  /**
   * Performs a deep copy on other.
   */
  public PollForActivityTaskResponse(PollForActivityTaskResponse other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetTaskToken()) {
      this.taskToken = org.apache.thrift.TBaseHelper.copyBinary(other.taskToken);
    }
    if (other.isSetWorkflowExecution()) {
      this.workflowExecution = new WorkflowExecution(other.workflowExecution);
    }
    if (other.isSetActivityId()) {
      this.activityId = other.activityId;
    }
    if (other.isSetActivityType()) {
      this.activityType = new ActivityType(other.activityType);
    }
    if (other.isSetInput()) {
      this.input = org.apache.thrift.TBaseHelper.copyBinary(other.input);
    }
    this.scheduledTimestamp = other.scheduledTimestamp;
    this.scheduleToCloseTimeoutSeconds = other.scheduleToCloseTimeoutSeconds;
    this.startedTimestamp = other.startedTimestamp;
    this.startToCloseTimeoutSeconds = other.startToCloseTimeoutSeconds;
    this.heartbeatTimeoutSeconds = other.heartbeatTimeoutSeconds;
    this.attempt = other.attempt;
    this.scheduledTimestampOfThisAttempt = other.scheduledTimestampOfThisAttempt;
    if (other.isSetHeartbeatDetails()) {
      this.heartbeatDetails = org.apache.thrift.TBaseHelper.copyBinary(other.heartbeatDetails);
    }
    if (other.isSetWorkflowType()) {
      this.workflowType = new WorkflowType(other.workflowType);
    }
    if (other.isSetWorkflowDomain()) {
      this.workflowDomain = other.workflowDomain;
    }
  }

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

  @Override
  public void clear() {
    this.taskToken = null;
    this.workflowExecution = null;
    this.activityId = null;
    this.activityType = null;
    this.input = null;
    setScheduledTimestampIsSet(false);
    this.scheduledTimestamp = 0;
    setScheduleToCloseTimeoutSecondsIsSet(false);
    this.scheduleToCloseTimeoutSeconds = 0;
    setStartedTimestampIsSet(false);
    this.startedTimestamp = 0;
    setStartToCloseTimeoutSecondsIsSet(false);
    this.startToCloseTimeoutSeconds = 0;
    setHeartbeatTimeoutSecondsIsSet(false);
    this.heartbeatTimeoutSeconds = 0;
    setAttemptIsSet(false);
    this.attempt = 0;
    setScheduledTimestampOfThisAttemptIsSet(false);
    this.scheduledTimestampOfThisAttempt = 0;
    this.heartbeatDetails = null;
    this.workflowType = null;
    this.workflowDomain = null;
  }

  public byte[] getTaskToken() {
    setTaskToken(org.apache.thrift.TBaseHelper.rightSize(taskToken));
    return taskToken == null ? null : taskToken.array();
  }

  public ByteBuffer bufferForTaskToken() {
    return org.apache.thrift.TBaseHelper.copyBinary(taskToken);
  }

  public PollForActivityTaskResponse setTaskToken(byte[] taskToken) {
    this.taskToken = taskToken == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(taskToken, taskToken.length));
    return this;
  }

  public PollForActivityTaskResponse setTaskToken(ByteBuffer taskToken) {
    this.taskToken = org.apache.thrift.TBaseHelper.copyBinary(taskToken);
    return this;
  }

  public void unsetTaskToken() {
    this.taskToken = null;
  }

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

  public void setTaskTokenIsSet(boolean value) {
    if (!value) {
      this.taskToken = null;
    }
  }

  public WorkflowExecution getWorkflowExecution() {
    return this.workflowExecution;
  }

  public PollForActivityTaskResponse setWorkflowExecution(WorkflowExecution workflowExecution) {
    this.workflowExecution = workflowExecution;
    return this;
  }

  public void unsetWorkflowExecution() {
    this.workflowExecution = null;
  }

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

  public void setWorkflowExecutionIsSet(boolean value) {
    if (!value) {
      this.workflowExecution = null;
    }
  }

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

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

  public PollForActivityTaskResponse 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 long getScheduledTimestamp() {
    return this.scheduledTimestamp;
  }

  public PollForActivityTaskResponse setScheduledTimestamp(long scheduledTimestamp) {
    this.scheduledTimestamp = scheduledTimestamp;
    setScheduledTimestampIsSet(true);
    return this;
  }

  public void unsetScheduledTimestamp() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SCHEDULEDTIMESTAMP_ISSET_ID);
  }

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

  public void setScheduledTimestampIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SCHEDULEDTIMESTAMP_ISSET_ID, value);
  }

  public int getScheduleToCloseTimeoutSeconds() {
    return this.scheduleToCloseTimeoutSeconds;
  }

  public PollForActivityTaskResponse 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 long getStartedTimestamp() {
    return this.startedTimestamp;
  }

  public PollForActivityTaskResponse setStartedTimestamp(long startedTimestamp) {
    this.startedTimestamp = startedTimestamp;
    setStartedTimestampIsSet(true);
    return this;
  }

  public void unsetStartedTimestamp() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STARTEDTIMESTAMP_ISSET_ID);
  }

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

  public void setStartedTimestampIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STARTEDTIMESTAMP_ISSET_ID, value);
  }

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

  public PollForActivityTaskResponse 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 PollForActivityTaskResponse 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 int getAttempt() {
    return this.attempt;
  }

  public PollForActivityTaskResponse setAttempt(int attempt) {
    this.attempt = attempt;
    setAttemptIsSet(true);
    return this;
  }

  public void unsetAttempt() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ATTEMPT_ISSET_ID);
  }

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

  public void setAttemptIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ATTEMPT_ISSET_ID, value);
  }

  public long getScheduledTimestampOfThisAttempt() {
    return this.scheduledTimestampOfThisAttempt;
  }

  public PollForActivityTaskResponse setScheduledTimestampOfThisAttempt(long scheduledTimestampOfThisAttempt) {
    this.scheduledTimestampOfThisAttempt = scheduledTimestampOfThisAttempt;
    setScheduledTimestampOfThisAttemptIsSet(true);
    return this;
  }

  public void unsetScheduledTimestampOfThisAttempt() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SCHEDULEDTIMESTAMPOFTHISATTEMPT_ISSET_ID);
  }

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

  public void setScheduledTimestampOfThisAttemptIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SCHEDULEDTIMESTAMPOFTHISATTEMPT_ISSET_ID, value);
  }

  public byte[] getHeartbeatDetails() {
    setHeartbeatDetails(org.apache.thrift.TBaseHelper.rightSize(heartbeatDetails));
    return heartbeatDetails == null ? null : heartbeatDetails.array();
  }

  public ByteBuffer bufferForHeartbeatDetails() {
    return org.apache.thrift.TBaseHelper.copyBinary(heartbeatDetails);
  }

  public PollForActivityTaskResponse setHeartbeatDetails(byte[] heartbeatDetails) {
    this.heartbeatDetails = heartbeatDetails == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(heartbeatDetails, heartbeatDetails.length));
    return this;
  }

  public PollForActivityTaskResponse setHeartbeatDetails(ByteBuffer heartbeatDetails) {
    this.heartbeatDetails = org.apache.thrift.TBaseHelper.copyBinary(heartbeatDetails);
    return this;
  }

  public void unsetHeartbeatDetails() {
    this.heartbeatDetails = null;
  }

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

  public void setHeartbeatDetailsIsSet(boolean value) {
    if (!value) {
      this.heartbeatDetails = null;
    }
  }

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

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

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

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

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

  public String getWorkflowDomain() {
    return this.workflowDomain;
  }

  public PollForActivityTaskResponse setWorkflowDomain(String workflowDomain) {
    this.workflowDomain = workflowDomain;
    return this;
  }

  public void unsetWorkflowDomain() {
    this.workflowDomain = null;
  }

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

  public void setWorkflowDomainIsSet(boolean value) {
    if (!value) {
      this.workflowDomain = null;
    }
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case TASK_TOKEN:
      if (value == null) {
        unsetTaskToken();
      } else {
        setTaskToken((ByteBuffer)value);
      }
      break;

    case WORKFLOW_EXECUTION:
      if (value == null) {
        unsetWorkflowExecution();
      } else {
        setWorkflowExecution((WorkflowExecution)value);
      }
      break;

    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 INPUT:
      if (value == null) {
        unsetInput();
      } else {
        setInput((ByteBuffer)value);
      }
      break;

    case SCHEDULED_TIMESTAMP:
      if (value == null) {
        unsetScheduledTimestamp();
      } else {
        setScheduledTimestamp((Long)value);
      }
      break;

    case SCHEDULE_TO_CLOSE_TIMEOUT_SECONDS:
      if (value == null) {
        unsetScheduleToCloseTimeoutSeconds();
      } else {
        setScheduleToCloseTimeoutSeconds((Integer)value);
      }
      break;

    case STARTED_TIMESTAMP:
      if (value == null) {
        unsetStartedTimestamp();
      } else {
        setStartedTimestamp((Long)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 ATTEMPT:
      if (value == null) {
        unsetAttempt();
      } else {
        setAttempt((Integer)value);
      }
      break;

    case SCHEDULED_TIMESTAMP_OF_THIS_ATTEMPT:
      if (value == null) {
        unsetScheduledTimestampOfThisAttempt();
      } else {
        setScheduledTimestampOfThisAttempt((Long)value);
      }
      break;

    case HEARTBEAT_DETAILS:
      if (value == null) {
        unsetHeartbeatDetails();
      } else {
        setHeartbeatDetails((ByteBuffer)value);
      }
      break;

    case WORKFLOW_TYPE:
      if (value == null) {
        unsetWorkflowType();
      } else {
        setWorkflowType((WorkflowType)value);
      }
      break;

    case WORKFLOW_DOMAIN:
      if (value == null) {
        unsetWorkflowDomain();
      } else {
        setWorkflowDomain((String)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case TASK_TOKEN:
      return getTaskToken();

    case WORKFLOW_EXECUTION:
      return getWorkflowExecution();

    case ACTIVITY_ID:
      return getActivityId();

    case ACTIVITY_TYPE:
      return getActivityType();

    case INPUT:
      return getInput();

    case SCHEDULED_TIMESTAMP:
      return getScheduledTimestamp();

    case SCHEDULE_TO_CLOSE_TIMEOUT_SECONDS:
      return getScheduleToCloseTimeoutSeconds();

    case STARTED_TIMESTAMP:
      return getStartedTimestamp();

    case START_TO_CLOSE_TIMEOUT_SECONDS:
      return getStartToCloseTimeoutSeconds();

    case HEARTBEAT_TIMEOUT_SECONDS:
      return getHeartbeatTimeoutSeconds();

    case ATTEMPT:
      return getAttempt();

    case SCHEDULED_TIMESTAMP_OF_THIS_ATTEMPT:
      return getScheduledTimestampOfThisAttempt();

    case HEARTBEAT_DETAILS:
      return getHeartbeatDetails();

    case WORKFLOW_TYPE:
      return getWorkflowType();

    case WORKFLOW_DOMAIN:
      return getWorkflowDomain();

    }
    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 TASK_TOKEN:
      return isSetTaskToken();
    case WORKFLOW_EXECUTION:
      return isSetWorkflowExecution();
    case ACTIVITY_ID:
      return isSetActivityId();
    case ACTIVITY_TYPE:
      return isSetActivityType();
    case INPUT:
      return isSetInput();
    case SCHEDULED_TIMESTAMP:
      return isSetScheduledTimestamp();
    case SCHEDULE_TO_CLOSE_TIMEOUT_SECONDS:
      return isSetScheduleToCloseTimeoutSeconds();
    case STARTED_TIMESTAMP:
      return isSetStartedTimestamp();
    case START_TO_CLOSE_TIMEOUT_SECONDS:
      return isSetStartToCloseTimeoutSeconds();
    case HEARTBEAT_TIMEOUT_SECONDS:
      return isSetHeartbeatTimeoutSeconds();
    case ATTEMPT:
      return isSetAttempt();
    case SCHEDULED_TIMESTAMP_OF_THIS_ATTEMPT:
      return isSetScheduledTimestampOfThisAttempt();
    case HEARTBEAT_DETAILS:
      return isSetHeartbeatDetails();
    case WORKFLOW_TYPE:
      return isSetWorkflowType();
    case WORKFLOW_DOMAIN:
      return isSetWorkflowDomain();
    }
    throw new IllegalStateException();
  }

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

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

    boolean this_present_taskToken = true && this.isSetTaskToken();
    boolean that_present_taskToken = true && that.isSetTaskToken();
    if (this_present_taskToken || that_present_taskToken) {
      if (!(this_present_taskToken && that_present_taskToken))
        return false;
      if (!this.taskToken.equals(that.taskToken))
        return false;
    }

    boolean this_present_workflowExecution = true && this.isSetWorkflowExecution();
    boolean that_present_workflowExecution = true && that.isSetWorkflowExecution();
    if (this_present_workflowExecution || that_present_workflowExecution) {
      if (!(this_present_workflowExecution && that_present_workflowExecution))
        return false;
      if (!this.workflowExecution.equals(that.workflowExecution))
        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_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_scheduledTimestamp = true && this.isSetScheduledTimestamp();
    boolean that_present_scheduledTimestamp = true && that.isSetScheduledTimestamp();
    if (this_present_scheduledTimestamp || that_present_scheduledTimestamp) {
      if (!(this_present_scheduledTimestamp && that_present_scheduledTimestamp))
        return false;
      if (this.scheduledTimestamp != that.scheduledTimestamp)
        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_startedTimestamp = true && this.isSetStartedTimestamp();
    boolean that_present_startedTimestamp = true && that.isSetStartedTimestamp();
    if (this_present_startedTimestamp || that_present_startedTimestamp) {
      if (!(this_present_startedTimestamp && that_present_startedTimestamp))
        return false;
      if (this.startedTimestamp != that.startedTimestamp)
        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_attempt = true && this.isSetAttempt();
    boolean that_present_attempt = true && that.isSetAttempt();
    if (this_present_attempt || that_present_attempt) {
      if (!(this_present_attempt && that_present_attempt))
        return false;
      if (this.attempt != that.attempt)
        return false;
    }

    boolean this_present_scheduledTimestampOfThisAttempt = true && this.isSetScheduledTimestampOfThisAttempt();
    boolean that_present_scheduledTimestampOfThisAttempt = true && that.isSetScheduledTimestampOfThisAttempt();
    if (this_present_scheduledTimestampOfThisAttempt || that_present_scheduledTimestampOfThisAttempt) {
      if (!(this_present_scheduledTimestampOfThisAttempt && that_present_scheduledTimestampOfThisAttempt))
        return false;
      if (this.scheduledTimestampOfThisAttempt != that.scheduledTimestampOfThisAttempt)
        return false;
    }

    boolean this_present_heartbeatDetails = true && this.isSetHeartbeatDetails();
    boolean that_present_heartbeatDetails = true && that.isSetHeartbeatDetails();
    if (this_present_heartbeatDetails || that_present_heartbeatDetails) {
      if (!(this_present_heartbeatDetails && that_present_heartbeatDetails))
        return false;
      if (!this.heartbeatDetails.equals(that.heartbeatDetails))
        return false;
    }

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

    boolean this_present_workflowDomain = true && this.isSetWorkflowDomain();
    boolean that_present_workflowDomain = true && that.isSetWorkflowDomain();
    if (this_present_workflowDomain || that_present_workflowDomain) {
      if (!(this_present_workflowDomain && that_present_workflowDomain))
        return false;
      if (!this.workflowDomain.equals(that.workflowDomain))
        return false;
    }

    return true;
  }

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

    boolean present_taskToken = true && (isSetTaskToken());
    list.add(present_taskToken);
    if (present_taskToken)
      list.add(taskToken);

    boolean present_workflowExecution = true && (isSetWorkflowExecution());
    list.add(present_workflowExecution);
    if (present_workflowExecution)
      list.add(workflowExecution);

    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_input = true && (isSetInput());
    list.add(present_input);
    if (present_input)
      list.add(input);

    boolean present_scheduledTimestamp = true && (isSetScheduledTimestamp());
    list.add(present_scheduledTimestamp);
    if (present_scheduledTimestamp)
      list.add(scheduledTimestamp);

    boolean present_scheduleToCloseTimeoutSeconds = true && (isSetScheduleToCloseTimeoutSeconds());
    list.add(present_scheduleToCloseTimeoutSeconds);
    if (present_scheduleToCloseTimeoutSeconds)
      list.add(scheduleToCloseTimeoutSeconds);

    boolean present_startedTimestamp = true && (isSetStartedTimestamp());
    list.add(present_startedTimestamp);
    if (present_startedTimestamp)
      list.add(startedTimestamp);

    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_attempt = true && (isSetAttempt());
    list.add(present_attempt);
    if (present_attempt)
      list.add(attempt);

    boolean present_scheduledTimestampOfThisAttempt = true && (isSetScheduledTimestampOfThisAttempt());
    list.add(present_scheduledTimestampOfThisAttempt);
    if (present_scheduledTimestampOfThisAttempt)
      list.add(scheduledTimestampOfThisAttempt);

    boolean present_heartbeatDetails = true && (isSetHeartbeatDetails());
    list.add(present_heartbeatDetails);
    if (present_heartbeatDetails)
      list.add(heartbeatDetails);

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

    boolean present_workflowDomain = true && (isSetWorkflowDomain());
    list.add(present_workflowDomain);
    if (present_workflowDomain)
      list.add(workflowDomain);

    return list.hashCode();
  }

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

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetTaskToken()).compareTo(other.isSetTaskToken());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTaskToken()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.taskToken, other.taskToken);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetWorkflowExecution()).compareTo(other.isSetWorkflowExecution());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetWorkflowExecution()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.workflowExecution, other.workflowExecution);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    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(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(isSetScheduledTimestamp()).compareTo(other.isSetScheduledTimestamp());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetScheduledTimestamp()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scheduledTimestamp, other.scheduledTimestamp);
      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(isSetStartedTimestamp()).compareTo(other.isSetStartedTimestamp());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStartedTimestamp()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startedTimestamp, other.startedTimestamp);
      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(isSetAttempt()).compareTo(other.isSetAttempt());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAttempt()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.attempt, other.attempt);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetScheduledTimestampOfThisAttempt()).compareTo(other.isSetScheduledTimestampOfThisAttempt());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetScheduledTimestampOfThisAttempt()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scheduledTimestampOfThisAttempt, other.scheduledTimestampOfThisAttempt);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetHeartbeatDetails()).compareTo(other.isSetHeartbeatDetails());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetHeartbeatDetails()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.heartbeatDetails, other.heartbeatDetails);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetWorkflowType()).compareTo(other.isSetWorkflowType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetWorkflowType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.workflowType, other.workflowType);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetWorkflowDomain()).compareTo(other.isSetWorkflowDomain());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetWorkflowDomain()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.workflowDomain, other.workflowDomain);
      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("PollForActivityTaskResponse(");
    boolean first = true;

    if (isSetTaskToken()) {
      sb.append("taskToken:");
      if (this.taskToken == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.taskToken, sb);
      }
      first = false;
    }
    if (isSetWorkflowExecution()) {
      if (!first) sb.append(", ");
      sb.append("workflowExecution:");
      if (this.workflowExecution == null) {
        sb.append("null");
      } else {
        sb.append(this.workflowExecution);
      }
      first = false;
    }
    if (isSetActivityId()) {
      if (!first) sb.append(", ");
      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 (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 (isSetScheduledTimestamp()) {
      if (!first) sb.append(", ");
      sb.append("scheduledTimestamp:");
      sb.append(this.scheduledTimestamp);
      first = false;
    }
    if (isSetScheduleToCloseTimeoutSeconds()) {
      if (!first) sb.append(", ");
      sb.append("scheduleToCloseTimeoutSeconds:");
      sb.append(this.scheduleToCloseTimeoutSeconds);
      first = false;
    }
    if (isSetStartedTimestamp()) {
      if (!first) sb.append(", ");
      sb.append("startedTimestamp:");
      sb.append(this.startedTimestamp);
      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 (isSetAttempt()) {
      if (!first) sb.append(", ");
      sb.append("attempt:");
      sb.append(this.attempt);
      first = false;
    }
    if (isSetScheduledTimestampOfThisAttempt()) {
      if (!first) sb.append(", ");
      sb.append("scheduledTimestampOfThisAttempt:");
      sb.append(this.scheduledTimestampOfThisAttempt);
      first = false;
    }
    if (isSetHeartbeatDetails()) {
      if (!first) sb.append(", ");
      sb.append("heartbeatDetails:");
      if (this.heartbeatDetails == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.heartbeatDetails, sb);
      }
      first = false;
    }
    if (isSetWorkflowType()) {
      if (!first) sb.append(", ");
      sb.append("workflowType:");
      if (this.workflowType == null) {
        sb.append("null");
      } else {
        sb.append(this.workflowType);
      }
      first = false;
    }
    if (isSetWorkflowDomain()) {
      if (!first) sb.append(", ");
      sb.append("workflowDomain:");
      if (this.workflowDomain == null) {
        sb.append("null");
      } else {
        sb.append(this.workflowDomain);
      }
      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 (workflowExecution != null) {
      workflowExecution.validate();
    }
    if (activityType != null) {
      activityType.validate();
    }
    if (workflowType != null) {
      workflowType.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 PollForActivityTaskResponseStandardSchemeFactory implements SchemeFactory {
    public PollForActivityTaskResponseStandardScheme getScheme() {
      return new PollForActivityTaskResponseStandardScheme();
    }
  }

  private static class PollForActivityTaskResponseStandardScheme extends StandardScheme {

    public void read(org.apache.thrift.protocol.TProtocol iprot, PollForActivityTaskResponse 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: // TASK_TOKEN
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.taskToken = iprot.readBinary();
              struct.setTaskTokenIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 20: // WORKFLOW_EXECUTION
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.workflowExecution = new WorkflowExecution();
              struct.workflowExecution.read(iprot);
              struct.setWorkflowExecutionIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 30: // 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 40: // 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 50: // 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 70: // SCHEDULED_TIMESTAMP
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.scheduledTimestamp = iprot.readI64();
              struct.setScheduledTimestampIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 80: // 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 90: // STARTED_TIMESTAMP
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.startedTimestamp = iprot.readI64();
              struct.setStartedTimestampIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 100: // 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 110: // 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 120: // ATTEMPT
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.attempt = iprot.readI32();
              struct.setAttemptIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 130: // SCHEDULED_TIMESTAMP_OF_THIS_ATTEMPT
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.scheduledTimestampOfThisAttempt = iprot.readI64();
              struct.setScheduledTimestampOfThisAttemptIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 140: // HEARTBEAT_DETAILS
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.heartbeatDetails = iprot.readBinary();
              struct.setHeartbeatDetailsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 150: // WORKFLOW_TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.workflowType = new WorkflowType();
              struct.workflowType.read(iprot);
              struct.setWorkflowTypeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 160: // WORKFLOW_DOMAIN
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.workflowDomain = iprot.readString();
              struct.setWorkflowDomainIsSet(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, PollForActivityTaskResponse struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.taskToken != null) {
        if (struct.isSetTaskToken()) {
          oprot.writeFieldBegin(TASK_TOKEN_FIELD_DESC);
          oprot.writeBinary(struct.taskToken);
          oprot.writeFieldEnd();
        }
      }
      if (struct.workflowExecution != null) {
        if (struct.isSetWorkflowExecution()) {
          oprot.writeFieldBegin(WORKFLOW_EXECUTION_FIELD_DESC);
          struct.workflowExecution.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      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.input != null) {
        if (struct.isSetInput()) {
          oprot.writeFieldBegin(INPUT_FIELD_DESC);
          oprot.writeBinary(struct.input);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetScheduledTimestamp()) {
        oprot.writeFieldBegin(SCHEDULED_TIMESTAMP_FIELD_DESC);
        oprot.writeI64(struct.scheduledTimestamp);
        oprot.writeFieldEnd();
      }
      if (struct.isSetScheduleToCloseTimeoutSeconds()) {
        oprot.writeFieldBegin(SCHEDULE_TO_CLOSE_TIMEOUT_SECONDS_FIELD_DESC);
        oprot.writeI32(struct.scheduleToCloseTimeoutSeconds);
        oprot.writeFieldEnd();
      }
      if (struct.isSetStartedTimestamp()) {
        oprot.writeFieldBegin(STARTED_TIMESTAMP_FIELD_DESC);
        oprot.writeI64(struct.startedTimestamp);
        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.isSetAttempt()) {
        oprot.writeFieldBegin(ATTEMPT_FIELD_DESC);
        oprot.writeI32(struct.attempt);
        oprot.writeFieldEnd();
      }
      if (struct.isSetScheduledTimestampOfThisAttempt()) {
        oprot.writeFieldBegin(SCHEDULED_TIMESTAMP_OF_THIS_ATTEMPT_FIELD_DESC);
        oprot.writeI64(struct.scheduledTimestampOfThisAttempt);
        oprot.writeFieldEnd();
      }
      if (struct.heartbeatDetails != null) {
        if (struct.isSetHeartbeatDetails()) {
          oprot.writeFieldBegin(HEARTBEAT_DETAILS_FIELD_DESC);
          oprot.writeBinary(struct.heartbeatDetails);
          oprot.writeFieldEnd();
        }
      }
      if (struct.workflowType != null) {
        if (struct.isSetWorkflowType()) {
          oprot.writeFieldBegin(WORKFLOW_TYPE_FIELD_DESC);
          struct.workflowType.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.workflowDomain != null) {
        if (struct.isSetWorkflowDomain()) {
          oprot.writeFieldBegin(WORKFLOW_DOMAIN_FIELD_DESC);
          oprot.writeString(struct.workflowDomain);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class PollForActivityTaskResponseTupleSchemeFactory implements SchemeFactory {
    public PollForActivityTaskResponseTupleScheme getScheme() {
      return new PollForActivityTaskResponseTupleScheme();
    }
  }

  private static class PollForActivityTaskResponseTupleScheme extends TupleScheme {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, PollForActivityTaskResponse struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetTaskToken()) {
        optionals.set(0);
      }
      if (struct.isSetWorkflowExecution()) {
        optionals.set(1);
      }
      if (struct.isSetActivityId()) {
        optionals.set(2);
      }
      if (struct.isSetActivityType()) {
        optionals.set(3);
      }
      if (struct.isSetInput()) {
        optionals.set(4);
      }
      if (struct.isSetScheduledTimestamp()) {
        optionals.set(5);
      }
      if (struct.isSetScheduleToCloseTimeoutSeconds()) {
        optionals.set(6);
      }
      if (struct.isSetStartedTimestamp()) {
        optionals.set(7);
      }
      if (struct.isSetStartToCloseTimeoutSeconds()) {
        optionals.set(8);
      }
      if (struct.isSetHeartbeatTimeoutSeconds()) {
        optionals.set(9);
      }
      if (struct.isSetAttempt()) {
        optionals.set(10);
      }
      if (struct.isSetScheduledTimestampOfThisAttempt()) {
        optionals.set(11);
      }
      if (struct.isSetHeartbeatDetails()) {
        optionals.set(12);
      }
      if (struct.isSetWorkflowType()) {
        optionals.set(13);
      }
      if (struct.isSetWorkflowDomain()) {
        optionals.set(14);
      }
      oprot.writeBitSet(optionals, 15);
      if (struct.isSetTaskToken()) {
        oprot.writeBinary(struct.taskToken);
      }
      if (struct.isSetWorkflowExecution()) {
        struct.workflowExecution.write(oprot);
      }
      if (struct.isSetActivityId()) {
        oprot.writeString(struct.activityId);
      }
      if (struct.isSetActivityType()) {
        struct.activityType.write(oprot);
      }
      if (struct.isSetInput()) {
        oprot.writeBinary(struct.input);
      }
      if (struct.isSetScheduledTimestamp()) {
        oprot.writeI64(struct.scheduledTimestamp);
      }
      if (struct.isSetScheduleToCloseTimeoutSeconds()) {
        oprot.writeI32(struct.scheduleToCloseTimeoutSeconds);
      }
      if (struct.isSetStartedTimestamp()) {
        oprot.writeI64(struct.startedTimestamp);
      }
      if (struct.isSetStartToCloseTimeoutSeconds()) {
        oprot.writeI32(struct.startToCloseTimeoutSeconds);
      }
      if (struct.isSetHeartbeatTimeoutSeconds()) {
        oprot.writeI32(struct.heartbeatTimeoutSeconds);
      }
      if (struct.isSetAttempt()) {
        oprot.writeI32(struct.attempt);
      }
      if (struct.isSetScheduledTimestampOfThisAttempt()) {
        oprot.writeI64(struct.scheduledTimestampOfThisAttempt);
      }
      if (struct.isSetHeartbeatDetails()) {
        oprot.writeBinary(struct.heartbeatDetails);
      }
      if (struct.isSetWorkflowType()) {
        struct.workflowType.write(oprot);
      }
      if (struct.isSetWorkflowDomain()) {
        oprot.writeString(struct.workflowDomain);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, PollForActivityTaskResponse struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(15);
      if (incoming.get(0)) {
        struct.taskToken = iprot.readBinary();
        struct.setTaskTokenIsSet(true);
      }
      if (incoming.get(1)) {
        struct.workflowExecution = new WorkflowExecution();
        struct.workflowExecution.read(iprot);
        struct.setWorkflowExecutionIsSet(true);
      }
      if (incoming.get(2)) {
        struct.activityId = iprot.readString();
        struct.setActivityIdIsSet(true);
      }
      if (incoming.get(3)) {
        struct.activityType = new ActivityType();
        struct.activityType.read(iprot);
        struct.setActivityTypeIsSet(true);
      }
      if (incoming.get(4)) {
        struct.input = iprot.readBinary();
        struct.setInputIsSet(true);
      }
      if (incoming.get(5)) {
        struct.scheduledTimestamp = iprot.readI64();
        struct.setScheduledTimestampIsSet(true);
      }
      if (incoming.get(6)) {
        struct.scheduleToCloseTimeoutSeconds = iprot.readI32();
        struct.setScheduleToCloseTimeoutSecondsIsSet(true);
      }
      if (incoming.get(7)) {
        struct.startedTimestamp = iprot.readI64();
        struct.setStartedTimestampIsSet(true);
      }
      if (incoming.get(8)) {
        struct.startToCloseTimeoutSeconds = iprot.readI32();
        struct.setStartToCloseTimeoutSecondsIsSet(true);
      }
      if (incoming.get(9)) {
        struct.heartbeatTimeoutSeconds = iprot.readI32();
        struct.setHeartbeatTimeoutSecondsIsSet(true);
      }
      if (incoming.get(10)) {
        struct.attempt = iprot.readI32();
        struct.setAttemptIsSet(true);
      }
      if (incoming.get(11)) {
        struct.scheduledTimestampOfThisAttempt = iprot.readI64();
        struct.setScheduledTimestampOfThisAttemptIsSet(true);
      }
      if (incoming.get(12)) {
        struct.heartbeatDetails = iprot.readBinary();
        struct.setHeartbeatDetailsIsSet(true);
      }
      if (incoming.get(13)) {
        struct.workflowType = new WorkflowType();
        struct.workflowType.read(iprot);
        struct.setWorkflowTypeIsSet(true);
      }
      if (incoming.get(14)) {
        struct.workflowDomain = iprot.readString();
        struct.setWorkflowDomainIsSet(true);
      }
    }
  }

}