/**
 * Autogenerated by Thrift Compiler (0.12.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package com.facebook.buck.artifact_cache.thrift;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)")
public class ArtifactMetadata implements org.apache.thrift.TBase<ArtifactMetadata, ArtifactMetadata._Fields>, java.io.Serializable, Cloneable, Comparable<ArtifactMetadata> {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ArtifactMetadata");

  private static final org.apache.thrift.protocol.TField RULE_KEYS_FIELD_DESC = new org.apache.thrift.protocol.TField("ruleKeys", org.apache.thrift.protocol.TType.LIST, (short)1);
  private static final org.apache.thrift.protocol.TField METADATA_FIELD_DESC = new org.apache.thrift.protocol.TField("metadata", org.apache.thrift.protocol.TType.MAP, (short)2);
  private static final org.apache.thrift.protocol.TField BUILD_TARGET_FIELD_DESC = new org.apache.thrift.protocol.TField("buildTarget", org.apache.thrift.protocol.TType.STRING, (short)3);
  private static final org.apache.thrift.protocol.TField REPOSITORY_FIELD_DESC = new org.apache.thrift.protocol.TField("repository", org.apache.thrift.protocol.TType.STRING, (short)4);
  private static final org.apache.thrift.protocol.TField ARTIFACT_PAYLOAD_CRC32_FIELD_DESC = new org.apache.thrift.protocol.TField("artifactPayloadCrc32", org.apache.thrift.protocol.TType.STRING, (short)5);
  private static final org.apache.thrift.protocol.TField SCHEDULE_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("scheduleType", org.apache.thrift.protocol.TType.STRING, (short)6);
  private static final org.apache.thrift.protocol.TField ARTIFACT_PAYLOAD_MD5_FIELD_DESC = new org.apache.thrift.protocol.TField("artifactPayloadMd5", org.apache.thrift.protocol.TType.STRING, (short)7);
  private static final org.apache.thrift.protocol.TField DISTRIBUTED_BUILD_MODE_ENABLED_FIELD_DESC = new org.apache.thrift.protocol.TField("distributedBuildModeEnabled", org.apache.thrift.protocol.TType.BOOL, (short)8);
  private static final org.apache.thrift.protocol.TField PRODUCER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("producerId", org.apache.thrift.protocol.TType.STRING, (short)9);
  private static final org.apache.thrift.protocol.TField BUILD_TIME_MS_FIELD_DESC = new org.apache.thrift.protocol.TField("buildTimeMs", org.apache.thrift.protocol.TType.I64, (short)10);
  private static final org.apache.thrift.protocol.TField PRODUCER_HOSTNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("producerHostname", org.apache.thrift.protocol.TType.STRING, (short)11);
  private static final org.apache.thrift.protocol.TField SIZE_BYTES_FIELD_DESC = new org.apache.thrift.protocol.TField("sizeBytes", org.apache.thrift.protocol.TType.I64, (short)12);
  private static final org.apache.thrift.protocol.TField CONFIGURATION_FIELD_DESC = new org.apache.thrift.protocol.TField("configuration", org.apache.thrift.protocol.TType.STRING, (short)13);

  private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new ArtifactMetadataStandardSchemeFactory();
  private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new ArtifactMetadataTupleSchemeFactory();

  public @org.apache.thrift.annotation.Nullable java.util.List<RuleKey> ruleKeys; // optional
  public @org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.lang.String> metadata; // optional
  public @org.apache.thrift.annotation.Nullable java.lang.String buildTarget; // optional
  public @org.apache.thrift.annotation.Nullable java.lang.String repository; // optional
  public @org.apache.thrift.annotation.Nullable java.lang.String artifactPayloadCrc32; // optional
  public @org.apache.thrift.annotation.Nullable java.lang.String scheduleType; // optional
  public @org.apache.thrift.annotation.Nullable java.lang.String artifactPayloadMd5; // optional
  public boolean distributedBuildModeEnabled; // optional
  public @org.apache.thrift.annotation.Nullable java.lang.String producerId; // optional
  public long buildTimeMs; // optional
  public @org.apache.thrift.annotation.Nullable java.lang.String producerHostname; // optional
  public long sizeBytes; // optional
  public @org.apache.thrift.annotation.Nullable java.lang.String configuration; // 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 {
    RULE_KEYS((short)1, "ruleKeys"),
    METADATA((short)2, "metadata"),
    BUILD_TARGET((short)3, "buildTarget"),
    REPOSITORY((short)4, "repository"),
    ARTIFACT_PAYLOAD_CRC32((short)5, "artifactPayloadCrc32"),
    SCHEDULE_TYPE((short)6, "scheduleType"),
    ARTIFACT_PAYLOAD_MD5((short)7, "artifactPayloadMd5"),
    DISTRIBUTED_BUILD_MODE_ENABLED((short)8, "distributedBuildModeEnabled"),
    PRODUCER_ID((short)9, "producerId"),
    BUILD_TIME_MS((short)10, "buildTimeMs"),
    PRODUCER_HOSTNAME((short)11, "producerHostname"),
    SIZE_BYTES((short)12, "sizeBytes"),
    CONFIGURATION((short)13, "configuration");

    private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();

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

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    @org.apache.thrift.annotation.Nullable
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // RULE_KEYS
          return RULE_KEYS;
        case 2: // METADATA
          return METADATA;
        case 3: // BUILD_TARGET
          return BUILD_TARGET;
        case 4: // REPOSITORY
          return REPOSITORY;
        case 5: // ARTIFACT_PAYLOAD_CRC32
          return ARTIFACT_PAYLOAD_CRC32;
        case 6: // SCHEDULE_TYPE
          return SCHEDULE_TYPE;
        case 7: // ARTIFACT_PAYLOAD_MD5
          return ARTIFACT_PAYLOAD_MD5;
        case 8: // DISTRIBUTED_BUILD_MODE_ENABLED
          return DISTRIBUTED_BUILD_MODE_ENABLED;
        case 9: // PRODUCER_ID
          return PRODUCER_ID;
        case 10: // BUILD_TIME_MS
          return BUILD_TIME_MS;
        case 11: // PRODUCER_HOSTNAME
          return PRODUCER_HOSTNAME;
        case 12: // SIZE_BYTES
          return SIZE_BYTES;
        case 13: // CONFIGURATION
          return CONFIGURATION;
        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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
      return fields;
    }

    /**
     * Find the _Fields constant that matches name, or null if its not found.
     */
    @org.apache.thrift.annotation.Nullable
    public static _Fields findByName(java.lang.String name) {
      return byName.get(name);
    }

    private final short _thriftId;
    private final java.lang.String _fieldName;

    _Fields(short thriftId, java.lang.String fieldName) {
      _thriftId = thriftId;
      _fieldName = fieldName;
    }

    public short getThriftFieldId() {
      return _thriftId;
    }

    public java.lang.String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final int __DISTRIBUTEDBUILDMODEENABLED_ISSET_ID = 0;
  private static final int __BUILDTIMEMS_ISSET_ID = 1;
  private static final int __SIZEBYTES_ISSET_ID = 2;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.RULE_KEYS,_Fields.METADATA,_Fields.BUILD_TARGET,_Fields.REPOSITORY,_Fields.ARTIFACT_PAYLOAD_CRC32,_Fields.SCHEDULE_TYPE,_Fields.ARTIFACT_PAYLOAD_MD5,_Fields.DISTRIBUTED_BUILD_MODE_ENABLED,_Fields.PRODUCER_ID,_Fields.BUILD_TIME_MS,_Fields.PRODUCER_HOSTNAME,_Fields.SIZE_BYTES,_Fields.CONFIGURATION};
  public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.RULE_KEYS, new org.apache.thrift.meta_data.FieldMetaData("ruleKeys", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RuleKey.class))));
    tmpMap.put(_Fields.METADATA, new org.apache.thrift.meta_data.FieldMetaData("metadata", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
    tmpMap.put(_Fields.BUILD_TARGET, new org.apache.thrift.meta_data.FieldMetaData("buildTarget", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.REPOSITORY, new org.apache.thrift.meta_data.FieldMetaData("repository", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.ARTIFACT_PAYLOAD_CRC32, new org.apache.thrift.meta_data.FieldMetaData("artifactPayloadCrc32", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.SCHEDULE_TYPE, new org.apache.thrift.meta_data.FieldMetaData("scheduleType", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.ARTIFACT_PAYLOAD_MD5, new org.apache.thrift.meta_data.FieldMetaData("artifactPayloadMd5", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.DISTRIBUTED_BUILD_MODE_ENABLED, new org.apache.thrift.meta_data.FieldMetaData("distributedBuildModeEnabled", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.PRODUCER_ID, new org.apache.thrift.meta_data.FieldMetaData("producerId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.BUILD_TIME_MS, new org.apache.thrift.meta_data.FieldMetaData("buildTimeMs", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.PRODUCER_HOSTNAME, new org.apache.thrift.meta_data.FieldMetaData("producerHostname", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.SIZE_BYTES, new org.apache.thrift.meta_data.FieldMetaData("sizeBytes", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.CONFIGURATION, new org.apache.thrift.meta_data.FieldMetaData("configuration", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ArtifactMetadata.class, metaDataMap);
  }

  public ArtifactMetadata() {
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public ArtifactMetadata(ArtifactMetadata other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetRuleKeys()) {
      java.util.List<RuleKey> __this__ruleKeys = new java.util.ArrayList<RuleKey>(other.ruleKeys.size());
      for (RuleKey other_element : other.ruleKeys) {
        __this__ruleKeys.add(new RuleKey(other_element));
      }
      this.ruleKeys = __this__ruleKeys;
    }
    if (other.isSetMetadata()) {
      java.util.Map<java.lang.String,java.lang.String> __this__metadata = new java.util.HashMap<java.lang.String,java.lang.String>(other.metadata);
      this.metadata = __this__metadata;
    }
    if (other.isSetBuildTarget()) {
      this.buildTarget = other.buildTarget;
    }
    if (other.isSetRepository()) {
      this.repository = other.repository;
    }
    if (other.isSetArtifactPayloadCrc32()) {
      this.artifactPayloadCrc32 = other.artifactPayloadCrc32;
    }
    if (other.isSetScheduleType()) {
      this.scheduleType = other.scheduleType;
    }
    if (other.isSetArtifactPayloadMd5()) {
      this.artifactPayloadMd5 = other.artifactPayloadMd5;
    }
    this.distributedBuildModeEnabled = other.distributedBuildModeEnabled;
    if (other.isSetProducerId()) {
      this.producerId = other.producerId;
    }
    this.buildTimeMs = other.buildTimeMs;
    if (other.isSetProducerHostname()) {
      this.producerHostname = other.producerHostname;
    }
    this.sizeBytes = other.sizeBytes;
    if (other.isSetConfiguration()) {
      this.configuration = other.configuration;
    }
  }

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

  @Override
  public void clear() {
    this.ruleKeys = null;
    this.metadata = null;
    this.buildTarget = null;
    this.repository = null;
    this.artifactPayloadCrc32 = null;
    this.scheduleType = null;
    this.artifactPayloadMd5 = null;
    setDistributedBuildModeEnabledIsSet(false);
    this.distributedBuildModeEnabled = false;
    this.producerId = null;
    setBuildTimeMsIsSet(false);
    this.buildTimeMs = 0;
    this.producerHostname = null;
    setSizeBytesIsSet(false);
    this.sizeBytes = 0;
    this.configuration = null;
  }

  public int getRuleKeysSize() {
    return (this.ruleKeys == null) ? 0 : this.ruleKeys.size();
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.Iterator<RuleKey> getRuleKeysIterator() {
    return (this.ruleKeys == null) ? null : this.ruleKeys.iterator();
  }

  public void addToRuleKeys(RuleKey elem) {
    if (this.ruleKeys == null) {
      this.ruleKeys = new java.util.ArrayList<RuleKey>();
    }
    this.ruleKeys.add(elem);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.List<RuleKey> getRuleKeys() {
    return this.ruleKeys;
  }

  public ArtifactMetadata setRuleKeys(@org.apache.thrift.annotation.Nullable java.util.List<RuleKey> ruleKeys) {
    this.ruleKeys = ruleKeys;
    return this;
  }

  public void unsetRuleKeys() {
    this.ruleKeys = null;
  }

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

  public void setRuleKeysIsSet(boolean value) {
    if (!value) {
      this.ruleKeys = null;
    }
  }

  public int getMetadataSize() {
    return (this.metadata == null) ? 0 : this.metadata.size();
  }

  public void putToMetadata(java.lang.String key, java.lang.String val) {
    if (this.metadata == null) {
      this.metadata = new java.util.HashMap<java.lang.String,java.lang.String>();
    }
    this.metadata.put(key, val);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.Map<java.lang.String,java.lang.String> getMetadata() {
    return this.metadata;
  }

  public ArtifactMetadata setMetadata(@org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.lang.String> metadata) {
    this.metadata = metadata;
    return this;
  }

  public void unsetMetadata() {
    this.metadata = null;
  }

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

  public void setMetadataIsSet(boolean value) {
    if (!value) {
      this.metadata = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.String getBuildTarget() {
    return this.buildTarget;
  }

  public ArtifactMetadata setBuildTarget(@org.apache.thrift.annotation.Nullable java.lang.String buildTarget) {
    this.buildTarget = buildTarget;
    return this;
  }

  public void unsetBuildTarget() {
    this.buildTarget = null;
  }

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

  public void setBuildTargetIsSet(boolean value) {
    if (!value) {
      this.buildTarget = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.String getRepository() {
    return this.repository;
  }

  public ArtifactMetadata setRepository(@org.apache.thrift.annotation.Nullable java.lang.String repository) {
    this.repository = repository;
    return this;
  }

  public void unsetRepository() {
    this.repository = null;
  }

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

  public void setRepositoryIsSet(boolean value) {
    if (!value) {
      this.repository = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.String getArtifactPayloadCrc32() {
    return this.artifactPayloadCrc32;
  }

  public ArtifactMetadata setArtifactPayloadCrc32(@org.apache.thrift.annotation.Nullable java.lang.String artifactPayloadCrc32) {
    this.artifactPayloadCrc32 = artifactPayloadCrc32;
    return this;
  }

  public void unsetArtifactPayloadCrc32() {
    this.artifactPayloadCrc32 = null;
  }

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

  public void setArtifactPayloadCrc32IsSet(boolean value) {
    if (!value) {
      this.artifactPayloadCrc32 = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.String getScheduleType() {
    return this.scheduleType;
  }

  public ArtifactMetadata setScheduleType(@org.apache.thrift.annotation.Nullable java.lang.String scheduleType) {
    this.scheduleType = scheduleType;
    return this;
  }

  public void unsetScheduleType() {
    this.scheduleType = null;
  }

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

  public void setScheduleTypeIsSet(boolean value) {
    if (!value) {
      this.scheduleType = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.String getArtifactPayloadMd5() {
    return this.artifactPayloadMd5;
  }

  public ArtifactMetadata setArtifactPayloadMd5(@org.apache.thrift.annotation.Nullable java.lang.String artifactPayloadMd5) {
    this.artifactPayloadMd5 = artifactPayloadMd5;
    return this;
  }

  public void unsetArtifactPayloadMd5() {
    this.artifactPayloadMd5 = null;
  }

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

  public void setArtifactPayloadMd5IsSet(boolean value) {
    if (!value) {
      this.artifactPayloadMd5 = null;
    }
  }

  public boolean isDistributedBuildModeEnabled() {
    return this.distributedBuildModeEnabled;
  }

  public ArtifactMetadata setDistributedBuildModeEnabled(boolean distributedBuildModeEnabled) {
    this.distributedBuildModeEnabled = distributedBuildModeEnabled;
    setDistributedBuildModeEnabledIsSet(true);
    return this;
  }

  public void unsetDistributedBuildModeEnabled() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __DISTRIBUTEDBUILDMODEENABLED_ISSET_ID);
  }

  /** Returns true if field distributedBuildModeEnabled is set (has been assigned a value) and false otherwise */
  public boolean isSetDistributedBuildModeEnabled() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __DISTRIBUTEDBUILDMODEENABLED_ISSET_ID);
  }

  public void setDistributedBuildModeEnabledIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __DISTRIBUTEDBUILDMODEENABLED_ISSET_ID, value);
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.String getProducerId() {
    return this.producerId;
  }

  public ArtifactMetadata setProducerId(@org.apache.thrift.annotation.Nullable java.lang.String producerId) {
    this.producerId = producerId;
    return this;
  }

  public void unsetProducerId() {
    this.producerId = null;
  }

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

  public void setProducerIdIsSet(boolean value) {
    if (!value) {
      this.producerId = null;
    }
  }

  public long getBuildTimeMs() {
    return this.buildTimeMs;
  }

  public ArtifactMetadata setBuildTimeMs(long buildTimeMs) {
    this.buildTimeMs = buildTimeMs;
    setBuildTimeMsIsSet(true);
    return this;
  }

  public void unsetBuildTimeMs() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __BUILDTIMEMS_ISSET_ID);
  }

  /** Returns true if field buildTimeMs is set (has been assigned a value) and false otherwise */
  public boolean isSetBuildTimeMs() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __BUILDTIMEMS_ISSET_ID);
  }

  public void setBuildTimeMsIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __BUILDTIMEMS_ISSET_ID, value);
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.String getProducerHostname() {
    return this.producerHostname;
  }

  public ArtifactMetadata setProducerHostname(@org.apache.thrift.annotation.Nullable java.lang.String producerHostname) {
    this.producerHostname = producerHostname;
    return this;
  }

  public void unsetProducerHostname() {
    this.producerHostname = null;
  }

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

  public void setProducerHostnameIsSet(boolean value) {
    if (!value) {
      this.producerHostname = null;
    }
  }

  public long getSizeBytes() {
    return this.sizeBytes;
  }

  public ArtifactMetadata setSizeBytes(long sizeBytes) {
    this.sizeBytes = sizeBytes;
    setSizeBytesIsSet(true);
    return this;
  }

  public void unsetSizeBytes() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SIZEBYTES_ISSET_ID);
  }

  /** Returns true if field sizeBytes is set (has been assigned a value) and false otherwise */
  public boolean isSetSizeBytes() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SIZEBYTES_ISSET_ID);
  }

  public void setSizeBytesIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SIZEBYTES_ISSET_ID, value);
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.String getConfiguration() {
    return this.configuration;
  }

  public ArtifactMetadata setConfiguration(@org.apache.thrift.annotation.Nullable java.lang.String configuration) {
    this.configuration = configuration;
    return this;
  }

  public void unsetConfiguration() {
    this.configuration = null;
  }

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

  public void setConfigurationIsSet(boolean value) {
    if (!value) {
      this.configuration = null;
    }
  }

  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case RULE_KEYS:
      if (value == null) {
        unsetRuleKeys();
      } else {
        setRuleKeys((java.util.List<RuleKey>)value);
      }
      break;

    case METADATA:
      if (value == null) {
        unsetMetadata();
      } else {
        setMetadata((java.util.Map<java.lang.String,java.lang.String>)value);
      }
      break;

    case BUILD_TARGET:
      if (value == null) {
        unsetBuildTarget();
      } else {
        setBuildTarget((java.lang.String)value);
      }
      break;

    case REPOSITORY:
      if (value == null) {
        unsetRepository();
      } else {
        setRepository((java.lang.String)value);
      }
      break;

    case ARTIFACT_PAYLOAD_CRC32:
      if (value == null) {
        unsetArtifactPayloadCrc32();
      } else {
        setArtifactPayloadCrc32((java.lang.String)value);
      }
      break;

    case SCHEDULE_TYPE:
      if (value == null) {
        unsetScheduleType();
      } else {
        setScheduleType((java.lang.String)value);
      }
      break;

    case ARTIFACT_PAYLOAD_MD5:
      if (value == null) {
        unsetArtifactPayloadMd5();
      } else {
        setArtifactPayloadMd5((java.lang.String)value);
      }
      break;

    case DISTRIBUTED_BUILD_MODE_ENABLED:
      if (value == null) {
        unsetDistributedBuildModeEnabled();
      } else {
        setDistributedBuildModeEnabled((java.lang.Boolean)value);
      }
      break;

    case PRODUCER_ID:
      if (value == null) {
        unsetProducerId();
      } else {
        setProducerId((java.lang.String)value);
      }
      break;

    case BUILD_TIME_MS:
      if (value == null) {
        unsetBuildTimeMs();
      } else {
        setBuildTimeMs((java.lang.Long)value);
      }
      break;

    case PRODUCER_HOSTNAME:
      if (value == null) {
        unsetProducerHostname();
      } else {
        setProducerHostname((java.lang.String)value);
      }
      break;

    case SIZE_BYTES:
      if (value == null) {
        unsetSizeBytes();
      } else {
        setSizeBytes((java.lang.Long)value);
      }
      break;

    case CONFIGURATION:
      if (value == null) {
        unsetConfiguration();
      } else {
        setConfiguration((java.lang.String)value);
      }
      break;

    }
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.Object getFieldValue(_Fields field) {
    switch (field) {
    case RULE_KEYS:
      return getRuleKeys();

    case METADATA:
      return getMetadata();

    case BUILD_TARGET:
      return getBuildTarget();

    case REPOSITORY:
      return getRepository();

    case ARTIFACT_PAYLOAD_CRC32:
      return getArtifactPayloadCrc32();

    case SCHEDULE_TYPE:
      return getScheduleType();

    case ARTIFACT_PAYLOAD_MD5:
      return getArtifactPayloadMd5();

    case DISTRIBUTED_BUILD_MODE_ENABLED:
      return isDistributedBuildModeEnabled();

    case PRODUCER_ID:
      return getProducerId();

    case BUILD_TIME_MS:
      return getBuildTimeMs();

    case PRODUCER_HOSTNAME:
      return getProducerHostname();

    case SIZE_BYTES:
      return getSizeBytes();

    case CONFIGURATION:
      return getConfiguration();

    }
    throw new java.lang.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 java.lang.IllegalArgumentException();
    }

    switch (field) {
    case RULE_KEYS:
      return isSetRuleKeys();
    case METADATA:
      return isSetMetadata();
    case BUILD_TARGET:
      return isSetBuildTarget();
    case REPOSITORY:
      return isSetRepository();
    case ARTIFACT_PAYLOAD_CRC32:
      return isSetArtifactPayloadCrc32();
    case SCHEDULE_TYPE:
      return isSetScheduleType();
    case ARTIFACT_PAYLOAD_MD5:
      return isSetArtifactPayloadMd5();
    case DISTRIBUTED_BUILD_MODE_ENABLED:
      return isSetDistributedBuildModeEnabled();
    case PRODUCER_ID:
      return isSetProducerId();
    case BUILD_TIME_MS:
      return isSetBuildTimeMs();
    case PRODUCER_HOSTNAME:
      return isSetProducerHostname();
    case SIZE_BYTES:
      return isSetSizeBytes();
    case CONFIGURATION:
      return isSetConfiguration();
    }
    throw new java.lang.IllegalStateException();
  }

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

  public boolean equals(ArtifactMetadata that) {
    if (that == null)
      return false;
    if (this == that)
      return true;

    boolean this_present_ruleKeys = true && this.isSetRuleKeys();
    boolean that_present_ruleKeys = true && that.isSetRuleKeys();
    if (this_present_ruleKeys || that_present_ruleKeys) {
      if (!(this_present_ruleKeys && that_present_ruleKeys))
        return false;
      if (!this.ruleKeys.equals(that.ruleKeys))
        return false;
    }

    boolean this_present_metadata = true && this.isSetMetadata();
    boolean that_present_metadata = true && that.isSetMetadata();
    if (this_present_metadata || that_present_metadata) {
      if (!(this_present_metadata && that_present_metadata))
        return false;
      if (!this.metadata.equals(that.metadata))
        return false;
    }

    boolean this_present_buildTarget = true && this.isSetBuildTarget();
    boolean that_present_buildTarget = true && that.isSetBuildTarget();
    if (this_present_buildTarget || that_present_buildTarget) {
      if (!(this_present_buildTarget && that_present_buildTarget))
        return false;
      if (!this.buildTarget.equals(that.buildTarget))
        return false;
    }

    boolean this_present_repository = true && this.isSetRepository();
    boolean that_present_repository = true && that.isSetRepository();
    if (this_present_repository || that_present_repository) {
      if (!(this_present_repository && that_present_repository))
        return false;
      if (!this.repository.equals(that.repository))
        return false;
    }

    boolean this_present_artifactPayloadCrc32 = true && this.isSetArtifactPayloadCrc32();
    boolean that_present_artifactPayloadCrc32 = true && that.isSetArtifactPayloadCrc32();
    if (this_present_artifactPayloadCrc32 || that_present_artifactPayloadCrc32) {
      if (!(this_present_artifactPayloadCrc32 && that_present_artifactPayloadCrc32))
        return false;
      if (!this.artifactPayloadCrc32.equals(that.artifactPayloadCrc32))
        return false;
    }

    boolean this_present_scheduleType = true && this.isSetScheduleType();
    boolean that_present_scheduleType = true && that.isSetScheduleType();
    if (this_present_scheduleType || that_present_scheduleType) {
      if (!(this_present_scheduleType && that_present_scheduleType))
        return false;
      if (!this.scheduleType.equals(that.scheduleType))
        return false;
    }

    boolean this_present_artifactPayloadMd5 = true && this.isSetArtifactPayloadMd5();
    boolean that_present_artifactPayloadMd5 = true && that.isSetArtifactPayloadMd5();
    if (this_present_artifactPayloadMd5 || that_present_artifactPayloadMd5) {
      if (!(this_present_artifactPayloadMd5 && that_present_artifactPayloadMd5))
        return false;
      if (!this.artifactPayloadMd5.equals(that.artifactPayloadMd5))
        return false;
    }

    boolean this_present_distributedBuildModeEnabled = true && this.isSetDistributedBuildModeEnabled();
    boolean that_present_distributedBuildModeEnabled = true && that.isSetDistributedBuildModeEnabled();
    if (this_present_distributedBuildModeEnabled || that_present_distributedBuildModeEnabled) {
      if (!(this_present_distributedBuildModeEnabled && that_present_distributedBuildModeEnabled))
        return false;
      if (this.distributedBuildModeEnabled != that.distributedBuildModeEnabled)
        return false;
    }

    boolean this_present_producerId = true && this.isSetProducerId();
    boolean that_present_producerId = true && that.isSetProducerId();
    if (this_present_producerId || that_present_producerId) {
      if (!(this_present_producerId && that_present_producerId))
        return false;
      if (!this.producerId.equals(that.producerId))
        return false;
    }

    boolean this_present_buildTimeMs = true && this.isSetBuildTimeMs();
    boolean that_present_buildTimeMs = true && that.isSetBuildTimeMs();
    if (this_present_buildTimeMs || that_present_buildTimeMs) {
      if (!(this_present_buildTimeMs && that_present_buildTimeMs))
        return false;
      if (this.buildTimeMs != that.buildTimeMs)
        return false;
    }

    boolean this_present_producerHostname = true && this.isSetProducerHostname();
    boolean that_present_producerHostname = true && that.isSetProducerHostname();
    if (this_present_producerHostname || that_present_producerHostname) {
      if (!(this_present_producerHostname && that_present_producerHostname))
        return false;
      if (!this.producerHostname.equals(that.producerHostname))
        return false;
    }

    boolean this_present_sizeBytes = true && this.isSetSizeBytes();
    boolean that_present_sizeBytes = true && that.isSetSizeBytes();
    if (this_present_sizeBytes || that_present_sizeBytes) {
      if (!(this_present_sizeBytes && that_present_sizeBytes))
        return false;
      if (this.sizeBytes != that.sizeBytes)
        return false;
    }

    boolean this_present_configuration = true && this.isSetConfiguration();
    boolean that_present_configuration = true && that.isSetConfiguration();
    if (this_present_configuration || that_present_configuration) {
      if (!(this_present_configuration && that_present_configuration))
        return false;
      if (!this.configuration.equals(that.configuration))
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    int hashCode = 1;

    hashCode = hashCode * 8191 + ((isSetRuleKeys()) ? 131071 : 524287);
    if (isSetRuleKeys())
      hashCode = hashCode * 8191 + ruleKeys.hashCode();

    hashCode = hashCode * 8191 + ((isSetMetadata()) ? 131071 : 524287);
    if (isSetMetadata())
      hashCode = hashCode * 8191 + metadata.hashCode();

    hashCode = hashCode * 8191 + ((isSetBuildTarget()) ? 131071 : 524287);
    if (isSetBuildTarget())
      hashCode = hashCode * 8191 + buildTarget.hashCode();

    hashCode = hashCode * 8191 + ((isSetRepository()) ? 131071 : 524287);
    if (isSetRepository())
      hashCode = hashCode * 8191 + repository.hashCode();

    hashCode = hashCode * 8191 + ((isSetArtifactPayloadCrc32()) ? 131071 : 524287);
    if (isSetArtifactPayloadCrc32())
      hashCode = hashCode * 8191 + artifactPayloadCrc32.hashCode();

    hashCode = hashCode * 8191 + ((isSetScheduleType()) ? 131071 : 524287);
    if (isSetScheduleType())
      hashCode = hashCode * 8191 + scheduleType.hashCode();

    hashCode = hashCode * 8191 + ((isSetArtifactPayloadMd5()) ? 131071 : 524287);
    if (isSetArtifactPayloadMd5())
      hashCode = hashCode * 8191 + artifactPayloadMd5.hashCode();

    hashCode = hashCode * 8191 + ((isSetDistributedBuildModeEnabled()) ? 131071 : 524287);
    if (isSetDistributedBuildModeEnabled())
      hashCode = hashCode * 8191 + ((distributedBuildModeEnabled) ? 131071 : 524287);

    hashCode = hashCode * 8191 + ((isSetProducerId()) ? 131071 : 524287);
    if (isSetProducerId())
      hashCode = hashCode * 8191 + producerId.hashCode();

    hashCode = hashCode * 8191 + ((isSetBuildTimeMs()) ? 131071 : 524287);
    if (isSetBuildTimeMs())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(buildTimeMs);

    hashCode = hashCode * 8191 + ((isSetProducerHostname()) ? 131071 : 524287);
    if (isSetProducerHostname())
      hashCode = hashCode * 8191 + producerHostname.hashCode();

    hashCode = hashCode * 8191 + ((isSetSizeBytes()) ? 131071 : 524287);
    if (isSetSizeBytes())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(sizeBytes);

    hashCode = hashCode * 8191 + ((isSetConfiguration()) ? 131071 : 524287);
    if (isSetConfiguration())
      hashCode = hashCode * 8191 + configuration.hashCode();

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.valueOf(isSetRuleKeys()).compareTo(other.isSetRuleKeys());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRuleKeys()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ruleKeys, other.ruleKeys);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetMetadata()).compareTo(other.isSetMetadata());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMetadata()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.metadata, other.metadata);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetBuildTarget()).compareTo(other.isSetBuildTarget());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBuildTarget()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.buildTarget, other.buildTarget);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetRepository()).compareTo(other.isSetRepository());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRepository()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.repository, other.repository);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetArtifactPayloadCrc32()).compareTo(other.isSetArtifactPayloadCrc32());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetArtifactPayloadCrc32()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.artifactPayloadCrc32, other.artifactPayloadCrc32);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetScheduleType()).compareTo(other.isSetScheduleType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetScheduleType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scheduleType, other.scheduleType);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetArtifactPayloadMd5()).compareTo(other.isSetArtifactPayloadMd5());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetArtifactPayloadMd5()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.artifactPayloadMd5, other.artifactPayloadMd5);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetDistributedBuildModeEnabled()).compareTo(other.isSetDistributedBuildModeEnabled());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDistributedBuildModeEnabled()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.distributedBuildModeEnabled, other.distributedBuildModeEnabled);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetProducerId()).compareTo(other.isSetProducerId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetProducerId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.producerId, other.producerId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetBuildTimeMs()).compareTo(other.isSetBuildTimeMs());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBuildTimeMs()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.buildTimeMs, other.buildTimeMs);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetProducerHostname()).compareTo(other.isSetProducerHostname());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetProducerHostname()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.producerHostname, other.producerHostname);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetSizeBytes()).compareTo(other.isSetSizeBytes());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSizeBytes()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sizeBytes, other.sizeBytes);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetConfiguration()).compareTo(other.isSetConfiguration());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetConfiguration()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.configuration, other.configuration);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  @org.apache.thrift.annotation.Nullable
  public _Fields fieldForId(int fieldId) {
    return _Fields.findByThriftId(fieldId);
  }

  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    scheme(iprot).read(iprot, this);
  }

  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    scheme(oprot).write(oprot, this);
  }

  @Override
  public java.lang.String toString() {
    java.lang.StringBuilder sb = new java.lang.StringBuilder("ArtifactMetadata(");
    boolean first = true;

    if (isSetRuleKeys()) {
      sb.append("ruleKeys:");
      if (this.ruleKeys == null) {
        sb.append("null");
      } else {
        sb.append(this.ruleKeys);
      }
      first = false;
    }
    if (isSetMetadata()) {
      if (!first) sb.append(", ");
      sb.append("metadata:");
      if (this.metadata == null) {
        sb.append("null");
      } else {
        sb.append(this.metadata);
      }
      first = false;
    }
    if (isSetBuildTarget()) {
      if (!first) sb.append(", ");
      sb.append("buildTarget:");
      if (this.buildTarget == null) {
        sb.append("null");
      } else {
        sb.append(this.buildTarget);
      }
      first = false;
    }
    if (isSetRepository()) {
      if (!first) sb.append(", ");
      sb.append("repository:");
      if (this.repository == null) {
        sb.append("null");
      } else {
        sb.append(this.repository);
      }
      first = false;
    }
    if (isSetArtifactPayloadCrc32()) {
      if (!first) sb.append(", ");
      sb.append("artifactPayloadCrc32:");
      if (this.artifactPayloadCrc32 == null) {
        sb.append("null");
      } else {
        sb.append(this.artifactPayloadCrc32);
      }
      first = false;
    }
    if (isSetScheduleType()) {
      if (!first) sb.append(", ");
      sb.append("scheduleType:");
      if (this.scheduleType == null) {
        sb.append("null");
      } else {
        sb.append(this.scheduleType);
      }
      first = false;
    }
    if (isSetArtifactPayloadMd5()) {
      if (!first) sb.append(", ");
      sb.append("artifactPayloadMd5:");
      if (this.artifactPayloadMd5 == null) {
        sb.append("null");
      } else {
        sb.append(this.artifactPayloadMd5);
      }
      first = false;
    }
    if (isSetDistributedBuildModeEnabled()) {
      if (!first) sb.append(", ");
      sb.append("distributedBuildModeEnabled:");
      sb.append(this.distributedBuildModeEnabled);
      first = false;
    }
    if (isSetProducerId()) {
      if (!first) sb.append(", ");
      sb.append("producerId:");
      if (this.producerId == null) {
        sb.append("null");
      } else {
        sb.append(this.producerId);
      }
      first = false;
    }
    if (isSetBuildTimeMs()) {
      if (!first) sb.append(", ");
      sb.append("buildTimeMs:");
      sb.append(this.buildTimeMs);
      first = false;
    }
    if (isSetProducerHostname()) {
      if (!first) sb.append(", ");
      sb.append("producerHostname:");
      if (this.producerHostname == null) {
        sb.append("null");
      } else {
        sb.append(this.producerHostname);
      }
      first = false;
    }
    if (isSetSizeBytes()) {
      if (!first) sb.append(", ");
      sb.append("sizeBytes:");
      sb.append(this.sizeBytes);
      first = false;
    }
    if (isSetConfiguration()) {
      if (!first) sb.append(", ");
      sb.append("configuration:");
      if (this.configuration == null) {
        sb.append("null");
      } else {
        sb.append(this.configuration);
      }
      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, java.lang.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 ArtifactMetadataStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public ArtifactMetadataStandardScheme getScheme() {
      return new ArtifactMetadataStandardScheme();
    }
  }

  private static class ArtifactMetadataStandardScheme extends org.apache.thrift.scheme.StandardScheme<ArtifactMetadata> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, ArtifactMetadata 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 1: // RULE_KEYS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
                struct.ruleKeys = new java.util.ArrayList<RuleKey>(_list0.size);
                @org.apache.thrift.annotation.Nullable RuleKey _elem1;
                for (int _i2 = 0; _i2 < _list0.size; ++_i2)
                {
                  _elem1 = new RuleKey();
                  _elem1.read(iprot);
                  struct.ruleKeys.add(_elem1);
                }
                iprot.readListEnd();
              }
              struct.setRuleKeysIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // METADATA
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map3 = iprot.readMapBegin();
                struct.metadata = new java.util.HashMap<java.lang.String,java.lang.String>(2*_map3.size);
                @org.apache.thrift.annotation.Nullable java.lang.String _key4;
                @org.apache.thrift.annotation.Nullable java.lang.String _val5;
                for (int _i6 = 0; _i6 < _map3.size; ++_i6)
                {
                  _key4 = iprot.readString();
                  _val5 = iprot.readString();
                  struct.metadata.put(_key4, _val5);
                }
                iprot.readMapEnd();
              }
              struct.setMetadataIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // BUILD_TARGET
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.buildTarget = iprot.readString();
              struct.setBuildTargetIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // REPOSITORY
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.repository = iprot.readString();
              struct.setRepositoryIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // ARTIFACT_PAYLOAD_CRC32
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.artifactPayloadCrc32 = iprot.readString();
              struct.setArtifactPayloadCrc32IsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // SCHEDULE_TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.scheduleType = iprot.readString();
              struct.setScheduleTypeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // ARTIFACT_PAYLOAD_MD5
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.artifactPayloadMd5 = iprot.readString();
              struct.setArtifactPayloadMd5IsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // DISTRIBUTED_BUILD_MODE_ENABLED
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.distributedBuildModeEnabled = iprot.readBool();
              struct.setDistributedBuildModeEnabledIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 9: // PRODUCER_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.producerId = iprot.readString();
              struct.setProducerIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 10: // BUILD_TIME_MS
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.buildTimeMs = iprot.readI64();
              struct.setBuildTimeMsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 11: // PRODUCER_HOSTNAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.producerHostname = iprot.readString();
              struct.setProducerHostnameIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 12: // SIZE_BYTES
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.sizeBytes = iprot.readI64();
              struct.setSizeBytesIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 13: // CONFIGURATION
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.configuration = iprot.readString();
              struct.setConfigurationIsSet(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, ArtifactMetadata struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.ruleKeys != null) {
        if (struct.isSetRuleKeys()) {
          oprot.writeFieldBegin(RULE_KEYS_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.ruleKeys.size()));
            for (RuleKey _iter7 : struct.ruleKeys)
            {
              _iter7.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.metadata != null) {
        if (struct.isSetMetadata()) {
          oprot.writeFieldBegin(METADATA_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.metadata.size()));
            for (java.util.Map.Entry<java.lang.String, java.lang.String> _iter8 : struct.metadata.entrySet())
            {
              oprot.writeString(_iter8.getKey());
              oprot.writeString(_iter8.getValue());
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.buildTarget != null) {
        if (struct.isSetBuildTarget()) {
          oprot.writeFieldBegin(BUILD_TARGET_FIELD_DESC);
          oprot.writeString(struct.buildTarget);
          oprot.writeFieldEnd();
        }
      }
      if (struct.repository != null) {
        if (struct.isSetRepository()) {
          oprot.writeFieldBegin(REPOSITORY_FIELD_DESC);
          oprot.writeString(struct.repository);
          oprot.writeFieldEnd();
        }
      }
      if (struct.artifactPayloadCrc32 != null) {
        if (struct.isSetArtifactPayloadCrc32()) {
          oprot.writeFieldBegin(ARTIFACT_PAYLOAD_CRC32_FIELD_DESC);
          oprot.writeString(struct.artifactPayloadCrc32);
          oprot.writeFieldEnd();
        }
      }
      if (struct.scheduleType != null) {
        if (struct.isSetScheduleType()) {
          oprot.writeFieldBegin(SCHEDULE_TYPE_FIELD_DESC);
          oprot.writeString(struct.scheduleType);
          oprot.writeFieldEnd();
        }
      }
      if (struct.artifactPayloadMd5 != null) {
        if (struct.isSetArtifactPayloadMd5()) {
          oprot.writeFieldBegin(ARTIFACT_PAYLOAD_MD5_FIELD_DESC);
          oprot.writeString(struct.artifactPayloadMd5);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetDistributedBuildModeEnabled()) {
        oprot.writeFieldBegin(DISTRIBUTED_BUILD_MODE_ENABLED_FIELD_DESC);
        oprot.writeBool(struct.distributedBuildModeEnabled);
        oprot.writeFieldEnd();
      }
      if (struct.producerId != null) {
        if (struct.isSetProducerId()) {
          oprot.writeFieldBegin(PRODUCER_ID_FIELD_DESC);
          oprot.writeString(struct.producerId);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetBuildTimeMs()) {
        oprot.writeFieldBegin(BUILD_TIME_MS_FIELD_DESC);
        oprot.writeI64(struct.buildTimeMs);
        oprot.writeFieldEnd();
      }
      if (struct.producerHostname != null) {
        if (struct.isSetProducerHostname()) {
          oprot.writeFieldBegin(PRODUCER_HOSTNAME_FIELD_DESC);
          oprot.writeString(struct.producerHostname);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetSizeBytes()) {
        oprot.writeFieldBegin(SIZE_BYTES_FIELD_DESC);
        oprot.writeI64(struct.sizeBytes);
        oprot.writeFieldEnd();
      }
      if (struct.configuration != null) {
        if (struct.isSetConfiguration()) {
          oprot.writeFieldBegin(CONFIGURATION_FIELD_DESC);
          oprot.writeString(struct.configuration);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class ArtifactMetadataTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public ArtifactMetadataTupleScheme getScheme() {
      return new ArtifactMetadataTupleScheme();
    }
  }

  private static class ArtifactMetadataTupleScheme extends org.apache.thrift.scheme.TupleScheme<ArtifactMetadata> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, ArtifactMetadata struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet optionals = new java.util.BitSet();
      if (struct.isSetRuleKeys()) {
        optionals.set(0);
      }
      if (struct.isSetMetadata()) {
        optionals.set(1);
      }
      if (struct.isSetBuildTarget()) {
        optionals.set(2);
      }
      if (struct.isSetRepository()) {
        optionals.set(3);
      }
      if (struct.isSetArtifactPayloadCrc32()) {
        optionals.set(4);
      }
      if (struct.isSetScheduleType()) {
        optionals.set(5);
      }
      if (struct.isSetArtifactPayloadMd5()) {
        optionals.set(6);
      }
      if (struct.isSetDistributedBuildModeEnabled()) {
        optionals.set(7);
      }
      if (struct.isSetProducerId()) {
        optionals.set(8);
      }
      if (struct.isSetBuildTimeMs()) {
        optionals.set(9);
      }
      if (struct.isSetProducerHostname()) {
        optionals.set(10);
      }
      if (struct.isSetSizeBytes()) {
        optionals.set(11);
      }
      if (struct.isSetConfiguration()) {
        optionals.set(12);
      }
      oprot.writeBitSet(optionals, 13);
      if (struct.isSetRuleKeys()) {
        {
          oprot.writeI32(struct.ruleKeys.size());
          for (RuleKey _iter9 : struct.ruleKeys)
          {
            _iter9.write(oprot);
          }
        }
      }
      if (struct.isSetMetadata()) {
        {
          oprot.writeI32(struct.metadata.size());
          for (java.util.Map.Entry<java.lang.String, java.lang.String> _iter10 : struct.metadata.entrySet())
          {
            oprot.writeString(_iter10.getKey());
            oprot.writeString(_iter10.getValue());
          }
        }
      }
      if (struct.isSetBuildTarget()) {
        oprot.writeString(struct.buildTarget);
      }
      if (struct.isSetRepository()) {
        oprot.writeString(struct.repository);
      }
      if (struct.isSetArtifactPayloadCrc32()) {
        oprot.writeString(struct.artifactPayloadCrc32);
      }
      if (struct.isSetScheduleType()) {
        oprot.writeString(struct.scheduleType);
      }
      if (struct.isSetArtifactPayloadMd5()) {
        oprot.writeString(struct.artifactPayloadMd5);
      }
      if (struct.isSetDistributedBuildModeEnabled()) {
        oprot.writeBool(struct.distributedBuildModeEnabled);
      }
      if (struct.isSetProducerId()) {
        oprot.writeString(struct.producerId);
      }
      if (struct.isSetBuildTimeMs()) {
        oprot.writeI64(struct.buildTimeMs);
      }
      if (struct.isSetProducerHostname()) {
        oprot.writeString(struct.producerHostname);
      }
      if (struct.isSetSizeBytes()) {
        oprot.writeI64(struct.sizeBytes);
      }
      if (struct.isSetConfiguration()) {
        oprot.writeString(struct.configuration);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, ArtifactMetadata struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet incoming = iprot.readBitSet(13);
      if (incoming.get(0)) {
        {
          org.apache.thrift.protocol.TList _list11 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
          struct.ruleKeys = new java.util.ArrayList<RuleKey>(_list11.size);
          @org.apache.thrift.annotation.Nullable RuleKey _elem12;
          for (int _i13 = 0; _i13 < _list11.size; ++_i13)
          {
            _elem12 = new RuleKey();
            _elem12.read(iprot);
            struct.ruleKeys.add(_elem12);
          }
        }
        struct.setRuleKeysIsSet(true);
      }
      if (incoming.get(1)) {
        {
          org.apache.thrift.protocol.TMap _map14 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.metadata = new java.util.HashMap<java.lang.String,java.lang.String>(2*_map14.size);
          @org.apache.thrift.annotation.Nullable java.lang.String _key15;
          @org.apache.thrift.annotation.Nullable java.lang.String _val16;
          for (int _i17 = 0; _i17 < _map14.size; ++_i17)
          {
            _key15 = iprot.readString();
            _val16 = iprot.readString();
            struct.metadata.put(_key15, _val16);
          }
        }
        struct.setMetadataIsSet(true);
      }
      if (incoming.get(2)) {
        struct.buildTarget = iprot.readString();
        struct.setBuildTargetIsSet(true);
      }
      if (incoming.get(3)) {
        struct.repository = iprot.readString();
        struct.setRepositoryIsSet(true);
      }
      if (incoming.get(4)) {
        struct.artifactPayloadCrc32 = iprot.readString();
        struct.setArtifactPayloadCrc32IsSet(true);
      }
      if (incoming.get(5)) {
        struct.scheduleType = iprot.readString();
        struct.setScheduleTypeIsSet(true);
      }
      if (incoming.get(6)) {
        struct.artifactPayloadMd5 = iprot.readString();
        struct.setArtifactPayloadMd5IsSet(true);
      }
      if (incoming.get(7)) {
        struct.distributedBuildModeEnabled = iprot.readBool();
        struct.setDistributedBuildModeEnabledIsSet(true);
      }
      if (incoming.get(8)) {
        struct.producerId = iprot.readString();
        struct.setProducerIdIsSet(true);
      }
      if (incoming.get(9)) {
        struct.buildTimeMs = iprot.readI64();
        struct.setBuildTimeMsIsSet(true);
      }
      if (incoming.get(10)) {
        struct.producerHostname = iprot.readString();
        struct.setProducerHostnameIsSet(true);
      }
      if (incoming.get(11)) {
        struct.sizeBytes = iprot.readI64();
        struct.setSizeBytesIsSet(true);
      }
      if (incoming.get(12)) {
        struct.configuration = iprot.readString();
        struct.setConfigurationIsSet(true);
      }
    }
  }

  private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
  }
}

