/**
 * Autogenerated by Thrift Compiler (0.13.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package org.apache.hadoop.hbase.thrift.generated;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
/**
 * An HColumnDescriptor contains information about a column family
 * such as the number of versions, compression settings, etc. It is
 * used as input when creating a table or adding a column.
 */
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2020-04-16")
public class ColumnDescriptor implements org.apache.thrift.TBase<ColumnDescriptor, ColumnDescriptor._Fields>, java.io.Serializable, Cloneable, Comparable<ColumnDescriptor> {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ColumnDescriptor");

  private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField MAX_VERSIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("maxVersions", org.apache.thrift.protocol.TType.I32, (short)2);
  private static final org.apache.thrift.protocol.TField COMPRESSION_FIELD_DESC = new org.apache.thrift.protocol.TField("compression", org.apache.thrift.protocol.TType.STRING, (short)3);
  private static final org.apache.thrift.protocol.TField IN_MEMORY_FIELD_DESC = new org.apache.thrift.protocol.TField("inMemory", org.apache.thrift.protocol.TType.BOOL, (short)4);
  private static final org.apache.thrift.protocol.TField BLOOM_FILTER_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("bloomFilterType", org.apache.thrift.protocol.TType.STRING, (short)5);
  private static final org.apache.thrift.protocol.TField BLOOM_FILTER_VECTOR_SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("bloomFilterVectorSize", org.apache.thrift.protocol.TType.I32, (short)6);
  private static final org.apache.thrift.protocol.TField BLOOM_FILTER_NB_HASHES_FIELD_DESC = new org.apache.thrift.protocol.TField("bloomFilterNbHashes", org.apache.thrift.protocol.TType.I32, (short)7);
  private static final org.apache.thrift.protocol.TField BLOCK_CACHE_ENABLED_FIELD_DESC = new org.apache.thrift.protocol.TField("blockCacheEnabled", org.apache.thrift.protocol.TType.BOOL, (short)8);
  private static final org.apache.thrift.protocol.TField TIME_TO_LIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("timeToLive", org.apache.thrift.protocol.TType.I32, (short)9);

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

  public @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer name; // required
  public int maxVersions; // required
  public @org.apache.thrift.annotation.Nullable java.lang.String compression; // required
  public boolean inMemory; // required
  public @org.apache.thrift.annotation.Nullable java.lang.String bloomFilterType; // required
  public int bloomFilterVectorSize; // required
  public int bloomFilterNbHashes; // required
  public boolean blockCacheEnabled; // required
  public int timeToLive; // required

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    NAME((short)1, "name"),
    MAX_VERSIONS((short)2, "maxVersions"),
    COMPRESSION((short)3, "compression"),
    IN_MEMORY((short)4, "inMemory"),
    BLOOM_FILTER_TYPE((short)5, "bloomFilterType"),
    BLOOM_FILTER_VECTOR_SIZE((short)6, "bloomFilterVectorSize"),
    BLOOM_FILTER_NB_HASHES((short)7, "bloomFilterNbHashes"),
    BLOCK_CACHE_ENABLED((short)8, "blockCacheEnabled"),
    TIME_TO_LIVE((short)9, "timeToLive");

    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: // NAME
          return NAME;
        case 2: // MAX_VERSIONS
          return MAX_VERSIONS;
        case 3: // COMPRESSION
          return COMPRESSION;
        case 4: // IN_MEMORY
          return IN_MEMORY;
        case 5: // BLOOM_FILTER_TYPE
          return BLOOM_FILTER_TYPE;
        case 6: // BLOOM_FILTER_VECTOR_SIZE
          return BLOOM_FILTER_VECTOR_SIZE;
        case 7: // BLOOM_FILTER_NB_HASHES
          return BLOOM_FILTER_NB_HASHES;
        case 8: // BLOCK_CACHE_ENABLED
          return BLOCK_CACHE_ENABLED;
        case 9: // TIME_TO_LIVE
          return TIME_TO_LIVE;
        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 __MAXVERSIONS_ISSET_ID = 0;
  private static final int __INMEMORY_ISSET_ID = 1;
  private static final int __BLOOMFILTERVECTORSIZE_ISSET_ID = 2;
  private static final int __BLOOMFILTERNBHASHES_ISSET_ID = 3;
  private static final int __BLOCKCACHEENABLED_ISSET_ID = 4;
  private static final int __TIMETOLIVE_ISSET_ID = 5;
  private byte __isset_bitfield = 0;
  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.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , "Text")));
    tmpMap.put(_Fields.MAX_VERSIONS, new org.apache.thrift.meta_data.FieldMetaData("maxVersions", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.COMPRESSION, new org.apache.thrift.meta_data.FieldMetaData("compression", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.IN_MEMORY, new org.apache.thrift.meta_data.FieldMetaData("inMemory", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.BLOOM_FILTER_TYPE, new org.apache.thrift.meta_data.FieldMetaData("bloomFilterType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.BLOOM_FILTER_VECTOR_SIZE, new org.apache.thrift.meta_data.FieldMetaData("bloomFilterVectorSize", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.BLOOM_FILTER_NB_HASHES, new org.apache.thrift.meta_data.FieldMetaData("bloomFilterNbHashes", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.BLOCK_CACHE_ENABLED, new org.apache.thrift.meta_data.FieldMetaData("blockCacheEnabled", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.TIME_TO_LIVE, new org.apache.thrift.meta_data.FieldMetaData("timeToLive", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ColumnDescriptor.class, metaDataMap);
  }

  public ColumnDescriptor() {
    this.maxVersions = 3;

    this.compression = "NONE";

    this.inMemory = false;

    this.bloomFilterType = "NONE";

    this.bloomFilterVectorSize = 0;

    this.bloomFilterNbHashes = 0;

    this.blockCacheEnabled = false;

    this.timeToLive = 2147483647;

  }

  public ColumnDescriptor(
    java.nio.ByteBuffer name,
    int maxVersions,
    java.lang.String compression,
    boolean inMemory,
    java.lang.String bloomFilterType,
    int bloomFilterVectorSize,
    int bloomFilterNbHashes,
    boolean blockCacheEnabled,
    int timeToLive)
  {
    this();
    this.name = org.apache.thrift.TBaseHelper.copyBinary(name);
    this.maxVersions = maxVersions;
    setMaxVersionsIsSet(true);
    this.compression = compression;
    this.inMemory = inMemory;
    setInMemoryIsSet(true);
    this.bloomFilterType = bloomFilterType;
    this.bloomFilterVectorSize = bloomFilterVectorSize;
    setBloomFilterVectorSizeIsSet(true);
    this.bloomFilterNbHashes = bloomFilterNbHashes;
    setBloomFilterNbHashesIsSet(true);
    this.blockCacheEnabled = blockCacheEnabled;
    setBlockCacheEnabledIsSet(true);
    this.timeToLive = timeToLive;
    setTimeToLiveIsSet(true);
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public ColumnDescriptor(ColumnDescriptor other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetName()) {
      this.name = org.apache.thrift.TBaseHelper.copyBinary(other.name);
    }
    this.maxVersions = other.maxVersions;
    if (other.isSetCompression()) {
      this.compression = other.compression;
    }
    this.inMemory = other.inMemory;
    if (other.isSetBloomFilterType()) {
      this.bloomFilterType = other.bloomFilterType;
    }
    this.bloomFilterVectorSize = other.bloomFilterVectorSize;
    this.bloomFilterNbHashes = other.bloomFilterNbHashes;
    this.blockCacheEnabled = other.blockCacheEnabled;
    this.timeToLive = other.timeToLive;
  }

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

  @Override
  public void clear() {
    this.name = null;
    this.maxVersions = 3;

    this.compression = "NONE";

    this.inMemory = false;

    this.bloomFilterType = "NONE";

    this.bloomFilterVectorSize = 0;

    this.bloomFilterNbHashes = 0;

    this.blockCacheEnabled = false;

    this.timeToLive = 2147483647;

  }

  public byte[] getName() {
    setName(org.apache.thrift.TBaseHelper.rightSize(name));
    return name == null ? null : name.array();
  }

  public java.nio.ByteBuffer bufferForName() {
    return org.apache.thrift.TBaseHelper.copyBinary(name);
  }

  public ColumnDescriptor setName(byte[] name) {
    this.name = name == null ? (java.nio.ByteBuffer)null   : java.nio.ByteBuffer.wrap(name.clone());
    return this;
  }

  public ColumnDescriptor setName(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer name) {
    this.name = org.apache.thrift.TBaseHelper.copyBinary(name);
    return this;
  }

  public void unsetName() {
    this.name = null;
  }

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

  public void setNameIsSet(boolean value) {
    if (!value) {
      this.name = null;
    }
  }

  public int getMaxVersions() {
    return this.maxVersions;
  }

  public ColumnDescriptor setMaxVersions(int maxVersions) {
    this.maxVersions = maxVersions;
    setMaxVersionsIsSet(true);
    return this;
  }

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

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

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

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

  public ColumnDescriptor setCompression(@org.apache.thrift.annotation.Nullable java.lang.String compression) {
    this.compression = compression;
    return this;
  }

  public void unsetCompression() {
    this.compression = null;
  }

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

  public void setCompressionIsSet(boolean value) {
    if (!value) {
      this.compression = null;
    }
  }

  public boolean isInMemory() {
    return this.inMemory;
  }

  public ColumnDescriptor setInMemory(boolean inMemory) {
    this.inMemory = inMemory;
    setInMemoryIsSet(true);
    return this;
  }

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

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

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

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

  public ColumnDescriptor setBloomFilterType(@org.apache.thrift.annotation.Nullable java.lang.String bloomFilterType) {
    this.bloomFilterType = bloomFilterType;
    return this;
  }

  public void unsetBloomFilterType() {
    this.bloomFilterType = null;
  }

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

  public void setBloomFilterTypeIsSet(boolean value) {
    if (!value) {
      this.bloomFilterType = null;
    }
  }

  public int getBloomFilterVectorSize() {
    return this.bloomFilterVectorSize;
  }

  public ColumnDescriptor setBloomFilterVectorSize(int bloomFilterVectorSize) {
    this.bloomFilterVectorSize = bloomFilterVectorSize;
    setBloomFilterVectorSizeIsSet(true);
    return this;
  }

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

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

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

  public int getBloomFilterNbHashes() {
    return this.bloomFilterNbHashes;
  }

  public ColumnDescriptor setBloomFilterNbHashes(int bloomFilterNbHashes) {
    this.bloomFilterNbHashes = bloomFilterNbHashes;
    setBloomFilterNbHashesIsSet(true);
    return this;
  }

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

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

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

  public boolean isBlockCacheEnabled() {
    return this.blockCacheEnabled;
  }

  public ColumnDescriptor setBlockCacheEnabled(boolean blockCacheEnabled) {
    this.blockCacheEnabled = blockCacheEnabled;
    setBlockCacheEnabledIsSet(true);
    return this;
  }

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

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

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

  public int getTimeToLive() {
    return this.timeToLive;
  }

  public ColumnDescriptor setTimeToLive(int timeToLive) {
    this.timeToLive = timeToLive;
    setTimeToLiveIsSet(true);
    return this;
  }

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

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

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

  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case NAME:
      if (value == null) {
        unsetName();
      } else {
        if (value instanceof byte[]) {
          setName((byte[])value);
        } else {
          setName((java.nio.ByteBuffer)value);
        }
      }
      break;

    case MAX_VERSIONS:
      if (value == null) {
        unsetMaxVersions();
      } else {
        setMaxVersions((java.lang.Integer)value);
      }
      break;

    case COMPRESSION:
      if (value == null) {
        unsetCompression();
      } else {
        setCompression((java.lang.String)value);
      }
      break;

    case IN_MEMORY:
      if (value == null) {
        unsetInMemory();
      } else {
        setInMemory((java.lang.Boolean)value);
      }
      break;

    case BLOOM_FILTER_TYPE:
      if (value == null) {
        unsetBloomFilterType();
      } else {
        setBloomFilterType((java.lang.String)value);
      }
      break;

    case BLOOM_FILTER_VECTOR_SIZE:
      if (value == null) {
        unsetBloomFilterVectorSize();
      } else {
        setBloomFilterVectorSize((java.lang.Integer)value);
      }
      break;

    case BLOOM_FILTER_NB_HASHES:
      if (value == null) {
        unsetBloomFilterNbHashes();
      } else {
        setBloomFilterNbHashes((java.lang.Integer)value);
      }
      break;

    case BLOCK_CACHE_ENABLED:
      if (value == null) {
        unsetBlockCacheEnabled();
      } else {
        setBlockCacheEnabled((java.lang.Boolean)value);
      }
      break;

    case TIME_TO_LIVE:
      if (value == null) {
        unsetTimeToLive();
      } else {
        setTimeToLive((java.lang.Integer)value);
      }
      break;

    }
  }

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

    case MAX_VERSIONS:
      return getMaxVersions();

    case COMPRESSION:
      return getCompression();

    case IN_MEMORY:
      return isInMemory();

    case BLOOM_FILTER_TYPE:
      return getBloomFilterType();

    case BLOOM_FILTER_VECTOR_SIZE:
      return getBloomFilterVectorSize();

    case BLOOM_FILTER_NB_HASHES:
      return getBloomFilterNbHashes();

    case BLOCK_CACHE_ENABLED:
      return isBlockCacheEnabled();

    case TIME_TO_LIVE:
      return getTimeToLive();

    }
    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 NAME:
      return isSetName();
    case MAX_VERSIONS:
      return isSetMaxVersions();
    case COMPRESSION:
      return isSetCompression();
    case IN_MEMORY:
      return isSetInMemory();
    case BLOOM_FILTER_TYPE:
      return isSetBloomFilterType();
    case BLOOM_FILTER_VECTOR_SIZE:
      return isSetBloomFilterVectorSize();
    case BLOOM_FILTER_NB_HASHES:
      return isSetBloomFilterNbHashes();
    case BLOCK_CACHE_ENABLED:
      return isSetBlockCacheEnabled();
    case TIME_TO_LIVE:
      return isSetTimeToLive();
    }
    throw new java.lang.IllegalStateException();
  }

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

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

    boolean this_present_name = true && this.isSetName();
    boolean that_present_name = true && that.isSetName();
    if (this_present_name || that_present_name) {
      if (!(this_present_name && that_present_name))
        return false;
      if (!this.name.equals(that.name))
        return false;
    }

    boolean this_present_maxVersions = true;
    boolean that_present_maxVersions = true;
    if (this_present_maxVersions || that_present_maxVersions) {
      if (!(this_present_maxVersions && that_present_maxVersions))
        return false;
      if (this.maxVersions != that.maxVersions)
        return false;
    }

    boolean this_present_compression = true && this.isSetCompression();
    boolean that_present_compression = true && that.isSetCompression();
    if (this_present_compression || that_present_compression) {
      if (!(this_present_compression && that_present_compression))
        return false;
      if (!this.compression.equals(that.compression))
        return false;
    }

    boolean this_present_inMemory = true;
    boolean that_present_inMemory = true;
    if (this_present_inMemory || that_present_inMemory) {
      if (!(this_present_inMemory && that_present_inMemory))
        return false;
      if (this.inMemory != that.inMemory)
        return false;
    }

    boolean this_present_bloomFilterType = true && this.isSetBloomFilterType();
    boolean that_present_bloomFilterType = true && that.isSetBloomFilterType();
    if (this_present_bloomFilterType || that_present_bloomFilterType) {
      if (!(this_present_bloomFilterType && that_present_bloomFilterType))
        return false;
      if (!this.bloomFilterType.equals(that.bloomFilterType))
        return false;
    }

    boolean this_present_bloomFilterVectorSize = true;
    boolean that_present_bloomFilterVectorSize = true;
    if (this_present_bloomFilterVectorSize || that_present_bloomFilterVectorSize) {
      if (!(this_present_bloomFilterVectorSize && that_present_bloomFilterVectorSize))
        return false;
      if (this.bloomFilterVectorSize != that.bloomFilterVectorSize)
        return false;
    }

    boolean this_present_bloomFilterNbHashes = true;
    boolean that_present_bloomFilterNbHashes = true;
    if (this_present_bloomFilterNbHashes || that_present_bloomFilterNbHashes) {
      if (!(this_present_bloomFilterNbHashes && that_present_bloomFilterNbHashes))
        return false;
      if (this.bloomFilterNbHashes != that.bloomFilterNbHashes)
        return false;
    }

    boolean this_present_blockCacheEnabled = true;
    boolean that_present_blockCacheEnabled = true;
    if (this_present_blockCacheEnabled || that_present_blockCacheEnabled) {
      if (!(this_present_blockCacheEnabled && that_present_blockCacheEnabled))
        return false;
      if (this.blockCacheEnabled != that.blockCacheEnabled)
        return false;
    }

    boolean this_present_timeToLive = true;
    boolean that_present_timeToLive = true;
    if (this_present_timeToLive || that_present_timeToLive) {
      if (!(this_present_timeToLive && that_present_timeToLive))
        return false;
      if (this.timeToLive != that.timeToLive)
        return false;
    }

    return true;
  }

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

    hashCode = hashCode * 8191 + ((isSetName()) ? 131071 : 524287);
    if (isSetName())
      hashCode = hashCode * 8191 + name.hashCode();

    hashCode = hashCode * 8191 + maxVersions;

    hashCode = hashCode * 8191 + ((isSetCompression()) ? 131071 : 524287);
    if (isSetCompression())
      hashCode = hashCode * 8191 + compression.hashCode();

    hashCode = hashCode * 8191 + ((inMemory) ? 131071 : 524287);

    hashCode = hashCode * 8191 + ((isSetBloomFilterType()) ? 131071 : 524287);
    if (isSetBloomFilterType())
      hashCode = hashCode * 8191 + bloomFilterType.hashCode();

    hashCode = hashCode * 8191 + bloomFilterVectorSize;

    hashCode = hashCode * 8191 + bloomFilterNbHashes;

    hashCode = hashCode * 8191 + ((blockCacheEnabled) ? 131071 : 524287);

    hashCode = hashCode * 8191 + timeToLive;

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.valueOf(isSetName()).compareTo(other.isSetName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetMaxVersions()).compareTo(other.isSetMaxVersions());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMaxVersions()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxVersions, other.maxVersions);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetCompression()).compareTo(other.isSetCompression());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCompression()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.compression, other.compression);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetInMemory()).compareTo(other.isSetInMemory());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetInMemory()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.inMemory, other.inMemory);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetBloomFilterType()).compareTo(other.isSetBloomFilterType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBloomFilterType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bloomFilterType, other.bloomFilterType);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetBloomFilterVectorSize()).compareTo(other.isSetBloomFilterVectorSize());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBloomFilterVectorSize()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bloomFilterVectorSize, other.bloomFilterVectorSize);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetBloomFilterNbHashes()).compareTo(other.isSetBloomFilterNbHashes());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBloomFilterNbHashes()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bloomFilterNbHashes, other.bloomFilterNbHashes);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetBlockCacheEnabled()).compareTo(other.isSetBlockCacheEnabled());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBlockCacheEnabled()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.blockCacheEnabled, other.blockCacheEnabled);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetTimeToLive()).compareTo(other.isSetTimeToLive());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTimeToLive()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timeToLive, other.timeToLive);
      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("ColumnDescriptor(");
    boolean first = true;

    sb.append("name:");
    if (this.name == null) {
      sb.append("null");
    } else {
      org.apache.thrift.TBaseHelper.toString(this.name, sb);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("maxVersions:");
    sb.append(this.maxVersions);
    first = false;
    if (!first) sb.append(", ");
    sb.append("compression:");
    if (this.compression == null) {
      sb.append("null");
    } else {
      sb.append(this.compression);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("inMemory:");
    sb.append(this.inMemory);
    first = false;
    if (!first) sb.append(", ");
    sb.append("bloomFilterType:");
    if (this.bloomFilterType == null) {
      sb.append("null");
    } else {
      sb.append(this.bloomFilterType);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("bloomFilterVectorSize:");
    sb.append(this.bloomFilterVectorSize);
    first = false;
    if (!first) sb.append(", ");
    sb.append("bloomFilterNbHashes:");
    sb.append(this.bloomFilterNbHashes);
    first = false;
    if (!first) sb.append(", ");
    sb.append("blockCacheEnabled:");
    sb.append(this.blockCacheEnabled);
    first = false;
    if (!first) sb.append(", ");
    sb.append("timeToLive:");
    sb.append(this.timeToLive);
    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 ColumnDescriptorStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public ColumnDescriptorStandardScheme getScheme() {
      return new ColumnDescriptorStandardScheme();
    }
  }

  private static class ColumnDescriptorStandardScheme extends org.apache.thrift.scheme.StandardScheme<ColumnDescriptor> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, ColumnDescriptor 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: // NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.name = iprot.readBinary();
              struct.setNameIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // MAX_VERSIONS
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.maxVersions = iprot.readI32();
              struct.setMaxVersionsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // COMPRESSION
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.compression = iprot.readString();
              struct.setCompressionIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // IN_MEMORY
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.inMemory = iprot.readBool();
              struct.setInMemoryIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // BLOOM_FILTER_TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.bloomFilterType = iprot.readString();
              struct.setBloomFilterTypeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // BLOOM_FILTER_VECTOR_SIZE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.bloomFilterVectorSize = iprot.readI32();
              struct.setBloomFilterVectorSizeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // BLOOM_FILTER_NB_HASHES
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.bloomFilterNbHashes = iprot.readI32();
              struct.setBloomFilterNbHashesIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // BLOCK_CACHE_ENABLED
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.blockCacheEnabled = iprot.readBool();
              struct.setBlockCacheEnabledIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 9: // TIME_TO_LIVE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.timeToLive = iprot.readI32();
              struct.setTimeToLiveIsSet(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, ColumnDescriptor struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.name != null) {
        oprot.writeFieldBegin(NAME_FIELD_DESC);
        oprot.writeBinary(struct.name);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(MAX_VERSIONS_FIELD_DESC);
      oprot.writeI32(struct.maxVersions);
      oprot.writeFieldEnd();
      if (struct.compression != null) {
        oprot.writeFieldBegin(COMPRESSION_FIELD_DESC);
        oprot.writeString(struct.compression);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(IN_MEMORY_FIELD_DESC);
      oprot.writeBool(struct.inMemory);
      oprot.writeFieldEnd();
      if (struct.bloomFilterType != null) {
        oprot.writeFieldBegin(BLOOM_FILTER_TYPE_FIELD_DESC);
        oprot.writeString(struct.bloomFilterType);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(BLOOM_FILTER_VECTOR_SIZE_FIELD_DESC);
      oprot.writeI32(struct.bloomFilterVectorSize);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(BLOOM_FILTER_NB_HASHES_FIELD_DESC);
      oprot.writeI32(struct.bloomFilterNbHashes);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(BLOCK_CACHE_ENABLED_FIELD_DESC);
      oprot.writeBool(struct.blockCacheEnabled);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(TIME_TO_LIVE_FIELD_DESC);
      oprot.writeI32(struct.timeToLive);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

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

  private static class ColumnDescriptorTupleScheme extends org.apache.thrift.scheme.TupleScheme<ColumnDescriptor> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, ColumnDescriptor 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.isSetName()) {
        optionals.set(0);
      }
      if (struct.isSetMaxVersions()) {
        optionals.set(1);
      }
      if (struct.isSetCompression()) {
        optionals.set(2);
      }
      if (struct.isSetInMemory()) {
        optionals.set(3);
      }
      if (struct.isSetBloomFilterType()) {
        optionals.set(4);
      }
      if (struct.isSetBloomFilterVectorSize()) {
        optionals.set(5);
      }
      if (struct.isSetBloomFilterNbHashes()) {
        optionals.set(6);
      }
      if (struct.isSetBlockCacheEnabled()) {
        optionals.set(7);
      }
      if (struct.isSetTimeToLive()) {
        optionals.set(8);
      }
      oprot.writeBitSet(optionals, 9);
      if (struct.isSetName()) {
        oprot.writeBinary(struct.name);
      }
      if (struct.isSetMaxVersions()) {
        oprot.writeI32(struct.maxVersions);
      }
      if (struct.isSetCompression()) {
        oprot.writeString(struct.compression);
      }
      if (struct.isSetInMemory()) {
        oprot.writeBool(struct.inMemory);
      }
      if (struct.isSetBloomFilterType()) {
        oprot.writeString(struct.bloomFilterType);
      }
      if (struct.isSetBloomFilterVectorSize()) {
        oprot.writeI32(struct.bloomFilterVectorSize);
      }
      if (struct.isSetBloomFilterNbHashes()) {
        oprot.writeI32(struct.bloomFilterNbHashes);
      }
      if (struct.isSetBlockCacheEnabled()) {
        oprot.writeBool(struct.blockCacheEnabled);
      }
      if (struct.isSetTimeToLive()) {
        oprot.writeI32(struct.timeToLive);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, ColumnDescriptor struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet incoming = iprot.readBitSet(9);
      if (incoming.get(0)) {
        struct.name = iprot.readBinary();
        struct.setNameIsSet(true);
      }
      if (incoming.get(1)) {
        struct.maxVersions = iprot.readI32();
        struct.setMaxVersionsIsSet(true);
      }
      if (incoming.get(2)) {
        struct.compression = iprot.readString();
        struct.setCompressionIsSet(true);
      }
      if (incoming.get(3)) {
        struct.inMemory = iprot.readBool();
        struct.setInMemoryIsSet(true);
      }
      if (incoming.get(4)) {
        struct.bloomFilterType = iprot.readString();
        struct.setBloomFilterTypeIsSet(true);
      }
      if (incoming.get(5)) {
        struct.bloomFilterVectorSize = iprot.readI32();
        struct.setBloomFilterVectorSizeIsSet(true);
      }
      if (incoming.get(6)) {
        struct.bloomFilterNbHashes = iprot.readI32();
        struct.setBloomFilterNbHashesIsSet(true);
      }
      if (incoming.get(7)) {
        struct.blockCacheEnabled = iprot.readBool();
        struct.setBlockCacheEnabledIsSet(true);
      }
      if (incoming.get(8)) {
        struct.timeToLive = iprot.readI32();
        struct.setTimeToLiveIsSet(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();
  }
}

