/**
 * Autogenerated by Thrift
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package com.vesoft.nebula.meta;

import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.Set;
import java.util.HashSet;
import java.util.Collections;
import java.util.BitSet;
import java.util.Arrays;
import com.facebook.thrift.*;
import com.facebook.thrift.annotations.*;
import com.facebook.thrift.async.*;
import com.facebook.thrift.meta_data.*;
import com.facebook.thrift.server.*;
import com.facebook.thrift.transport.*;
import com.facebook.thrift.protocol.*;

@SuppressWarnings({ "unused", "serial" })
public class IndexItem implements TBase, java.io.Serializable, Cloneable, Comparable<IndexItem> {
  private static final TStruct STRUCT_DESC = new TStruct("IndexItem");
  private static final TField INDEX_ID_FIELD_DESC = new TField("index_id", TType.I32, (short)1);
  private static final TField INDEX_NAME_FIELD_DESC = new TField("index_name", TType.STRING, (short)2);
  private static final TField SCHEMA_ID_FIELD_DESC = new TField("schema_id", TType.STRUCT, (short)3);
  private static final TField SCHEMA_NAME_FIELD_DESC = new TField("schema_name", TType.STRING, (short)4);
  private static final TField FIELDS_FIELD_DESC = new TField("fields", TType.LIST, (short)5);
  private static final TField COMMENT_FIELD_DESC = new TField("comment", TType.STRING, (short)6);
  private static final TField INDEX_PARAMS_FIELD_DESC = new TField("index_params", TType.STRUCT, (short)7);

  public int index_id;
  public byte[] index_name;
  public com.vesoft.nebula.SchemaID schema_id;
  public byte[] schema_name;
  public List<ColumnDef> fields;
  public byte[] comment;
  public IndexParams index_params;
  public static final int INDEX_ID = 1;
  public static final int INDEX_NAME = 2;
  public static final int SCHEMA_ID = 3;
  public static final int SCHEMA_NAME = 4;
  public static final int FIELDS = 5;
  public static final int COMMENT = 6;
  public static final int INDEX_PARAMS = 7;

  // isset id assignments
  private static final int __INDEX_ID_ISSET_ID = 0;
  private BitSet __isset_bit_vector = new BitSet(1);

  public static final Map<Integer, FieldMetaData> metaDataMap;

  static {
    Map<Integer, FieldMetaData> tmpMetaDataMap = new HashMap<Integer, FieldMetaData>();
    tmpMetaDataMap.put(INDEX_ID, new FieldMetaData("index_id", TFieldRequirementType.DEFAULT, 
        new FieldValueMetaData(TType.I32)));
    tmpMetaDataMap.put(INDEX_NAME, new FieldMetaData("index_name", TFieldRequirementType.DEFAULT, 
        new FieldValueMetaData(TType.STRING)));
    tmpMetaDataMap.put(SCHEMA_ID, new FieldMetaData("schema_id", TFieldRequirementType.DEFAULT, 
        new StructMetaData(TType.STRUCT, com.vesoft.nebula.SchemaID.class)));
    tmpMetaDataMap.put(SCHEMA_NAME, new FieldMetaData("schema_name", TFieldRequirementType.DEFAULT, 
        new FieldValueMetaData(TType.STRING)));
    tmpMetaDataMap.put(FIELDS, new FieldMetaData("fields", TFieldRequirementType.DEFAULT, 
        new ListMetaData(TType.LIST, 
            new StructMetaData(TType.STRUCT, ColumnDef.class))));
    tmpMetaDataMap.put(COMMENT, new FieldMetaData("comment", TFieldRequirementType.OPTIONAL, 
        new FieldValueMetaData(TType.STRING)));
    tmpMetaDataMap.put(INDEX_PARAMS, new FieldMetaData("index_params", TFieldRequirementType.OPTIONAL, 
        new StructMetaData(TType.STRUCT, IndexParams.class)));
    metaDataMap = Collections.unmodifiableMap(tmpMetaDataMap);
  }

  static {
    FieldMetaData.addStructMetaDataMap(IndexItem.class, metaDataMap);
  }

  public IndexItem() {
  }

  public IndexItem(
      int index_id,
      byte[] index_name,
      com.vesoft.nebula.SchemaID schema_id,
      byte[] schema_name,
      List<ColumnDef> fields) {
    this();
    this.index_id = index_id;
    setIndex_idIsSet(true);
    this.index_name = index_name;
    this.schema_id = schema_id;
    this.schema_name = schema_name;
    this.fields = fields;
  }

  public IndexItem(
      int index_id,
      byte[] index_name,
      com.vesoft.nebula.SchemaID schema_id,
      byte[] schema_name,
      List<ColumnDef> fields,
      byte[] comment,
      IndexParams index_params) {
    this();
    this.index_id = index_id;
    setIndex_idIsSet(true);
    this.index_name = index_name;
    this.schema_id = schema_id;
    this.schema_name = schema_name;
    this.fields = fields;
    this.comment = comment;
    this.index_params = index_params;
  }

  public static class Builder {
    private int index_id;
    private byte[] index_name;
    private com.vesoft.nebula.SchemaID schema_id;
    private byte[] schema_name;
    private List<ColumnDef> fields;
    private byte[] comment;
    private IndexParams index_params;

    BitSet __optional_isset = new BitSet(1);

    public Builder() {
    }

    public Builder setIndex_id(final int index_id) {
      this.index_id = index_id;
      __optional_isset.set(__INDEX_ID_ISSET_ID, true);
      return this;
    }

    public Builder setIndex_name(final byte[] index_name) {
      this.index_name = index_name;
      return this;
    }

    public Builder setSchema_id(final com.vesoft.nebula.SchemaID schema_id) {
      this.schema_id = schema_id;
      return this;
    }

    public Builder setSchema_name(final byte[] schema_name) {
      this.schema_name = schema_name;
      return this;
    }

    public Builder setFields(final List<ColumnDef> fields) {
      this.fields = fields;
      return this;
    }

    public Builder setComment(final byte[] comment) {
      this.comment = comment;
      return this;
    }

    public Builder setIndex_params(final IndexParams index_params) {
      this.index_params = index_params;
      return this;
    }

    public IndexItem build() {
      IndexItem result = new IndexItem();
      if (__optional_isset.get(__INDEX_ID_ISSET_ID)) {
        result.setIndex_id(this.index_id);
      }
      result.setIndex_name(this.index_name);
      result.setSchema_id(this.schema_id);
      result.setSchema_name(this.schema_name);
      result.setFields(this.fields);
      result.setComment(this.comment);
      result.setIndex_params(this.index_params);
      return result;
    }
  }

  public static Builder builder() {
    return new Builder();
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public IndexItem(IndexItem other) {
    __isset_bit_vector.clear();
    __isset_bit_vector.or(other.__isset_bit_vector);
    this.index_id = TBaseHelper.deepCopy(other.index_id);
    if (other.isSetIndex_name()) {
      this.index_name = TBaseHelper.deepCopy(other.index_name);
    }
    if (other.isSetSchema_id()) {
      this.schema_id = TBaseHelper.deepCopy(other.schema_id);
    }
    if (other.isSetSchema_name()) {
      this.schema_name = TBaseHelper.deepCopy(other.schema_name);
    }
    if (other.isSetFields()) {
      this.fields = TBaseHelper.deepCopy(other.fields);
    }
    if (other.isSetComment()) {
      this.comment = TBaseHelper.deepCopy(other.comment);
    }
    if (other.isSetIndex_params()) {
      this.index_params = TBaseHelper.deepCopy(other.index_params);
    }
  }

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

  public int getIndex_id() {
    return this.index_id;
  }

  public IndexItem setIndex_id(int index_id) {
    this.index_id = index_id;
    setIndex_idIsSet(true);
    return this;
  }

  public void unsetIndex_id() {
    __isset_bit_vector.clear(__INDEX_ID_ISSET_ID);
  }

  // Returns true if field index_id is set (has been assigned a value) and false otherwise
  public boolean isSetIndex_id() {
    return __isset_bit_vector.get(__INDEX_ID_ISSET_ID);
  }

  public void setIndex_idIsSet(boolean __value) {
    __isset_bit_vector.set(__INDEX_ID_ISSET_ID, __value);
  }

  public byte[] getIndex_name() {
    return this.index_name;
  }

  public IndexItem setIndex_name(byte[] index_name) {
    this.index_name = index_name;
    return this;
  }

  public void unsetIndex_name() {
    this.index_name = null;
  }

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

  public void setIndex_nameIsSet(boolean __value) {
    if (!__value) {
      this.index_name = null;
    }
  }

  public com.vesoft.nebula.SchemaID getSchema_id() {
    return this.schema_id;
  }

  public IndexItem setSchema_id(com.vesoft.nebula.SchemaID schema_id) {
    this.schema_id = schema_id;
    return this;
  }

  public void unsetSchema_id() {
    this.schema_id = null;
  }

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

  public void setSchema_idIsSet(boolean __value) {
    if (!__value) {
      this.schema_id = null;
    }
  }

  public byte[] getSchema_name() {
    return this.schema_name;
  }

  public IndexItem setSchema_name(byte[] schema_name) {
    this.schema_name = schema_name;
    return this;
  }

  public void unsetSchema_name() {
    this.schema_name = null;
  }

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

  public void setSchema_nameIsSet(boolean __value) {
    if (!__value) {
      this.schema_name = null;
    }
  }

  public List<ColumnDef> getFields() {
    return this.fields;
  }

  public IndexItem setFields(List<ColumnDef> fields) {
    this.fields = fields;
    return this;
  }

  public void unsetFields() {
    this.fields = null;
  }

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

  public void setFieldsIsSet(boolean __value) {
    if (!__value) {
      this.fields = null;
    }
  }

  public byte[] getComment() {
    return this.comment;
  }

  public IndexItem setComment(byte[] comment) {
    this.comment = comment;
    return this;
  }

  public void unsetComment() {
    this.comment = null;
  }

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

  public void setCommentIsSet(boolean __value) {
    if (!__value) {
      this.comment = null;
    }
  }

  public IndexParams getIndex_params() {
    return this.index_params;
  }

  public IndexItem setIndex_params(IndexParams index_params) {
    this.index_params = index_params;
    return this;
  }

  public void unsetIndex_params() {
    this.index_params = null;
  }

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

  public void setIndex_paramsIsSet(boolean __value) {
    if (!__value) {
      this.index_params = null;
    }
  }

  @SuppressWarnings("unchecked")
  public void setFieldValue(int fieldID, Object __value) {
    switch (fieldID) {
    case INDEX_ID:
      if (__value == null) {
        unsetIndex_id();
      } else {
        setIndex_id((Integer)__value);
      }
      break;

    case INDEX_NAME:
      if (__value == null) {
        unsetIndex_name();
      } else {
        setIndex_name((byte[])__value);
      }
      break;

    case SCHEMA_ID:
      if (__value == null) {
        unsetSchema_id();
      } else {
        setSchema_id((com.vesoft.nebula.SchemaID)__value);
      }
      break;

    case SCHEMA_NAME:
      if (__value == null) {
        unsetSchema_name();
      } else {
        setSchema_name((byte[])__value);
      }
      break;

    case FIELDS:
      if (__value == null) {
        unsetFields();
      } else {
        setFields((List<ColumnDef>)__value);
      }
      break;

    case COMMENT:
      if (__value == null) {
        unsetComment();
      } else {
        setComment((byte[])__value);
      }
      break;

    case INDEX_PARAMS:
      if (__value == null) {
        unsetIndex_params();
      } else {
        setIndex_params((IndexParams)__value);
      }
      break;

    default:
      throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
    }
  }

  public Object getFieldValue(int fieldID) {
    switch (fieldID) {
    case INDEX_ID:
      return new Integer(getIndex_id());

    case INDEX_NAME:
      return getIndex_name();

    case SCHEMA_ID:
      return getSchema_id();

    case SCHEMA_NAME:
      return getSchema_name();

    case FIELDS:
      return getFields();

    case COMMENT:
      return getComment();

    case INDEX_PARAMS:
      return getIndex_params();

    default:
      throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
    }
  }

  @Override
  public boolean equals(Object _that) {
    if (_that == null)
      return false;
    if (this == _that)
      return true;
    if (!(_that instanceof IndexItem))
      return false;
    IndexItem that = (IndexItem)_that;

    if (!TBaseHelper.equalsNobinary(this.index_id, that.index_id)) { return false; }

    if (!TBaseHelper.equalsSlow(this.isSetIndex_name(), that.isSetIndex_name(), this.index_name, that.index_name)) { return false; }

    if (!TBaseHelper.equalsNobinary(this.isSetSchema_id(), that.isSetSchema_id(), this.schema_id, that.schema_id)) { return false; }

    if (!TBaseHelper.equalsSlow(this.isSetSchema_name(), that.isSetSchema_name(), this.schema_name, that.schema_name)) { return false; }

    if (!TBaseHelper.equalsNobinary(this.isSetFields(), that.isSetFields(), this.fields, that.fields)) { return false; }

    if (!TBaseHelper.equalsSlow(this.isSetComment(), that.isSetComment(), this.comment, that.comment)) { return false; }

    if (!TBaseHelper.equalsNobinary(this.isSetIndex_params(), that.isSetIndex_params(), this.index_params, that.index_params)) { return false; }

    return true;
  }

  @Override
  public int hashCode() {
    return Arrays.deepHashCode(new Object[] {index_id, index_name, schema_id, schema_name, fields, comment, index_params});
  }

  @Override
  public int compareTo(IndexItem other) {
    if (other == null) {
      // See java.lang.Comparable docs
      throw new NullPointerException();
    }

    if (other == this) {
      return 0;
    }
    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetIndex_id()).compareTo(other.isSetIndex_id());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(index_id, other.index_id);
    if (lastComparison != 0) { 
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetIndex_name()).compareTo(other.isSetIndex_name());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(index_name, other.index_name);
    if (lastComparison != 0) { 
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetSchema_id()).compareTo(other.isSetSchema_id());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(schema_id, other.schema_id);
    if (lastComparison != 0) { 
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetSchema_name()).compareTo(other.isSetSchema_name());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(schema_name, other.schema_name);
    if (lastComparison != 0) { 
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetFields()).compareTo(other.isSetFields());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(fields, other.fields);
    if (lastComparison != 0) { 
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetComment()).compareTo(other.isSetComment());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(comment, other.comment);
    if (lastComparison != 0) { 
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetIndex_params()).compareTo(other.isSetIndex_params());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(index_params, other.index_params);
    if (lastComparison != 0) { 
      return lastComparison;
    }
    return 0;
  }

  public void read(TProtocol iprot) throws TException {
    TField __field;
    iprot.readStructBegin(metaDataMap);
    while (true)
    {
      __field = iprot.readFieldBegin();
      if (__field.type == TType.STOP) { 
        break;
      }
      switch (__field.id)
      {
        case INDEX_ID:
          if (__field.type == TType.I32) {
            this.index_id = iprot.readI32();
            setIndex_idIsSet(true);
          } else { 
            TProtocolUtil.skip(iprot, __field.type);
          }
          break;
        case INDEX_NAME:
          if (__field.type == TType.STRING) {
            this.index_name = iprot.readBinary();
          } else { 
            TProtocolUtil.skip(iprot, __field.type);
          }
          break;
        case SCHEMA_ID:
          if (__field.type == TType.STRUCT) {
            this.schema_id = new com.vesoft.nebula.SchemaID();
            this.schema_id.read(iprot);
          } else { 
            TProtocolUtil.skip(iprot, __field.type);
          }
          break;
        case SCHEMA_NAME:
          if (__field.type == TType.STRING) {
            this.schema_name = iprot.readBinary();
          } else { 
            TProtocolUtil.skip(iprot, __field.type);
          }
          break;
        case FIELDS:
          if (__field.type == TType.LIST) {
            {
              TList _list8 = iprot.readListBegin();
              this.fields = new ArrayList<ColumnDef>(Math.max(0, _list8.size));
              for (int _i9 = 0; 
                   (_list8.size < 0) ? iprot.peekList() : (_i9 < _list8.size); 
                   ++_i9)
              {
                ColumnDef _elem10;
                _elem10 = new ColumnDef();
                _elem10.read(iprot);
                this.fields.add(_elem10);
              }
              iprot.readListEnd();
            }
          } else { 
            TProtocolUtil.skip(iprot, __field.type);
          }
          break;
        case COMMENT:
          if (__field.type == TType.STRING) {
            this.comment = iprot.readBinary();
          } else { 
            TProtocolUtil.skip(iprot, __field.type);
          }
          break;
        case INDEX_PARAMS:
          if (__field.type == TType.STRUCT) {
            this.index_params = new IndexParams();
            this.index_params.read(iprot);
          } else { 
            TProtocolUtil.skip(iprot, __field.type);
          }
          break;
        default:
          TProtocolUtil.skip(iprot, __field.type);
          break;
      }
      iprot.readFieldEnd();
    }
    iprot.readStructEnd();


    // check for required fields of primitive type, which can't be checked in the validate method
    validate();
  }

  public void write(TProtocol oprot) throws TException {
    validate();

    oprot.writeStructBegin(STRUCT_DESC);
    oprot.writeFieldBegin(INDEX_ID_FIELD_DESC);
    oprot.writeI32(this.index_id);
    oprot.writeFieldEnd();
    if (this.index_name != null) {
      oprot.writeFieldBegin(INDEX_NAME_FIELD_DESC);
      oprot.writeBinary(this.index_name);
      oprot.writeFieldEnd();
    }
    if (this.schema_id != null) {
      oprot.writeFieldBegin(SCHEMA_ID_FIELD_DESC);
      this.schema_id.write(oprot);
      oprot.writeFieldEnd();
    }
    if (this.schema_name != null) {
      oprot.writeFieldBegin(SCHEMA_NAME_FIELD_DESC);
      oprot.writeBinary(this.schema_name);
      oprot.writeFieldEnd();
    }
    if (this.fields != null) {
      oprot.writeFieldBegin(FIELDS_FIELD_DESC);
      {
        oprot.writeListBegin(new TList(TType.STRUCT, this.fields.size()));
        for (ColumnDef _iter11 : this.fields)        {
          _iter11.write(oprot);
        }
        oprot.writeListEnd();
      }
      oprot.writeFieldEnd();
    }
    if (this.comment != null) {
      if (isSetComment()) {
        oprot.writeFieldBegin(COMMENT_FIELD_DESC);
        oprot.writeBinary(this.comment);
        oprot.writeFieldEnd();
      }
    }
    if (this.index_params != null) {
      if (isSetIndex_params()) {
        oprot.writeFieldBegin(INDEX_PARAMS_FIELD_DESC);
        this.index_params.write(oprot);
        oprot.writeFieldEnd();
      }
    }
    oprot.writeFieldStop();
    oprot.writeStructEnd();
  }

  @Override
  public String toString() {
    return toString(1, true);
  }

  @Override
  public String toString(int indent, boolean prettyPrint) {
    String indentStr = prettyPrint ? TBaseHelper.getIndentedString(indent) : "";
    String newLine = prettyPrint ? "\n" : "";
    String space = prettyPrint ? " " : "";
    StringBuilder sb = new StringBuilder("IndexItem");
    sb.append(space);
    sb.append("(");
    sb.append(newLine);
    boolean first = true;

    sb.append(indentStr);
    sb.append("index_id");
    sb.append(space);
    sb.append(":").append(space);
    sb.append(TBaseHelper.toString(this.getIndex_id(), indent + 1, prettyPrint));
    first = false;
    if (!first) sb.append("," + newLine);
    sb.append(indentStr);
    sb.append("index_name");
    sb.append(space);
    sb.append(":").append(space);
    if (this.getIndex_name() == null) {
      sb.append("null");
    } else {
        int __index_name_size = Math.min(this.getIndex_name().length, 128);
        for (int i = 0; i < __index_name_size; i++) {
          if (i != 0) sb.append(" ");
          sb.append(Integer.toHexString(this.getIndex_name()[i]).length() > 1 ? Integer.toHexString(this.getIndex_name()[i]).substring(Integer.toHexString(this.getIndex_name()[i]).length() - 2).toUpperCase() : "0" + Integer.toHexString(this.getIndex_name()[i]).toUpperCase());
        }
        if (this.getIndex_name().length > 128) sb.append(" ...");
    }
    first = false;
    if (!first) sb.append("," + newLine);
    sb.append(indentStr);
    sb.append("schema_id");
    sb.append(space);
    sb.append(":").append(space);
    if (this.getSchema_id() == null) {
      sb.append("null");
    } else {
      sb.append(TBaseHelper.toString(this.getSchema_id(), indent + 1, prettyPrint));
    }
    first = false;
    if (!first) sb.append("," + newLine);
    sb.append(indentStr);
    sb.append("schema_name");
    sb.append(space);
    sb.append(":").append(space);
    if (this.getSchema_name() == null) {
      sb.append("null");
    } else {
        int __schema_name_size = Math.min(this.getSchema_name().length, 128);
        for (int i = 0; i < __schema_name_size; i++) {
          if (i != 0) sb.append(" ");
          sb.append(Integer.toHexString(this.getSchema_name()[i]).length() > 1 ? Integer.toHexString(this.getSchema_name()[i]).substring(Integer.toHexString(this.getSchema_name()[i]).length() - 2).toUpperCase() : "0" + Integer.toHexString(this.getSchema_name()[i]).toUpperCase());
        }
        if (this.getSchema_name().length > 128) sb.append(" ...");
    }
    first = false;
    if (!first) sb.append("," + newLine);
    sb.append(indentStr);
    sb.append("fields");
    sb.append(space);
    sb.append(":").append(space);
    if (this.getFields() == null) {
      sb.append("null");
    } else {
      sb.append(TBaseHelper.toString(this.getFields(), indent + 1, prettyPrint));
    }
    first = false;
    if (isSetComment())
    {
      if (!first) sb.append("," + newLine);
      sb.append(indentStr);
      sb.append("comment");
      sb.append(space);
      sb.append(":").append(space);
      if (this.getComment() == null) {
        sb.append("null");
      } else {
          int __comment_size = Math.min(this.getComment().length, 128);
          for (int i = 0; i < __comment_size; i++) {
            if (i != 0) sb.append(" ");
            sb.append(Integer.toHexString(this.getComment()[i]).length() > 1 ? Integer.toHexString(this.getComment()[i]).substring(Integer.toHexString(this.getComment()[i]).length() - 2).toUpperCase() : "0" + Integer.toHexString(this.getComment()[i]).toUpperCase());
          }
          if (this.getComment().length > 128) sb.append(" ...");
      }
      first = false;
    }
    if (isSetIndex_params())
    {
      if (!first) sb.append("," + newLine);
      sb.append(indentStr);
      sb.append("index_params");
      sb.append(space);
      sb.append(":").append(space);
      if (this.getIndex_params() == null) {
        sb.append("null");
      } else {
        sb.append(TBaseHelper.toString(this.getIndex_params(), indent + 1, prettyPrint));
      }
      first = false;
    }
    sb.append(newLine + TBaseHelper.reduceIndent(indentStr));
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws TException {
    // check for required fields
  }

}

