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

io.snappydata.thrift.ColumnDescriptor Maven / Gradle / Ivy

There is a newer version: 1.6.7
Show newest version
/**
 * Autogenerated by Thrift Compiler (0.9.3)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package io.snappydata.thrift;

import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;

import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.server.AbstractNonblockingServer.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import javax.annotation.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2019-08-09")
public class ColumnDescriptor implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ColumnDescriptor");

  private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)1);
  private static final org.apache.thrift.protocol.TField PRECISION_FIELD_DESC = new org.apache.thrift.protocol.TField("precision", org.apache.thrift.protocol.TType.I16, (short)2);
  private static final org.apache.thrift.protocol.TField SCALE_FIELD_DESC = new org.apache.thrift.protocol.TField("scale", org.apache.thrift.protocol.TType.I16, (short)3);
  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)4);
  private static final org.apache.thrift.protocol.TField FULL_TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("fullTableName", org.apache.thrift.protocol.TType.STRING, (short)5);
  private static final org.apache.thrift.protocol.TField UPDATABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("updatable", org.apache.thrift.protocol.TType.BOOL, (short)6);
  private static final org.apache.thrift.protocol.TField DEFINITELY_UPDATABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("definitelyUpdatable", org.apache.thrift.protocol.TType.BOOL, (short)7);
  private static final org.apache.thrift.protocol.TField NULLABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("nullable", org.apache.thrift.protocol.TType.BOOL, (short)8);
  private static final org.apache.thrift.protocol.TField AUTO_INCREMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("autoIncrement", org.apache.thrift.protocol.TType.BOOL, (short)9);
  private static final org.apache.thrift.protocol.TField PARAMETER_IN_FIELD_DESC = new org.apache.thrift.protocol.TField("parameterIn", org.apache.thrift.protocol.TType.BOOL, (short)10);
  private static final org.apache.thrift.protocol.TField PARAMETER_OUT_FIELD_DESC = new org.apache.thrift.protocol.TField("parameterOut", org.apache.thrift.protocol.TType.BOOL, (short)11);
  private static final org.apache.thrift.protocol.TField ELEMENT_TYPES_FIELD_DESC = new org.apache.thrift.protocol.TField("elementTypes", org.apache.thrift.protocol.TType.LIST, (short)12);
  private static final org.apache.thrift.protocol.TField UDT_TYPE_AND_CLASS_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("udtTypeAndClassName", org.apache.thrift.protocol.TType.STRING, (short)13);

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

  /**
   * 
   * @see SnappyType
   */
  public SnappyType type; // required
  public short precision; // required
  public short scale; // optional
  public String name; // optional
  public String fullTableName; // optional
  public boolean updatable; // optional
  public boolean definitelyUpdatable; // optional
  public boolean nullable; // optional
  public boolean autoIncrement; // optional
  public boolean parameterIn; // optional
  public boolean parameterOut; // optional
  public List elementTypes; // optional
  public String udtTypeAndClassName; // 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 {
    /**
     * 
     * @see SnappyType
     */
    TYPE((short)1, "type"),
    PRECISION((short)2, "precision"),
    SCALE((short)3, "scale"),
    NAME((short)4, "name"),
    FULL_TABLE_NAME((short)5, "fullTableName"),
    UPDATABLE((short)6, "updatable"),
    DEFINITELY_UPDATABLE((short)7, "definitelyUpdatable"),
    NULLABLE((short)8, "nullable"),
    AUTO_INCREMENT((short)9, "autoIncrement"),
    PARAMETER_IN((short)10, "parameterIn"),
    PARAMETER_OUT((short)11, "parameterOut"),
    ELEMENT_TYPES((short)12, "elementTypes"),
    UDT_TYPE_AND_CLASS_NAME((short)13, "udtTypeAndClassName");

    private static final Map byName = new HashMap();

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

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // TYPE
          return TYPE;
        case 2: // PRECISION
          return PRECISION;
        case 3: // SCALE
          return SCALE;
        case 4: // NAME
          return NAME;
        case 5: // FULL_TABLE_NAME
          return FULL_TABLE_NAME;
        case 6: // UPDATABLE
          return UPDATABLE;
        case 7: // DEFINITELY_UPDATABLE
          return DEFINITELY_UPDATABLE;
        case 8: // NULLABLE
          return NULLABLE;
        case 9: // AUTO_INCREMENT
          return AUTO_INCREMENT;
        case 10: // PARAMETER_IN
          return PARAMETER_IN;
        case 11: // PARAMETER_OUT
          return PARAMETER_OUT;
        case 12: // ELEMENT_TYPES
          return ELEMENT_TYPES;
        case 13: // UDT_TYPE_AND_CLASS_NAME
          return UDT_TYPE_AND_CLASS_NAME;
        default:
          return null;
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, throwing an exception
     * if it is not found.
     */
    public static _Fields findByThriftIdOrThrow(int fieldId) {
      _Fields fields = findByThriftId(fieldId);
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
      return fields;
    }

    /**
     * Find the _Fields constant that matches name, or null if its not found.
     */
    public static _Fields findByName(String name) {
      return byName.get(name);
    }

    private final short _thriftId;
    private final String _fieldName;

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

    public short getThriftFieldId() {
      return _thriftId;
    }

    public String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final int __PRECISION_ISSET_ID = 0;
  private static final int __SCALE_ISSET_ID = 1;
  private static final int __UPDATABLE_ISSET_ID = 2;
  private static final int __DEFINITELYUPDATABLE_ISSET_ID = 3;
  private static final int __NULLABLE_ISSET_ID = 4;
  private static final int __AUTOINCREMENT_ISSET_ID = 5;
  private static final int __PARAMETERIN_ISSET_ID = 6;
  private static final int __PARAMETEROUT_ISSET_ID = 7;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.SCALE,_Fields.NAME,_Fields.FULL_TABLE_NAME,_Fields.UPDATABLE,_Fields.DEFINITELY_UPDATABLE,_Fields.NULLABLE,_Fields.AUTO_INCREMENT,_Fields.PARAMETER_IN,_Fields.PARAMETER_OUT,_Fields.ELEMENT_TYPES,_Fields.UDT_TYPE_AND_CLASS_NAME};
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, SnappyType.class)));
    tmpMap.put(_Fields.PRECISION, new org.apache.thrift.meta_data.FieldMetaData("precision", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16)));
    tmpMap.put(_Fields.SCALE, new org.apache.thrift.meta_data.FieldMetaData("scale", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16)));
    tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.FULL_TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("fullTableName", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.UPDATABLE, new org.apache.thrift.meta_data.FieldMetaData("updatable", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.DEFINITELY_UPDATABLE, new org.apache.thrift.meta_data.FieldMetaData("definitelyUpdatable", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.NULLABLE, new org.apache.thrift.meta_data.FieldMetaData("nullable", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.AUTO_INCREMENT, new org.apache.thrift.meta_data.FieldMetaData("autoIncrement", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.PARAMETER_IN, new org.apache.thrift.meta_data.FieldMetaData("parameterIn", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.PARAMETER_OUT, new org.apache.thrift.meta_data.FieldMetaData("parameterOut", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.ELEMENT_TYPES, new org.apache.thrift.meta_data.FieldMetaData("elementTypes", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, SnappyType.class))));
    tmpMap.put(_Fields.UDT_TYPE_AND_CLASS_NAME, new org.apache.thrift.meta_data.FieldMetaData("udtTypeAndClassName", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ColumnDescriptor.class, metaDataMap);
  }

  public ColumnDescriptor() {
  }

  public ColumnDescriptor(
    SnappyType type,
    short precision)
  {
    this();
    this.type = type;
    this.precision = precision;
    setPrecisionIsSet(true);
  }

  /**
   * Performs a deep copy on other.
   */
  public ColumnDescriptor(ColumnDescriptor other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetType()) {
      this.type = other.type;
    }
    this.precision = other.precision;
    this.scale = other.scale;
    if (other.isSetName()) {
      this.name = other.name;
    }
    if (other.isSetFullTableName()) {
      this.fullTableName = other.fullTableName;
    }
    this.updatable = other.updatable;
    this.definitelyUpdatable = other.definitelyUpdatable;
    this.nullable = other.nullable;
    this.autoIncrement = other.autoIncrement;
    this.parameterIn = other.parameterIn;
    this.parameterOut = other.parameterOut;
    if (other.isSetElementTypes()) {
      List __this__elementTypes = new ArrayList(other.elementTypes.size());
      for (SnappyType other_element : other.elementTypes) {
        __this__elementTypes.add(other_element);
      }
      this.elementTypes = __this__elementTypes;
    }
    if (other.isSetUdtTypeAndClassName()) {
      this.udtTypeAndClassName = other.udtTypeAndClassName;
    }
  }

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

  @Override
  public void clear() {
    this.type = null;
    setPrecisionIsSet(false);
    this.precision = 0;
    setScaleIsSet(false);
    this.scale = 0;
    this.name = null;
    this.fullTableName = null;
    setUpdatableIsSet(false);
    this.updatable = false;
    setDefinitelyUpdatableIsSet(false);
    this.definitelyUpdatable = false;
    setNullableIsSet(false);
    this.nullable = false;
    setAutoIncrementIsSet(false);
    this.autoIncrement = false;
    setParameterInIsSet(false);
    this.parameterIn = false;
    setParameterOutIsSet(false);
    this.parameterOut = false;
    this.elementTypes = null;
    this.udtTypeAndClassName = null;
  }

  /**
   * 
   * @see SnappyType
   */
  public SnappyType getType() {
    return this.type;
  }

  /**
   * 
   * @see SnappyType
   */
  public ColumnDescriptor setType(SnappyType type) {
    this.type = type;
    return this;
  }

  public void unsetType() {
    this.type = null;
  }

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

  public void setTypeIsSet(boolean value) {
    if (!value) {
      this.type = null;
    }
  }

  public short getPrecision() {
    return this.precision;
  }

  public ColumnDescriptor setPrecision(short precision) {
    this.precision = precision;
    setPrecisionIsSet(true);
    return this;
  }

  public void unsetPrecision() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PRECISION_ISSET_ID);
  }

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

  public void setPrecisionIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PRECISION_ISSET_ID, value);
  }

  public short getScale() {
    return this.scale;
  }

  public ColumnDescriptor setScale(short scale) {
    this.scale = scale;
    setScaleIsSet(true);
    return this;
  }

  public void unsetScale() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SCALE_ISSET_ID);
  }

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

  public void setScaleIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SCALE_ISSET_ID, value);
  }

  public String getName() {
    return this.name;
  }

  public ColumnDescriptor setName(String name) {
    this.name = 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 String getFullTableName() {
    return this.fullTableName;
  }

  public ColumnDescriptor setFullTableName(String fullTableName) {
    this.fullTableName = fullTableName;
    return this;
  }

  public void unsetFullTableName() {
    this.fullTableName = null;
  }

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

  public void setFullTableNameIsSet(boolean value) {
    if (!value) {
      this.fullTableName = null;
    }
  }

  public boolean isUpdatable() {
    return this.updatable;
  }

  public ColumnDescriptor setUpdatable(boolean updatable) {
    this.updatable = updatable;
    setUpdatableIsSet(true);
    return this;
  }

  public void unsetUpdatable() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UPDATABLE_ISSET_ID);
  }

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

  public void setUpdatableIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UPDATABLE_ISSET_ID, value);
  }

  public boolean isDefinitelyUpdatable() {
    return this.definitelyUpdatable;
  }

  public ColumnDescriptor setDefinitelyUpdatable(boolean definitelyUpdatable) {
    this.definitelyUpdatable = definitelyUpdatable;
    setDefinitelyUpdatableIsSet(true);
    return this;
  }

  public void unsetDefinitelyUpdatable() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DEFINITELYUPDATABLE_ISSET_ID);
  }

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

  public void setDefinitelyUpdatableIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DEFINITELYUPDATABLE_ISSET_ID, value);
  }

  public boolean isNullable() {
    return this.nullable;
  }

  public ColumnDescriptor setNullable(boolean nullable) {
    this.nullable = nullable;
    setNullableIsSet(true);
    return this;
  }

  public void unsetNullable() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NULLABLE_ISSET_ID);
  }

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

  public void setNullableIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NULLABLE_ISSET_ID, value);
  }

  public boolean isAutoIncrement() {
    return this.autoIncrement;
  }

  public ColumnDescriptor setAutoIncrement(boolean autoIncrement) {
    this.autoIncrement = autoIncrement;
    setAutoIncrementIsSet(true);
    return this;
  }

  public void unsetAutoIncrement() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __AUTOINCREMENT_ISSET_ID);
  }

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

  public void setAutoIncrementIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __AUTOINCREMENT_ISSET_ID, value);
  }

  public boolean isParameterIn() {
    return this.parameterIn;
  }

  public ColumnDescriptor setParameterIn(boolean parameterIn) {
    this.parameterIn = parameterIn;
    setParameterInIsSet(true);
    return this;
  }

  public void unsetParameterIn() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PARAMETERIN_ISSET_ID);
  }

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

  public void setParameterInIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PARAMETERIN_ISSET_ID, value);
  }

  public boolean isParameterOut() {
    return this.parameterOut;
  }

  public ColumnDescriptor setParameterOut(boolean parameterOut) {
    this.parameterOut = parameterOut;
    setParameterOutIsSet(true);
    return this;
  }

  public void unsetParameterOut() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PARAMETEROUT_ISSET_ID);
  }

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

  public void setParameterOutIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PARAMETEROUT_ISSET_ID, value);
  }

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

  public java.util.Iterator getElementTypesIterator() {
    return (this.elementTypes == null) ? null : this.elementTypes.iterator();
  }

  public void addToElementTypes(SnappyType elem) {
    if (this.elementTypes == null) {
      this.elementTypes = new ArrayList();
    }
    this.elementTypes.add(elem);
  }

  public List getElementTypes() {
    return this.elementTypes;
  }

  public ColumnDescriptor setElementTypes(List elementTypes) {
    this.elementTypes = elementTypes;
    return this;
  }

  public void unsetElementTypes() {
    this.elementTypes = null;
  }

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

  public void setElementTypesIsSet(boolean value) {
    if (!value) {
      this.elementTypes = null;
    }
  }

  public String getUdtTypeAndClassName() {
    return this.udtTypeAndClassName;
  }

  public ColumnDescriptor setUdtTypeAndClassName(String udtTypeAndClassName) {
    this.udtTypeAndClassName = udtTypeAndClassName;
    return this;
  }

  public void unsetUdtTypeAndClassName() {
    this.udtTypeAndClassName = null;
  }

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

  public void setUdtTypeAndClassNameIsSet(boolean value) {
    if (!value) {
      this.udtTypeAndClassName = null;
    }
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case TYPE:
      if (value == null) {
        unsetType();
      } else {
        setType((SnappyType)value);
      }
      break;

    case PRECISION:
      if (value == null) {
        unsetPrecision();
      } else {
        setPrecision((Short)value);
      }
      break;

    case SCALE:
      if (value == null) {
        unsetScale();
      } else {
        setScale((Short)value);
      }
      break;

    case NAME:
      if (value == null) {
        unsetName();
      } else {
        setName((String)value);
      }
      break;

    case FULL_TABLE_NAME:
      if (value == null) {
        unsetFullTableName();
      } else {
        setFullTableName((String)value);
      }
      break;

    case UPDATABLE:
      if (value == null) {
        unsetUpdatable();
      } else {
        setUpdatable((Boolean)value);
      }
      break;

    case DEFINITELY_UPDATABLE:
      if (value == null) {
        unsetDefinitelyUpdatable();
      } else {
        setDefinitelyUpdatable((Boolean)value);
      }
      break;

    case NULLABLE:
      if (value == null) {
        unsetNullable();
      } else {
        setNullable((Boolean)value);
      }
      break;

    case AUTO_INCREMENT:
      if (value == null) {
        unsetAutoIncrement();
      } else {
        setAutoIncrement((Boolean)value);
      }
      break;

    case PARAMETER_IN:
      if (value == null) {
        unsetParameterIn();
      } else {
        setParameterIn((Boolean)value);
      }
      break;

    case PARAMETER_OUT:
      if (value == null) {
        unsetParameterOut();
      } else {
        setParameterOut((Boolean)value);
      }
      break;

    case ELEMENT_TYPES:
      if (value == null) {
        unsetElementTypes();
      } else {
        setElementTypes((List)value);
      }
      break;

    case UDT_TYPE_AND_CLASS_NAME:
      if (value == null) {
        unsetUdtTypeAndClassName();
      } else {
        setUdtTypeAndClassName((String)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case TYPE:
      return getType();

    case PRECISION:
      return getPrecision();

    case SCALE:
      return getScale();

    case NAME:
      return getName();

    case FULL_TABLE_NAME:
      return getFullTableName();

    case UPDATABLE:
      return isUpdatable();

    case DEFINITELY_UPDATABLE:
      return isDefinitelyUpdatable();

    case NULLABLE:
      return isNullable();

    case AUTO_INCREMENT:
      return isAutoIncrement();

    case PARAMETER_IN:
      return isParameterIn();

    case PARAMETER_OUT:
      return isParameterOut();

    case ELEMENT_TYPES:
      return getElementTypes();

    case UDT_TYPE_AND_CLASS_NAME:
      return getUdtTypeAndClassName();

    }
    throw new IllegalStateException();
  }

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

    switch (field) {
    case TYPE:
      return isSetType();
    case PRECISION:
      return isSetPrecision();
    case SCALE:
      return isSetScale();
    case NAME:
      return isSetName();
    case FULL_TABLE_NAME:
      return isSetFullTableName();
    case UPDATABLE:
      return isSetUpdatable();
    case DEFINITELY_UPDATABLE:
      return isSetDefinitelyUpdatable();
    case NULLABLE:
      return isSetNullable();
    case AUTO_INCREMENT:
      return isSetAutoIncrement();
    case PARAMETER_IN:
      return isSetParameterIn();
    case PARAMETER_OUT:
      return isSetParameterOut();
    case ELEMENT_TYPES:
      return isSetElementTypes();
    case UDT_TYPE_AND_CLASS_NAME:
      return isSetUdtTypeAndClassName();
    }
    throw new IllegalStateException();
  }

  @Override
  public boolean equals(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;

    boolean this_present_type = true && this.isSetType();
    boolean that_present_type = true && that.isSetType();
    if (this_present_type || that_present_type) {
      if (!(this_present_type && that_present_type))
        return false;
      if (!this.type.equals(that.type))
        return false;
    }

    boolean this_present_precision = true;
    boolean that_present_precision = true;
    if (this_present_precision || that_present_precision) {
      if (!(this_present_precision && that_present_precision))
        return false;
      if (this.precision != that.precision)
        return false;
    }

    boolean this_present_scale = true && this.isSetScale();
    boolean that_present_scale = true && that.isSetScale();
    if (this_present_scale || that_present_scale) {
      if (!(this_present_scale && that_present_scale))
        return false;
      if (this.scale != that.scale)
        return false;
    }

    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_fullTableName = true && this.isSetFullTableName();
    boolean that_present_fullTableName = true && that.isSetFullTableName();
    if (this_present_fullTableName || that_present_fullTableName) {
      if (!(this_present_fullTableName && that_present_fullTableName))
        return false;
      if (!this.fullTableName.equals(that.fullTableName))
        return false;
    }

    boolean this_present_updatable = true && this.isSetUpdatable();
    boolean that_present_updatable = true && that.isSetUpdatable();
    if (this_present_updatable || that_present_updatable) {
      if (!(this_present_updatable && that_present_updatable))
        return false;
      if (this.updatable != that.updatable)
        return false;
    }

    boolean this_present_definitelyUpdatable = true && this.isSetDefinitelyUpdatable();
    boolean that_present_definitelyUpdatable = true && that.isSetDefinitelyUpdatable();
    if (this_present_definitelyUpdatable || that_present_definitelyUpdatable) {
      if (!(this_present_definitelyUpdatable && that_present_definitelyUpdatable))
        return false;
      if (this.definitelyUpdatable != that.definitelyUpdatable)
        return false;
    }

    boolean this_present_nullable = true && this.isSetNullable();
    boolean that_present_nullable = true && that.isSetNullable();
    if (this_present_nullable || that_present_nullable) {
      if (!(this_present_nullable && that_present_nullable))
        return false;
      if (this.nullable != that.nullable)
        return false;
    }

    boolean this_present_autoIncrement = true && this.isSetAutoIncrement();
    boolean that_present_autoIncrement = true && that.isSetAutoIncrement();
    if (this_present_autoIncrement || that_present_autoIncrement) {
      if (!(this_present_autoIncrement && that_present_autoIncrement))
        return false;
      if (this.autoIncrement != that.autoIncrement)
        return false;
    }

    boolean this_present_parameterIn = true && this.isSetParameterIn();
    boolean that_present_parameterIn = true && that.isSetParameterIn();
    if (this_present_parameterIn || that_present_parameterIn) {
      if (!(this_present_parameterIn && that_present_parameterIn))
        return false;
      if (this.parameterIn != that.parameterIn)
        return false;
    }

    boolean this_present_parameterOut = true && this.isSetParameterOut();
    boolean that_present_parameterOut = true && that.isSetParameterOut();
    if (this_present_parameterOut || that_present_parameterOut) {
      if (!(this_present_parameterOut && that_present_parameterOut))
        return false;
      if (this.parameterOut != that.parameterOut)
        return false;
    }

    boolean this_present_elementTypes = true && this.isSetElementTypes();
    boolean that_present_elementTypes = true && that.isSetElementTypes();
    if (this_present_elementTypes || that_present_elementTypes) {
      if (!(this_present_elementTypes && that_present_elementTypes))
        return false;
      if (!this.elementTypes.equals(that.elementTypes))
        return false;
    }

    boolean this_present_udtTypeAndClassName = true && this.isSetUdtTypeAndClassName();
    boolean that_present_udtTypeAndClassName = true && that.isSetUdtTypeAndClassName();
    if (this_present_udtTypeAndClassName || that_present_udtTypeAndClassName) {
      if (!(this_present_udtTypeAndClassName && that_present_udtTypeAndClassName))
        return false;
      if (!this.udtTypeAndClassName.equals(that.udtTypeAndClassName))
        return false;
    }

    return true;
  }

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

    boolean present_type = true && (isSetType());
    list.add(present_type);
    if (present_type)
      list.add(type.getValue());

    boolean present_precision = true;
    list.add(present_precision);
    if (present_precision)
      list.add(precision);

    boolean present_scale = true && (isSetScale());
    list.add(present_scale);
    if (present_scale)
      list.add(scale);

    boolean present_name = true && (isSetName());
    list.add(present_name);
    if (present_name)
      list.add(name);

    boolean present_fullTableName = true && (isSetFullTableName());
    list.add(present_fullTableName);
    if (present_fullTableName)
      list.add(fullTableName);

    boolean present_updatable = true && (isSetUpdatable());
    list.add(present_updatable);
    if (present_updatable)
      list.add(updatable);

    boolean present_definitelyUpdatable = true && (isSetDefinitelyUpdatable());
    list.add(present_definitelyUpdatable);
    if (present_definitelyUpdatable)
      list.add(definitelyUpdatable);

    boolean present_nullable = true && (isSetNullable());
    list.add(present_nullable);
    if (present_nullable)
      list.add(nullable);

    boolean present_autoIncrement = true && (isSetAutoIncrement());
    list.add(present_autoIncrement);
    if (present_autoIncrement)
      list.add(autoIncrement);

    boolean present_parameterIn = true && (isSetParameterIn());
    list.add(present_parameterIn);
    if (present_parameterIn)
      list.add(parameterIn);

    boolean present_parameterOut = true && (isSetParameterOut());
    list.add(present_parameterOut);
    if (present_parameterOut)
      list.add(parameterOut);

    boolean present_elementTypes = true && (isSetElementTypes());
    list.add(present_elementTypes);
    if (present_elementTypes)
      list.add(elementTypes);

    boolean present_udtTypeAndClassName = true && (isSetUdtTypeAndClassName());
    list.add(present_udtTypeAndClassName);
    if (present_udtTypeAndClassName)
      list.add(udtTypeAndClassName);

    return list.hashCode();
  }

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

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetType()).compareTo(other.isSetType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, other.type);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetPrecision()).compareTo(other.isSetPrecision());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPrecision()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.precision, other.precision);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetScale()).compareTo(other.isSetScale());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetScale()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scale, other.scale);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = 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 = Boolean.valueOf(isSetFullTableName()).compareTo(other.isSetFullTableName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFullTableName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fullTableName, other.fullTableName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetUpdatable()).compareTo(other.isSetUpdatable());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUpdatable()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updatable, other.updatable);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDefinitelyUpdatable()).compareTo(other.isSetDefinitelyUpdatable());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDefinitelyUpdatable()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.definitelyUpdatable, other.definitelyUpdatable);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetNullable()).compareTo(other.isSetNullable());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetNullable()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nullable, other.nullable);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAutoIncrement()).compareTo(other.isSetAutoIncrement());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAutoIncrement()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.autoIncrement, other.autoIncrement);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetParameterIn()).compareTo(other.isSetParameterIn());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetParameterIn()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parameterIn, other.parameterIn);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetParameterOut()).compareTo(other.isSetParameterOut());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetParameterOut()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parameterOut, other.parameterOut);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetElementTypes()).compareTo(other.isSetElementTypes());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetElementTypes()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.elementTypes, other.elementTypes);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetUdtTypeAndClassName()).compareTo(other.isSetUdtTypeAndClassName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUdtTypeAndClassName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.udtTypeAndClassName, other.udtTypeAndClassName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  public _Fields fieldForId(int fieldId) {
    return _Fields.findByThriftId(fieldId);
  }

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

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

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder("ColumnDescriptor(");
    boolean first = true;

    sb.append("type:");
    if (this.type == null) {
      sb.append("null");
    } else {
      sb.append(this.type);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("precision:");
    sb.append(this.precision);
    first = false;
    if (isSetScale()) {
      if (!first) sb.append(", ");
      sb.append("scale:");
      sb.append(this.scale);
      first = false;
    }
    if (isSetName()) {
      if (!first) sb.append(", ");
      sb.append("name:");
      if (this.name == null) {
        sb.append("null");
      } else {
        sb.append(this.name);
      }
      first = false;
    }
    if (isSetFullTableName()) {
      if (!first) sb.append(", ");
      sb.append("fullTableName:");
      if (this.fullTableName == null) {
        sb.append("null");
      } else {
        sb.append(this.fullTableName);
      }
      first = false;
    }
    if (isSetUpdatable()) {
      if (!first) sb.append(", ");
      sb.append("updatable:");
      sb.append(this.updatable);
      first = false;
    }
    if (isSetDefinitelyUpdatable()) {
      if (!first) sb.append(", ");
      sb.append("definitelyUpdatable:");
      sb.append(this.definitelyUpdatable);
      first = false;
    }
    if (isSetNullable()) {
      if (!first) sb.append(", ");
      sb.append("nullable:");
      sb.append(this.nullable);
      first = false;
    }
    if (isSetAutoIncrement()) {
      if (!first) sb.append(", ");
      sb.append("autoIncrement:");
      sb.append(this.autoIncrement);
      first = false;
    }
    if (isSetParameterIn()) {
      if (!first) sb.append(", ");
      sb.append("parameterIn:");
      sb.append(this.parameterIn);
      first = false;
    }
    if (isSetParameterOut()) {
      if (!first) sb.append(", ");
      sb.append("parameterOut:");
      sb.append(this.parameterOut);
      first = false;
    }
    if (isSetElementTypes()) {
      if (!first) sb.append(", ");
      sb.append("elementTypes:");
      if (this.elementTypes == null) {
        sb.append("null");
      } else {
        sb.append(this.elementTypes);
      }
      first = false;
    }
    if (isSetUdtTypeAndClassName()) {
      if (!first) sb.append(", ");
      sb.append("udtTypeAndClassName:");
      if (this.udtTypeAndClassName == null) {
        sb.append("null");
      } else {
        sb.append(this.udtTypeAndClassName);
      }
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    if (type == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'type' was not present! Struct: " + toString());
    }
    // alas, we cannot check 'precision' because it's a primitive and you chose the non-beans generator.
    // check for sub-struct validity
  }

  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
    try {
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
    try {
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
      __isset_bitfield = 0;
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private static class ColumnDescriptorStandardSchemeFactory implements SchemeFactory {
    public ColumnDescriptorStandardScheme getScheme() {
      return new ColumnDescriptorStandardScheme();
    }
  }

  private static class ColumnDescriptorStandardScheme extends StandardScheme {

    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: // TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.type = io.snappydata.thrift.SnappyType.findByValue(iprot.readI32());
              struct.setTypeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // PRECISION
            if (schemeField.type == org.apache.thrift.protocol.TType.I16) {
              struct.precision = iprot.readI16();
              struct.setPrecisionIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // SCALE
            if (schemeField.type == org.apache.thrift.protocol.TType.I16) {
              struct.scale = iprot.readI16();
              struct.setScaleIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.name = iprot.readString();
              struct.setNameIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // FULL_TABLE_NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.fullTableName = iprot.readString();
              struct.setFullTableNameIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // UPDATABLE
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.updatable = iprot.readBool();
              struct.setUpdatableIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // DEFINITELY_UPDATABLE
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.definitelyUpdatable = iprot.readBool();
              struct.setDefinitelyUpdatableIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // NULLABLE
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.nullable = iprot.readBool();
              struct.setNullableIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 9: // AUTO_INCREMENT
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.autoIncrement = iprot.readBool();
              struct.setAutoIncrementIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 10: // PARAMETER_IN
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.parameterIn = iprot.readBool();
              struct.setParameterInIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 11: // PARAMETER_OUT
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.parameterOut = iprot.readBool();
              struct.setParameterOutIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 12: // ELEMENT_TYPES
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list188 = iprot.readListBegin();
                struct.elementTypes = new ArrayList(_list188.size);
                SnappyType _elem189;
                for (int _i190 = 0; _i190 < _list188.size; ++_i190)
                {
                  _elem189 = io.snappydata.thrift.SnappyType.findByValue(iprot.readI32());
                  struct.elementTypes.add(_elem189);
                }
                iprot.readListEnd();
              }
              struct.setElementTypesIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 13: // UDT_TYPE_AND_CLASS_NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.udtTypeAndClassName = iprot.readString();
              struct.setUdtTypeAndClassNameIsSet(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
      if (!struct.isSetPrecision()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'precision' was not found in serialized data! Struct: " + toString());
      }
      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.type != null) {
        oprot.writeFieldBegin(TYPE_FIELD_DESC);
        oprot.writeI32(struct.type.getValue());
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(PRECISION_FIELD_DESC);
      oprot.writeI16(struct.precision);
      oprot.writeFieldEnd();
      if (struct.isSetScale()) {
        oprot.writeFieldBegin(SCALE_FIELD_DESC);
        oprot.writeI16(struct.scale);
        oprot.writeFieldEnd();
      }
      if (struct.name != null) {
        if (struct.isSetName()) {
          oprot.writeFieldBegin(NAME_FIELD_DESC);
          oprot.writeString(struct.name);
          oprot.writeFieldEnd();
        }
      }
      if (struct.fullTableName != null) {
        if (struct.isSetFullTableName()) {
          oprot.writeFieldBegin(FULL_TABLE_NAME_FIELD_DESC);
          oprot.writeString(struct.fullTableName);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetUpdatable()) {
        oprot.writeFieldBegin(UPDATABLE_FIELD_DESC);
        oprot.writeBool(struct.updatable);
        oprot.writeFieldEnd();
      }
      if (struct.isSetDefinitelyUpdatable()) {
        oprot.writeFieldBegin(DEFINITELY_UPDATABLE_FIELD_DESC);
        oprot.writeBool(struct.definitelyUpdatable);
        oprot.writeFieldEnd();
      }
      if (struct.isSetNullable()) {
        oprot.writeFieldBegin(NULLABLE_FIELD_DESC);
        oprot.writeBool(struct.nullable);
        oprot.writeFieldEnd();
      }
      if (struct.isSetAutoIncrement()) {
        oprot.writeFieldBegin(AUTO_INCREMENT_FIELD_DESC);
        oprot.writeBool(struct.autoIncrement);
        oprot.writeFieldEnd();
      }
      if (struct.isSetParameterIn()) {
        oprot.writeFieldBegin(PARAMETER_IN_FIELD_DESC);
        oprot.writeBool(struct.parameterIn);
        oprot.writeFieldEnd();
      }
      if (struct.isSetParameterOut()) {
        oprot.writeFieldBegin(PARAMETER_OUT_FIELD_DESC);
        oprot.writeBool(struct.parameterOut);
        oprot.writeFieldEnd();
      }
      if (struct.elementTypes != null) {
        if (struct.isSetElementTypes()) {
          oprot.writeFieldBegin(ELEMENT_TYPES_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.elementTypes.size()));
            for (SnappyType _iter191 : struct.elementTypes)
            {
              oprot.writeI32(_iter191.getValue());
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.udtTypeAndClassName != null) {
        if (struct.isSetUdtTypeAndClassName()) {
          oprot.writeFieldBegin(UDT_TYPE_AND_CLASS_NAME_FIELD_DESC);
          oprot.writeString(struct.udtTypeAndClassName);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class ColumnDescriptorTupleSchemeFactory implements SchemeFactory {
    public ColumnDescriptorTupleScheme getScheme() {
      return new ColumnDescriptorTupleScheme();
    }
  }

  private static class ColumnDescriptorTupleScheme extends TupleScheme {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, ColumnDescriptor struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      oprot.writeI32(struct.type.getValue());
      oprot.writeI16(struct.precision);
      BitSet optionals = new BitSet();
      if (struct.isSetScale()) {
        optionals.set(0);
      }
      if (struct.isSetName()) {
        optionals.set(1);
      }
      if (struct.isSetFullTableName()) {
        optionals.set(2);
      }
      if (struct.isSetUpdatable()) {
        optionals.set(3);
      }
      if (struct.isSetDefinitelyUpdatable()) {
        optionals.set(4);
      }
      if (struct.isSetNullable()) {
        optionals.set(5);
      }
      if (struct.isSetAutoIncrement()) {
        optionals.set(6);
      }
      if (struct.isSetParameterIn()) {
        optionals.set(7);
      }
      if (struct.isSetParameterOut()) {
        optionals.set(8);
      }
      if (struct.isSetElementTypes()) {
        optionals.set(9);
      }
      if (struct.isSetUdtTypeAndClassName()) {
        optionals.set(10);
      }
      oprot.writeBitSet(optionals, 11);
      if (struct.isSetScale()) {
        oprot.writeI16(struct.scale);
      }
      if (struct.isSetName()) {
        oprot.writeString(struct.name);
      }
      if (struct.isSetFullTableName()) {
        oprot.writeString(struct.fullTableName);
      }
      if (struct.isSetUpdatable()) {
        oprot.writeBool(struct.updatable);
      }
      if (struct.isSetDefinitelyUpdatable()) {
        oprot.writeBool(struct.definitelyUpdatable);
      }
      if (struct.isSetNullable()) {
        oprot.writeBool(struct.nullable);
      }
      if (struct.isSetAutoIncrement()) {
        oprot.writeBool(struct.autoIncrement);
      }
      if (struct.isSetParameterIn()) {
        oprot.writeBool(struct.parameterIn);
      }
      if (struct.isSetParameterOut()) {
        oprot.writeBool(struct.parameterOut);
      }
      if (struct.isSetElementTypes()) {
        {
          oprot.writeI32(struct.elementTypes.size());
          for (SnappyType _iter192 : struct.elementTypes)
          {
            oprot.writeI32(_iter192.getValue());
          }
        }
      }
      if (struct.isSetUdtTypeAndClassName()) {
        oprot.writeString(struct.udtTypeAndClassName);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, ColumnDescriptor struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      struct.type = io.snappydata.thrift.SnappyType.findByValue(iprot.readI32());
      struct.setTypeIsSet(true);
      struct.precision = iprot.readI16();
      struct.setPrecisionIsSet(true);
      BitSet incoming = iprot.readBitSet(11);
      if (incoming.get(0)) {
        struct.scale = iprot.readI16();
        struct.setScaleIsSet(true);
      }
      if (incoming.get(1)) {
        struct.name = iprot.readString();
        struct.setNameIsSet(true);
      }
      if (incoming.get(2)) {
        struct.fullTableName = iprot.readString();
        struct.setFullTableNameIsSet(true);
      }
      if (incoming.get(3)) {
        struct.updatable = iprot.readBool();
        struct.setUpdatableIsSet(true);
      }
      if (incoming.get(4)) {
        struct.definitelyUpdatable = iprot.readBool();
        struct.setDefinitelyUpdatableIsSet(true);
      }
      if (incoming.get(5)) {
        struct.nullable = iprot.readBool();
        struct.setNullableIsSet(true);
      }
      if (incoming.get(6)) {
        struct.autoIncrement = iprot.readBool();
        struct.setAutoIncrementIsSet(true);
      }
      if (incoming.get(7)) {
        struct.parameterIn = iprot.readBool();
        struct.setParameterInIsSet(true);
      }
      if (incoming.get(8)) {
        struct.parameterOut = iprot.readBool();
        struct.setParameterOutIsSet(true);
      }
      if (incoming.get(9)) {
        {
          org.apache.thrift.protocol.TList _list193 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32());
          struct.elementTypes = new ArrayList(_list193.size);
          SnappyType _elem194;
          for (int _i195 = 0; _i195 < _list193.size; ++_i195)
          {
            _elem194 = io.snappydata.thrift.SnappyType.findByValue(iprot.readI32());
            struct.elementTypes.add(_elem194);
          }
        }
        struct.setElementTypesIsSet(true);
      }
      if (incoming.get(10)) {
        struct.udtTypeAndClassName = iprot.readString();
        struct.setUdtTypeAndClassNameIsSet(true);
      }
    }
  }

}