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

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

/**
 * 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 DomainConfiguration 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("DomainConfiguration");

  private static final org.apache.thrift.protocol.TField WORKFLOW_EXECUTION_RETENTION_PERIOD_IN_DAYS_FIELD_DESC = new org.apache.thrift.protocol.TField("workflowExecutionRetentionPeriodInDays", org.apache.thrift.protocol.TType.I32, (short)10);
  private static final org.apache.thrift.protocol.TField EMIT_METRIC_FIELD_DESC = new org.apache.thrift.protocol.TField("emitMetric", org.apache.thrift.protocol.TType.BOOL, (short)20);
  private static final org.apache.thrift.protocol.TField ARCHIVAL_BUCKET_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("archivalBucketName", org.apache.thrift.protocol.TType.STRING, (short)30);
  private static final org.apache.thrift.protocol.TField ARCHIVAL_RETENTION_PERIOD_IN_DAYS_FIELD_DESC = new org.apache.thrift.protocol.TField("archivalRetentionPeriodInDays", org.apache.thrift.protocol.TType.I32, (short)40);
  private static final org.apache.thrift.protocol.TField ARCHIVAL_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("archivalStatus", org.apache.thrift.protocol.TType.I32, (short)50);
  private static final org.apache.thrift.protocol.TField ARCHIVAL_BUCKET_OWNER_FIELD_DESC = new org.apache.thrift.protocol.TField("archivalBucketOwner", org.apache.thrift.protocol.TType.STRING, (short)60);

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

  public int workflowExecutionRetentionPeriodInDays; // optional
  public boolean emitMetric; // optional
  public String archivalBucketName; // optional
  public int archivalRetentionPeriodInDays; // optional
  /**
   * 
   * @see ArchivalStatus
   */
  public ArchivalStatus archivalStatus; // optional
  public String archivalBucketOwner; // optional

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    WORKFLOW_EXECUTION_RETENTION_PERIOD_IN_DAYS((short)10, "workflowExecutionRetentionPeriodInDays"),
    EMIT_METRIC((short)20, "emitMetric"),
    ARCHIVAL_BUCKET_NAME((short)30, "archivalBucketName"),
    ARCHIVAL_RETENTION_PERIOD_IN_DAYS((short)40, "archivalRetentionPeriodInDays"),
    /**
     * 
     * @see ArchivalStatus
     */
    ARCHIVAL_STATUS((short)50, "archivalStatus"),
    ARCHIVAL_BUCKET_OWNER((short)60, "archivalBucketOwner");

    private static final Map byName = new HashMap();

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

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 10: // WORKFLOW_EXECUTION_RETENTION_PERIOD_IN_DAYS
          return WORKFLOW_EXECUTION_RETENTION_PERIOD_IN_DAYS;
        case 20: // EMIT_METRIC
          return EMIT_METRIC;
        case 30: // ARCHIVAL_BUCKET_NAME
          return ARCHIVAL_BUCKET_NAME;
        case 40: // ARCHIVAL_RETENTION_PERIOD_IN_DAYS
          return ARCHIVAL_RETENTION_PERIOD_IN_DAYS;
        case 50: // ARCHIVAL_STATUS
          return ARCHIVAL_STATUS;
        case 60: // ARCHIVAL_BUCKET_OWNER
          return ARCHIVAL_BUCKET_OWNER;
        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 __WORKFLOWEXECUTIONRETENTIONPERIODINDAYS_ISSET_ID = 0;
  private static final int __EMITMETRIC_ISSET_ID = 1;
  private static final int __ARCHIVALRETENTIONPERIODINDAYS_ISSET_ID = 2;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.WORKFLOW_EXECUTION_RETENTION_PERIOD_IN_DAYS,_Fields.EMIT_METRIC,_Fields.ARCHIVAL_BUCKET_NAME,_Fields.ARCHIVAL_RETENTION_PERIOD_IN_DAYS,_Fields.ARCHIVAL_STATUS,_Fields.ARCHIVAL_BUCKET_OWNER};
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.WORKFLOW_EXECUTION_RETENTION_PERIOD_IN_DAYS, new org.apache.thrift.meta_data.FieldMetaData("workflowExecutionRetentionPeriodInDays", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.EMIT_METRIC, new org.apache.thrift.meta_data.FieldMetaData("emitMetric", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.ARCHIVAL_BUCKET_NAME, new org.apache.thrift.meta_data.FieldMetaData("archivalBucketName", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.ARCHIVAL_RETENTION_PERIOD_IN_DAYS, new org.apache.thrift.meta_data.FieldMetaData("archivalRetentionPeriodInDays", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.ARCHIVAL_STATUS, new org.apache.thrift.meta_data.FieldMetaData("archivalStatus", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ArchivalStatus.class)));
    tmpMap.put(_Fields.ARCHIVAL_BUCKET_OWNER, new org.apache.thrift.meta_data.FieldMetaData("archivalBucketOwner", 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(DomainConfiguration.class, metaDataMap);
  }

  public DomainConfiguration() {
  }

  /**
   * Performs a deep copy on other.
   */
  public DomainConfiguration(DomainConfiguration other) {
    __isset_bitfield = other.__isset_bitfield;
    this.workflowExecutionRetentionPeriodInDays = other.workflowExecutionRetentionPeriodInDays;
    this.emitMetric = other.emitMetric;
    if (other.isSetArchivalBucketName()) {
      this.archivalBucketName = other.archivalBucketName;
    }
    this.archivalRetentionPeriodInDays = other.archivalRetentionPeriodInDays;
    if (other.isSetArchivalStatus()) {
      this.archivalStatus = other.archivalStatus;
    }
    if (other.isSetArchivalBucketOwner()) {
      this.archivalBucketOwner = other.archivalBucketOwner;
    }
  }

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

  @Override
  public void clear() {
    setWorkflowExecutionRetentionPeriodInDaysIsSet(false);
    this.workflowExecutionRetentionPeriodInDays = 0;
    setEmitMetricIsSet(false);
    this.emitMetric = false;
    this.archivalBucketName = null;
    setArchivalRetentionPeriodInDaysIsSet(false);
    this.archivalRetentionPeriodInDays = 0;
    this.archivalStatus = null;
    this.archivalBucketOwner = null;
  }

  public int getWorkflowExecutionRetentionPeriodInDays() {
    return this.workflowExecutionRetentionPeriodInDays;
  }

  public DomainConfiguration setWorkflowExecutionRetentionPeriodInDays(int workflowExecutionRetentionPeriodInDays) {
    this.workflowExecutionRetentionPeriodInDays = workflowExecutionRetentionPeriodInDays;
    setWorkflowExecutionRetentionPeriodInDaysIsSet(true);
    return this;
  }

  public void unsetWorkflowExecutionRetentionPeriodInDays() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __WORKFLOWEXECUTIONRETENTIONPERIODINDAYS_ISSET_ID);
  }

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

  public void setWorkflowExecutionRetentionPeriodInDaysIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __WORKFLOWEXECUTIONRETENTIONPERIODINDAYS_ISSET_ID, value);
  }

  public boolean isEmitMetric() {
    return this.emitMetric;
  }

  public DomainConfiguration setEmitMetric(boolean emitMetric) {
    this.emitMetric = emitMetric;
    setEmitMetricIsSet(true);
    return this;
  }

  public void unsetEmitMetric() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __EMITMETRIC_ISSET_ID);
  }

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

  public void setEmitMetricIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __EMITMETRIC_ISSET_ID, value);
  }

  public String getArchivalBucketName() {
    return this.archivalBucketName;
  }

  public DomainConfiguration setArchivalBucketName(String archivalBucketName) {
    this.archivalBucketName = archivalBucketName;
    return this;
  }

  public void unsetArchivalBucketName() {
    this.archivalBucketName = null;
  }

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

  public void setArchivalBucketNameIsSet(boolean value) {
    if (!value) {
      this.archivalBucketName = null;
    }
  }

  public int getArchivalRetentionPeriodInDays() {
    return this.archivalRetentionPeriodInDays;
  }

  public DomainConfiguration setArchivalRetentionPeriodInDays(int archivalRetentionPeriodInDays) {
    this.archivalRetentionPeriodInDays = archivalRetentionPeriodInDays;
    setArchivalRetentionPeriodInDaysIsSet(true);
    return this;
  }

  public void unsetArchivalRetentionPeriodInDays() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ARCHIVALRETENTIONPERIODINDAYS_ISSET_ID);
  }

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

  public void setArchivalRetentionPeriodInDaysIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ARCHIVALRETENTIONPERIODINDAYS_ISSET_ID, value);
  }

  /**
   * 
   * @see ArchivalStatus
   */
  public ArchivalStatus getArchivalStatus() {
    return this.archivalStatus;
  }

  /**
   * 
   * @see ArchivalStatus
   */
  public DomainConfiguration setArchivalStatus(ArchivalStatus archivalStatus) {
    this.archivalStatus = archivalStatus;
    return this;
  }

  public void unsetArchivalStatus() {
    this.archivalStatus = null;
  }

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

  public void setArchivalStatusIsSet(boolean value) {
    if (!value) {
      this.archivalStatus = null;
    }
  }

  public String getArchivalBucketOwner() {
    return this.archivalBucketOwner;
  }

  public DomainConfiguration setArchivalBucketOwner(String archivalBucketOwner) {
    this.archivalBucketOwner = archivalBucketOwner;
    return this;
  }

  public void unsetArchivalBucketOwner() {
    this.archivalBucketOwner = null;
  }

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

  public void setArchivalBucketOwnerIsSet(boolean value) {
    if (!value) {
      this.archivalBucketOwner = null;
    }
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case WORKFLOW_EXECUTION_RETENTION_PERIOD_IN_DAYS:
      if (value == null) {
        unsetWorkflowExecutionRetentionPeriodInDays();
      } else {
        setWorkflowExecutionRetentionPeriodInDays((Integer)value);
      }
      break;

    case EMIT_METRIC:
      if (value == null) {
        unsetEmitMetric();
      } else {
        setEmitMetric((Boolean)value);
      }
      break;

    case ARCHIVAL_BUCKET_NAME:
      if (value == null) {
        unsetArchivalBucketName();
      } else {
        setArchivalBucketName((String)value);
      }
      break;

    case ARCHIVAL_RETENTION_PERIOD_IN_DAYS:
      if (value == null) {
        unsetArchivalRetentionPeriodInDays();
      } else {
        setArchivalRetentionPeriodInDays((Integer)value);
      }
      break;

    case ARCHIVAL_STATUS:
      if (value == null) {
        unsetArchivalStatus();
      } else {
        setArchivalStatus((ArchivalStatus)value);
      }
      break;

    case ARCHIVAL_BUCKET_OWNER:
      if (value == null) {
        unsetArchivalBucketOwner();
      } else {
        setArchivalBucketOwner((String)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case WORKFLOW_EXECUTION_RETENTION_PERIOD_IN_DAYS:
      return getWorkflowExecutionRetentionPeriodInDays();

    case EMIT_METRIC:
      return isEmitMetric();

    case ARCHIVAL_BUCKET_NAME:
      return getArchivalBucketName();

    case ARCHIVAL_RETENTION_PERIOD_IN_DAYS:
      return getArchivalRetentionPeriodInDays();

    case ARCHIVAL_STATUS:
      return getArchivalStatus();

    case ARCHIVAL_BUCKET_OWNER:
      return getArchivalBucketOwner();

    }
    throw new IllegalStateException();
  }

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

    switch (field) {
    case WORKFLOW_EXECUTION_RETENTION_PERIOD_IN_DAYS:
      return isSetWorkflowExecutionRetentionPeriodInDays();
    case EMIT_METRIC:
      return isSetEmitMetric();
    case ARCHIVAL_BUCKET_NAME:
      return isSetArchivalBucketName();
    case ARCHIVAL_RETENTION_PERIOD_IN_DAYS:
      return isSetArchivalRetentionPeriodInDays();
    case ARCHIVAL_STATUS:
      return isSetArchivalStatus();
    case ARCHIVAL_BUCKET_OWNER:
      return isSetArchivalBucketOwner();
    }
    throw new IllegalStateException();
  }

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

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

    boolean this_present_workflowExecutionRetentionPeriodInDays = true && this.isSetWorkflowExecutionRetentionPeriodInDays();
    boolean that_present_workflowExecutionRetentionPeriodInDays = true && that.isSetWorkflowExecutionRetentionPeriodInDays();
    if (this_present_workflowExecutionRetentionPeriodInDays || that_present_workflowExecutionRetentionPeriodInDays) {
      if (!(this_present_workflowExecutionRetentionPeriodInDays && that_present_workflowExecutionRetentionPeriodInDays))
        return false;
      if (this.workflowExecutionRetentionPeriodInDays != that.workflowExecutionRetentionPeriodInDays)
        return false;
    }

    boolean this_present_emitMetric = true && this.isSetEmitMetric();
    boolean that_present_emitMetric = true && that.isSetEmitMetric();
    if (this_present_emitMetric || that_present_emitMetric) {
      if (!(this_present_emitMetric && that_present_emitMetric))
        return false;
      if (this.emitMetric != that.emitMetric)
        return false;
    }

    boolean this_present_archivalBucketName = true && this.isSetArchivalBucketName();
    boolean that_present_archivalBucketName = true && that.isSetArchivalBucketName();
    if (this_present_archivalBucketName || that_present_archivalBucketName) {
      if (!(this_present_archivalBucketName && that_present_archivalBucketName))
        return false;
      if (!this.archivalBucketName.equals(that.archivalBucketName))
        return false;
    }

    boolean this_present_archivalRetentionPeriodInDays = true && this.isSetArchivalRetentionPeriodInDays();
    boolean that_present_archivalRetentionPeriodInDays = true && that.isSetArchivalRetentionPeriodInDays();
    if (this_present_archivalRetentionPeriodInDays || that_present_archivalRetentionPeriodInDays) {
      if (!(this_present_archivalRetentionPeriodInDays && that_present_archivalRetentionPeriodInDays))
        return false;
      if (this.archivalRetentionPeriodInDays != that.archivalRetentionPeriodInDays)
        return false;
    }

    boolean this_present_archivalStatus = true && this.isSetArchivalStatus();
    boolean that_present_archivalStatus = true && that.isSetArchivalStatus();
    if (this_present_archivalStatus || that_present_archivalStatus) {
      if (!(this_present_archivalStatus && that_present_archivalStatus))
        return false;
      if (!this.archivalStatus.equals(that.archivalStatus))
        return false;
    }

    boolean this_present_archivalBucketOwner = true && this.isSetArchivalBucketOwner();
    boolean that_present_archivalBucketOwner = true && that.isSetArchivalBucketOwner();
    if (this_present_archivalBucketOwner || that_present_archivalBucketOwner) {
      if (!(this_present_archivalBucketOwner && that_present_archivalBucketOwner))
        return false;
      if (!this.archivalBucketOwner.equals(that.archivalBucketOwner))
        return false;
    }

    return true;
  }

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

    boolean present_workflowExecutionRetentionPeriodInDays = true && (isSetWorkflowExecutionRetentionPeriodInDays());
    list.add(present_workflowExecutionRetentionPeriodInDays);
    if (present_workflowExecutionRetentionPeriodInDays)
      list.add(workflowExecutionRetentionPeriodInDays);

    boolean present_emitMetric = true && (isSetEmitMetric());
    list.add(present_emitMetric);
    if (present_emitMetric)
      list.add(emitMetric);

    boolean present_archivalBucketName = true && (isSetArchivalBucketName());
    list.add(present_archivalBucketName);
    if (present_archivalBucketName)
      list.add(archivalBucketName);

    boolean present_archivalRetentionPeriodInDays = true && (isSetArchivalRetentionPeriodInDays());
    list.add(present_archivalRetentionPeriodInDays);
    if (present_archivalRetentionPeriodInDays)
      list.add(archivalRetentionPeriodInDays);

    boolean present_archivalStatus = true && (isSetArchivalStatus());
    list.add(present_archivalStatus);
    if (present_archivalStatus)
      list.add(archivalStatus.getValue());

    boolean present_archivalBucketOwner = true && (isSetArchivalBucketOwner());
    list.add(present_archivalBucketOwner);
    if (present_archivalBucketOwner)
      list.add(archivalBucketOwner);

    return list.hashCode();
  }

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

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetWorkflowExecutionRetentionPeriodInDays()).compareTo(other.isSetWorkflowExecutionRetentionPeriodInDays());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetWorkflowExecutionRetentionPeriodInDays()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.workflowExecutionRetentionPeriodInDays, other.workflowExecutionRetentionPeriodInDays);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetEmitMetric()).compareTo(other.isSetEmitMetric());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetEmitMetric()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.emitMetric, other.emitMetric);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetArchivalBucketName()).compareTo(other.isSetArchivalBucketName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetArchivalBucketName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.archivalBucketName, other.archivalBucketName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetArchivalRetentionPeriodInDays()).compareTo(other.isSetArchivalRetentionPeriodInDays());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetArchivalRetentionPeriodInDays()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.archivalRetentionPeriodInDays, other.archivalRetentionPeriodInDays);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetArchivalStatus()).compareTo(other.isSetArchivalStatus());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetArchivalStatus()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.archivalStatus, other.archivalStatus);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetArchivalBucketOwner()).compareTo(other.isSetArchivalBucketOwner());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetArchivalBucketOwner()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.archivalBucketOwner, other.archivalBucketOwner);
      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("DomainConfiguration(");
    boolean first = true;

    if (isSetWorkflowExecutionRetentionPeriodInDays()) {
      sb.append("workflowExecutionRetentionPeriodInDays:");
      sb.append(this.workflowExecutionRetentionPeriodInDays);
      first = false;
    }
    if (isSetEmitMetric()) {
      if (!first) sb.append(", ");
      sb.append("emitMetric:");
      sb.append(this.emitMetric);
      first = false;
    }
    if (isSetArchivalBucketName()) {
      if (!first) sb.append(", ");
      sb.append("archivalBucketName:");
      if (this.archivalBucketName == null) {
        sb.append("null");
      } else {
        sb.append(this.archivalBucketName);
      }
      first = false;
    }
    if (isSetArchivalRetentionPeriodInDays()) {
      if (!first) sb.append(", ");
      sb.append("archivalRetentionPeriodInDays:");
      sb.append(this.archivalRetentionPeriodInDays);
      first = false;
    }
    if (isSetArchivalStatus()) {
      if (!first) sb.append(", ");
      sb.append("archivalStatus:");
      if (this.archivalStatus == null) {
        sb.append("null");
      } else {
        sb.append(this.archivalStatus);
      }
      first = false;
    }
    if (isSetArchivalBucketOwner()) {
      if (!first) sb.append(", ");
      sb.append("archivalBucketOwner:");
      if (this.archivalBucketOwner == null) {
        sb.append("null");
      } else {
        sb.append(this.archivalBucketOwner);
      }
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // check for sub-struct validity
  }

  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 DomainConfigurationStandardSchemeFactory implements SchemeFactory {
    public DomainConfigurationStandardScheme getScheme() {
      return new DomainConfigurationStandardScheme();
    }
  }

  private static class DomainConfigurationStandardScheme extends StandardScheme {

    public void read(org.apache.thrift.protocol.TProtocol iprot, DomainConfiguration struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true)
      {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (schemeField.id) {
          case 10: // WORKFLOW_EXECUTION_RETENTION_PERIOD_IN_DAYS
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.workflowExecutionRetentionPeriodInDays = iprot.readI32();
              struct.setWorkflowExecutionRetentionPeriodInDaysIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 20: // EMIT_METRIC
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.emitMetric = iprot.readBool();
              struct.setEmitMetricIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 30: // ARCHIVAL_BUCKET_NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.archivalBucketName = iprot.readString();
              struct.setArchivalBucketNameIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 40: // ARCHIVAL_RETENTION_PERIOD_IN_DAYS
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.archivalRetentionPeriodInDays = iprot.readI32();
              struct.setArchivalRetentionPeriodInDaysIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 50: // ARCHIVAL_STATUS
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.archivalStatus = com.uber.cadence.ArchivalStatus.findByValue(iprot.readI32());
              struct.setArchivalStatusIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 60: // ARCHIVAL_BUCKET_OWNER
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.archivalBucketOwner = iprot.readString();
              struct.setArchivalBucketOwnerIsSet(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, DomainConfiguration struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.isSetWorkflowExecutionRetentionPeriodInDays()) {
        oprot.writeFieldBegin(WORKFLOW_EXECUTION_RETENTION_PERIOD_IN_DAYS_FIELD_DESC);
        oprot.writeI32(struct.workflowExecutionRetentionPeriodInDays);
        oprot.writeFieldEnd();
      }
      if (struct.isSetEmitMetric()) {
        oprot.writeFieldBegin(EMIT_METRIC_FIELD_DESC);
        oprot.writeBool(struct.emitMetric);
        oprot.writeFieldEnd();
      }
      if (struct.archivalBucketName != null) {
        if (struct.isSetArchivalBucketName()) {
          oprot.writeFieldBegin(ARCHIVAL_BUCKET_NAME_FIELD_DESC);
          oprot.writeString(struct.archivalBucketName);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetArchivalRetentionPeriodInDays()) {
        oprot.writeFieldBegin(ARCHIVAL_RETENTION_PERIOD_IN_DAYS_FIELD_DESC);
        oprot.writeI32(struct.archivalRetentionPeriodInDays);
        oprot.writeFieldEnd();
      }
      if (struct.archivalStatus != null) {
        if (struct.isSetArchivalStatus()) {
          oprot.writeFieldBegin(ARCHIVAL_STATUS_FIELD_DESC);
          oprot.writeI32(struct.archivalStatus.getValue());
          oprot.writeFieldEnd();
        }
      }
      if (struct.archivalBucketOwner != null) {
        if (struct.isSetArchivalBucketOwner()) {
          oprot.writeFieldBegin(ARCHIVAL_BUCKET_OWNER_FIELD_DESC);
          oprot.writeString(struct.archivalBucketOwner);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class DomainConfigurationTupleSchemeFactory implements SchemeFactory {
    public DomainConfigurationTupleScheme getScheme() {
      return new DomainConfigurationTupleScheme();
    }
  }

  private static class DomainConfigurationTupleScheme extends TupleScheme {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, DomainConfiguration struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetWorkflowExecutionRetentionPeriodInDays()) {
        optionals.set(0);
      }
      if (struct.isSetEmitMetric()) {
        optionals.set(1);
      }
      if (struct.isSetArchivalBucketName()) {
        optionals.set(2);
      }
      if (struct.isSetArchivalRetentionPeriodInDays()) {
        optionals.set(3);
      }
      if (struct.isSetArchivalStatus()) {
        optionals.set(4);
      }
      if (struct.isSetArchivalBucketOwner()) {
        optionals.set(5);
      }
      oprot.writeBitSet(optionals, 6);
      if (struct.isSetWorkflowExecutionRetentionPeriodInDays()) {
        oprot.writeI32(struct.workflowExecutionRetentionPeriodInDays);
      }
      if (struct.isSetEmitMetric()) {
        oprot.writeBool(struct.emitMetric);
      }
      if (struct.isSetArchivalBucketName()) {
        oprot.writeString(struct.archivalBucketName);
      }
      if (struct.isSetArchivalRetentionPeriodInDays()) {
        oprot.writeI32(struct.archivalRetentionPeriodInDays);
      }
      if (struct.isSetArchivalStatus()) {
        oprot.writeI32(struct.archivalStatus.getValue());
      }
      if (struct.isSetArchivalBucketOwner()) {
        oprot.writeString(struct.archivalBucketOwner);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, DomainConfiguration struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(6);
      if (incoming.get(0)) {
        struct.workflowExecutionRetentionPeriodInDays = iprot.readI32();
        struct.setWorkflowExecutionRetentionPeriodInDaysIsSet(true);
      }
      if (incoming.get(1)) {
        struct.emitMetric = iprot.readBool();
        struct.setEmitMetricIsSet(true);
      }
      if (incoming.get(2)) {
        struct.archivalBucketName = iprot.readString();
        struct.setArchivalBucketNameIsSet(true);
      }
      if (incoming.get(3)) {
        struct.archivalRetentionPeriodInDays = iprot.readI32();
        struct.setArchivalRetentionPeriodInDaysIsSet(true);
      }
      if (incoming.get(4)) {
        struct.archivalStatus = com.uber.cadence.ArchivalStatus.findByValue(iprot.readI32());
        struct.setArchivalStatusIsSet(true);
      }
      if (incoming.get(5)) {
        struct.archivalBucketOwner = iprot.readString();
        struct.setArchivalBucketOwnerIsSet(true);
      }
    }
  }

}