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

io.snappydata.thrift.OpenConnectionArgs 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 = "2018-12-10")
public class OpenConnectionArgs 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("OpenConnectionArgs");

  private static final org.apache.thrift.protocol.TField CLIENT_HOST_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("clientHostName", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField CLIENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("clientID", org.apache.thrift.protocol.TType.STRING, (short)2);
  private static final org.apache.thrift.protocol.TField SECURITY_FIELD_DESC = new org.apache.thrift.protocol.TField("security", org.apache.thrift.protocol.TType.I32, (short)3);
  private static final org.apache.thrift.protocol.TField USER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("userName", org.apache.thrift.protocol.TType.STRING, (short)4);
  private static final org.apache.thrift.protocol.TField PASSWORD_FIELD_DESC = new org.apache.thrift.protocol.TField("password", org.apache.thrift.protocol.TType.STRING, (short)5);
  private static final org.apache.thrift.protocol.TField FOR_XA_FIELD_DESC = new org.apache.thrift.protocol.TField("forXA", org.apache.thrift.protocol.TType.BOOL, (short)6);
  private static final org.apache.thrift.protocol.TField TOKEN_SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("tokenSize", org.apache.thrift.protocol.TType.I32, (short)7);
  private static final org.apache.thrift.protocol.TField USE_STRING_FOR_DECIMAL_FIELD_DESC = new org.apache.thrift.protocol.TField("useStringForDecimal", org.apache.thrift.protocol.TType.BOOL, (short)8);
  private static final org.apache.thrift.protocol.TField PROPERTIES_FIELD_DESC = new org.apache.thrift.protocol.TField("properties", org.apache.thrift.protocol.TType.MAP, (short)9);

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

  public String clientHostName; // required
  public String clientID; // required
  /**
   * 
   * @see SecurityMechanism
   */
  public SecurityMechanism security; // required
  public String userName; // optional
  public String password; // optional
  public boolean forXA; // optional
  public int tokenSize; // optional
  public boolean useStringForDecimal; // optional
  public Map properties; // 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 {
    CLIENT_HOST_NAME((short)1, "clientHostName"),
    CLIENT_ID((short)2, "clientID"),
    /**
     * 
     * @see SecurityMechanism
     */
    SECURITY((short)3, "security"),
    USER_NAME((short)4, "userName"),
    PASSWORD((short)5, "password"),
    FOR_XA((short)6, "forXA"),
    TOKEN_SIZE((short)7, "tokenSize"),
    USE_STRING_FOR_DECIMAL((short)8, "useStringForDecimal"),
    PROPERTIES((short)9, "properties");

    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: // CLIENT_HOST_NAME
          return CLIENT_HOST_NAME;
        case 2: // CLIENT_ID
          return CLIENT_ID;
        case 3: // SECURITY
          return SECURITY;
        case 4: // USER_NAME
          return USER_NAME;
        case 5: // PASSWORD
          return PASSWORD;
        case 6: // FOR_XA
          return FOR_XA;
        case 7: // TOKEN_SIZE
          return TOKEN_SIZE;
        case 8: // USE_STRING_FOR_DECIMAL
          return USE_STRING_FOR_DECIMAL;
        case 9: // PROPERTIES
          return PROPERTIES;
        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 __FORXA_ISSET_ID = 0;
  private static final int __TOKENSIZE_ISSET_ID = 1;
  private static final int __USESTRINGFORDECIMAL_ISSET_ID = 2;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.USER_NAME,_Fields.PASSWORD,_Fields.FOR_XA,_Fields.TOKEN_SIZE,_Fields.USE_STRING_FOR_DECIMAL,_Fields.PROPERTIES};
  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.CLIENT_HOST_NAME, new org.apache.thrift.meta_data.FieldMetaData("clientHostName", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.CLIENT_ID, new org.apache.thrift.meta_data.FieldMetaData("clientID", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.SECURITY, new org.apache.thrift.meta_data.FieldMetaData("security", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, SecurityMechanism.class)));
    tmpMap.put(_Fields.USER_NAME, new org.apache.thrift.meta_data.FieldMetaData("userName", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.PASSWORD, new org.apache.thrift.meta_data.FieldMetaData("password", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.FOR_XA, new org.apache.thrift.meta_data.FieldMetaData("forXA", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.TOKEN_SIZE, new org.apache.thrift.meta_data.FieldMetaData("tokenSize", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.USE_STRING_FOR_DECIMAL, new org.apache.thrift.meta_data.FieldMetaData("useStringForDecimal", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.PROPERTIES, new org.apache.thrift.meta_data.FieldMetaData("properties", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(OpenConnectionArgs.class, metaDataMap);
  }

  public OpenConnectionArgs() {
  }

  public OpenConnectionArgs(
    String clientHostName,
    String clientID,
    SecurityMechanism security)
  {
    this();
    this.clientHostName = clientHostName;
    this.clientID = clientID;
    this.security = security;
  }

  /**
   * Performs a deep copy on other.
   */
  public OpenConnectionArgs(OpenConnectionArgs other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetClientHostName()) {
      this.clientHostName = other.clientHostName;
    }
    if (other.isSetClientID()) {
      this.clientID = other.clientID;
    }
    if (other.isSetSecurity()) {
      this.security = other.security;
    }
    if (other.isSetUserName()) {
      this.userName = other.userName;
    }
    if (other.isSetPassword()) {
      this.password = other.password;
    }
    this.forXA = other.forXA;
    this.tokenSize = other.tokenSize;
    this.useStringForDecimal = other.useStringForDecimal;
    if (other.isSetProperties()) {
      Map __this__properties = new HashMap(other.properties);
      this.properties = __this__properties;
    }
  }

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

  @Override
  public void clear() {
    this.clientHostName = null;
    this.clientID = null;
    this.security = null;
    this.userName = null;
    this.password = null;
    setForXAIsSet(false);
    this.forXA = false;
    setTokenSizeIsSet(false);
    this.tokenSize = 0;
    setUseStringForDecimalIsSet(false);
    this.useStringForDecimal = false;
    this.properties = null;
  }

  public String getClientHostName() {
    return this.clientHostName;
  }

  public OpenConnectionArgs setClientHostName(String clientHostName) {
    this.clientHostName = clientHostName;
    return this;
  }

  public void unsetClientHostName() {
    this.clientHostName = null;
  }

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

  public void setClientHostNameIsSet(boolean value) {
    if (!value) {
      this.clientHostName = null;
    }
  }

  public String getClientID() {
    return this.clientID;
  }

  public OpenConnectionArgs setClientID(String clientID) {
    this.clientID = clientID;
    return this;
  }

  public void unsetClientID() {
    this.clientID = null;
  }

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

  public void setClientIDIsSet(boolean value) {
    if (!value) {
      this.clientID = null;
    }
  }

  /**
   * 
   * @see SecurityMechanism
   */
  public SecurityMechanism getSecurity() {
    return this.security;
  }

  /**
   * 
   * @see SecurityMechanism
   */
  public OpenConnectionArgs setSecurity(SecurityMechanism security) {
    this.security = security;
    return this;
  }

  public void unsetSecurity() {
    this.security = null;
  }

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

  public void setSecurityIsSet(boolean value) {
    if (!value) {
      this.security = null;
    }
  }

  public String getUserName() {
    return this.userName;
  }

  public OpenConnectionArgs setUserName(String userName) {
    this.userName = userName;
    return this;
  }

  public void unsetUserName() {
    this.userName = null;
  }

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

  public void setUserNameIsSet(boolean value) {
    if (!value) {
      this.userName = null;
    }
  }

  public String getPassword() {
    return this.password;
  }

  public OpenConnectionArgs setPassword(String password) {
    this.password = password;
    return this;
  }

  public void unsetPassword() {
    this.password = null;
  }

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

  public void setPasswordIsSet(boolean value) {
    if (!value) {
      this.password = null;
    }
  }

  public boolean isForXA() {
    return this.forXA;
  }

  public OpenConnectionArgs setForXA(boolean forXA) {
    this.forXA = forXA;
    setForXAIsSet(true);
    return this;
  }

  public void unsetForXA() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FORXA_ISSET_ID);
  }

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

  public void setForXAIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FORXA_ISSET_ID, value);
  }

  public int getTokenSize() {
    return this.tokenSize;
  }

  public OpenConnectionArgs setTokenSize(int tokenSize) {
    this.tokenSize = tokenSize;
    setTokenSizeIsSet(true);
    return this;
  }

  public void unsetTokenSize() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TOKENSIZE_ISSET_ID);
  }

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

  public void setTokenSizeIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TOKENSIZE_ISSET_ID, value);
  }

  public boolean isUseStringForDecimal() {
    return this.useStringForDecimal;
  }

  public OpenConnectionArgs setUseStringForDecimal(boolean useStringForDecimal) {
    this.useStringForDecimal = useStringForDecimal;
    setUseStringForDecimalIsSet(true);
    return this;
  }

  public void unsetUseStringForDecimal() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __USESTRINGFORDECIMAL_ISSET_ID);
  }

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

  public void setUseStringForDecimalIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __USESTRINGFORDECIMAL_ISSET_ID, value);
  }

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

  public void putToProperties(String key, String val) {
    if (this.properties == null) {
      this.properties = new HashMap();
    }
    this.properties.put(key, val);
  }

  public Map getProperties() {
    return this.properties;
  }

  public OpenConnectionArgs setProperties(Map properties) {
    this.properties = properties;
    return this;
  }

  public void unsetProperties() {
    this.properties = null;
  }

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

  public void setPropertiesIsSet(boolean value) {
    if (!value) {
      this.properties = null;
    }
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case CLIENT_HOST_NAME:
      if (value == null) {
        unsetClientHostName();
      } else {
        setClientHostName((String)value);
      }
      break;

    case CLIENT_ID:
      if (value == null) {
        unsetClientID();
      } else {
        setClientID((String)value);
      }
      break;

    case SECURITY:
      if (value == null) {
        unsetSecurity();
      } else {
        setSecurity((SecurityMechanism)value);
      }
      break;

    case USER_NAME:
      if (value == null) {
        unsetUserName();
      } else {
        setUserName((String)value);
      }
      break;

    case PASSWORD:
      if (value == null) {
        unsetPassword();
      } else {
        setPassword((String)value);
      }
      break;

    case FOR_XA:
      if (value == null) {
        unsetForXA();
      } else {
        setForXA((Boolean)value);
      }
      break;

    case TOKEN_SIZE:
      if (value == null) {
        unsetTokenSize();
      } else {
        setTokenSize((Integer)value);
      }
      break;

    case USE_STRING_FOR_DECIMAL:
      if (value == null) {
        unsetUseStringForDecimal();
      } else {
        setUseStringForDecimal((Boolean)value);
      }
      break;

    case PROPERTIES:
      if (value == null) {
        unsetProperties();
      } else {
        setProperties((Map)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case CLIENT_HOST_NAME:
      return getClientHostName();

    case CLIENT_ID:
      return getClientID();

    case SECURITY:
      return getSecurity();

    case USER_NAME:
      return getUserName();

    case PASSWORD:
      return getPassword();

    case FOR_XA:
      return isForXA();

    case TOKEN_SIZE:
      return getTokenSize();

    case USE_STRING_FOR_DECIMAL:
      return isUseStringForDecimal();

    case PROPERTIES:
      return getProperties();

    }
    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 CLIENT_HOST_NAME:
      return isSetClientHostName();
    case CLIENT_ID:
      return isSetClientID();
    case SECURITY:
      return isSetSecurity();
    case USER_NAME:
      return isSetUserName();
    case PASSWORD:
      return isSetPassword();
    case FOR_XA:
      return isSetForXA();
    case TOKEN_SIZE:
      return isSetTokenSize();
    case USE_STRING_FOR_DECIMAL:
      return isSetUseStringForDecimal();
    case PROPERTIES:
      return isSetProperties();
    }
    throw new IllegalStateException();
  }

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

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

    boolean this_present_clientHostName = true && this.isSetClientHostName();
    boolean that_present_clientHostName = true && that.isSetClientHostName();
    if (this_present_clientHostName || that_present_clientHostName) {
      if (!(this_present_clientHostName && that_present_clientHostName))
        return false;
      if (!this.clientHostName.equals(that.clientHostName))
        return false;
    }

    boolean this_present_clientID = true && this.isSetClientID();
    boolean that_present_clientID = true && that.isSetClientID();
    if (this_present_clientID || that_present_clientID) {
      if (!(this_present_clientID && that_present_clientID))
        return false;
      if (!this.clientID.equals(that.clientID))
        return false;
    }

    boolean this_present_security = true && this.isSetSecurity();
    boolean that_present_security = true && that.isSetSecurity();
    if (this_present_security || that_present_security) {
      if (!(this_present_security && that_present_security))
        return false;
      if (!this.security.equals(that.security))
        return false;
    }

    boolean this_present_userName = true && this.isSetUserName();
    boolean that_present_userName = true && that.isSetUserName();
    if (this_present_userName || that_present_userName) {
      if (!(this_present_userName && that_present_userName))
        return false;
      if (!this.userName.equals(that.userName))
        return false;
    }

    boolean this_present_password = true && this.isSetPassword();
    boolean that_present_password = true && that.isSetPassword();
    if (this_present_password || that_present_password) {
      if (!(this_present_password && that_present_password))
        return false;
      if (!this.password.equals(that.password))
        return false;
    }

    boolean this_present_forXA = true && this.isSetForXA();
    boolean that_present_forXA = true && that.isSetForXA();
    if (this_present_forXA || that_present_forXA) {
      if (!(this_present_forXA && that_present_forXA))
        return false;
      if (this.forXA != that.forXA)
        return false;
    }

    boolean this_present_tokenSize = true && this.isSetTokenSize();
    boolean that_present_tokenSize = true && that.isSetTokenSize();
    if (this_present_tokenSize || that_present_tokenSize) {
      if (!(this_present_tokenSize && that_present_tokenSize))
        return false;
      if (this.tokenSize != that.tokenSize)
        return false;
    }

    boolean this_present_useStringForDecimal = true && this.isSetUseStringForDecimal();
    boolean that_present_useStringForDecimal = true && that.isSetUseStringForDecimal();
    if (this_present_useStringForDecimal || that_present_useStringForDecimal) {
      if (!(this_present_useStringForDecimal && that_present_useStringForDecimal))
        return false;
      if (this.useStringForDecimal != that.useStringForDecimal)
        return false;
    }

    boolean this_present_properties = true && this.isSetProperties();
    boolean that_present_properties = true && that.isSetProperties();
    if (this_present_properties || that_present_properties) {
      if (!(this_present_properties && that_present_properties))
        return false;
      if (!this.properties.equals(that.properties))
        return false;
    }

    return true;
  }

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

    boolean present_clientHostName = true && (isSetClientHostName());
    list.add(present_clientHostName);
    if (present_clientHostName)
      list.add(clientHostName);

    boolean present_clientID = true && (isSetClientID());
    list.add(present_clientID);
    if (present_clientID)
      list.add(clientID);

    boolean present_security = true && (isSetSecurity());
    list.add(present_security);
    if (present_security)
      list.add(security.getValue());

    boolean present_userName = true && (isSetUserName());
    list.add(present_userName);
    if (present_userName)
      list.add(userName);

    boolean present_password = true && (isSetPassword());
    list.add(present_password);
    if (present_password)
      list.add(password);

    boolean present_forXA = true && (isSetForXA());
    list.add(present_forXA);
    if (present_forXA)
      list.add(forXA);

    boolean present_tokenSize = true && (isSetTokenSize());
    list.add(present_tokenSize);
    if (present_tokenSize)
      list.add(tokenSize);

    boolean present_useStringForDecimal = true && (isSetUseStringForDecimal());
    list.add(present_useStringForDecimal);
    if (present_useStringForDecimal)
      list.add(useStringForDecimal);

    boolean present_properties = true && (isSetProperties());
    list.add(present_properties);
    if (present_properties)
      list.add(properties);

    return list.hashCode();
  }

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

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetClientHostName()).compareTo(other.isSetClientHostName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetClientHostName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.clientHostName, other.clientHostName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetClientID()).compareTo(other.isSetClientID());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetClientID()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.clientID, other.clientID);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSecurity()).compareTo(other.isSetSecurity());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSecurity()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.security, other.security);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetUserName()).compareTo(other.isSetUserName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUserName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userName, other.userName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetPassword()).compareTo(other.isSetPassword());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPassword()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.password, other.password);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetForXA()).compareTo(other.isSetForXA());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetForXA()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.forXA, other.forXA);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTokenSize()).compareTo(other.isSetTokenSize());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTokenSize()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tokenSize, other.tokenSize);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetUseStringForDecimal()).compareTo(other.isSetUseStringForDecimal());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUseStringForDecimal()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.useStringForDecimal, other.useStringForDecimal);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetProperties()).compareTo(other.isSetProperties());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetProperties()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.properties, other.properties);
      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("OpenConnectionArgs(");
    boolean first = true;

    sb.append("clientHostName:");
    if (this.clientHostName == null) {
      sb.append("null");
    } else {
      sb.append(this.clientHostName);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("clientID:");
    if (this.clientID == null) {
      sb.append("null");
    } else {
      sb.append(this.clientID);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("security:");
    if (this.security == null) {
      sb.append("null");
    } else {
      sb.append(this.security);
    }
    first = false;
    if (isSetUserName()) {
      if (!first) sb.append(", ");
      sb.append("userName:");
      if (this.userName == null) {
        sb.append("null");
      } else {
        sb.append(this.userName);
      }
      first = false;
    }
    if (isSetPassword()) {
      if (!first) sb.append(", ");
      sb.append("password:");
      if (this.password == null) {
        sb.append("null");
      } else {
        sb.append(this.password);
      }
      first = false;
    }
    if (isSetForXA()) {
      if (!first) sb.append(", ");
      sb.append("forXA:");
      sb.append(this.forXA);
      first = false;
    }
    if (isSetTokenSize()) {
      if (!first) sb.append(", ");
      sb.append("tokenSize:");
      sb.append(this.tokenSize);
      first = false;
    }
    if (isSetUseStringForDecimal()) {
      if (!first) sb.append(", ");
      sb.append("useStringForDecimal:");
      sb.append(this.useStringForDecimal);
      first = false;
    }
    if (isSetProperties()) {
      if (!first) sb.append(", ");
      sb.append("properties:");
      if (this.properties == null) {
        sb.append("null");
      } else {
        sb.append(this.properties);
      }
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    if (clientHostName == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'clientHostName' was not present! Struct: " + toString());
    }
    if (clientID == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'clientID' was not present! Struct: " + toString());
    }
    if (security == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'security' was not present! Struct: " + toString());
    }
    // 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 OpenConnectionArgsStandardSchemeFactory implements SchemeFactory {
    public OpenConnectionArgsStandardScheme getScheme() {
      return new OpenConnectionArgsStandardScheme();
    }
  }

  private static class OpenConnectionArgsStandardScheme extends StandardScheme {

    public void read(org.apache.thrift.protocol.TProtocol iprot, OpenConnectionArgs 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: // CLIENT_HOST_NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.clientHostName = iprot.readString();
              struct.setClientHostNameIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // CLIENT_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.clientID = iprot.readString();
              struct.setClientIDIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // SECURITY
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.security = io.snappydata.thrift.SecurityMechanism.findByValue(iprot.readI32());
              struct.setSecurityIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // USER_NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.userName = iprot.readString();
              struct.setUserNameIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // PASSWORD
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.password = iprot.readString();
              struct.setPasswordIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // FOR_XA
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.forXA = iprot.readBool();
              struct.setForXAIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // TOKEN_SIZE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.tokenSize = iprot.readI32();
              struct.setTokenSizeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // USE_STRING_FOR_DECIMAL
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.useStringForDecimal = iprot.readBool();
              struct.setUseStringForDecimalIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 9: // PROPERTIES
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map102 = iprot.readMapBegin();
                struct.properties = new HashMap(2*_map102.size);
                String _key103;
                String _val104;
                for (int _i105 = 0; _i105 < _map102.size; ++_i105)
                {
                  _key103 = iprot.readString();
                  _val104 = iprot.readString();
                  struct.properties.put(_key103, _val104);
                }
                iprot.readMapEnd();
              }
              struct.setPropertiesIsSet(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, OpenConnectionArgs struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.clientHostName != null) {
        oprot.writeFieldBegin(CLIENT_HOST_NAME_FIELD_DESC);
        oprot.writeString(struct.clientHostName);
        oprot.writeFieldEnd();
      }
      if (struct.clientID != null) {
        oprot.writeFieldBegin(CLIENT_ID_FIELD_DESC);
        oprot.writeString(struct.clientID);
        oprot.writeFieldEnd();
      }
      if (struct.security != null) {
        oprot.writeFieldBegin(SECURITY_FIELD_DESC);
        oprot.writeI32(struct.security.getValue());
        oprot.writeFieldEnd();
      }
      if (struct.userName != null) {
        if (struct.isSetUserName()) {
          oprot.writeFieldBegin(USER_NAME_FIELD_DESC);
          oprot.writeString(struct.userName);
          oprot.writeFieldEnd();
        }
      }
      if (struct.password != null) {
        if (struct.isSetPassword()) {
          oprot.writeFieldBegin(PASSWORD_FIELD_DESC);
          oprot.writeString(struct.password);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetForXA()) {
        oprot.writeFieldBegin(FOR_XA_FIELD_DESC);
        oprot.writeBool(struct.forXA);
        oprot.writeFieldEnd();
      }
      if (struct.isSetTokenSize()) {
        oprot.writeFieldBegin(TOKEN_SIZE_FIELD_DESC);
        oprot.writeI32(struct.tokenSize);
        oprot.writeFieldEnd();
      }
      if (struct.isSetUseStringForDecimal()) {
        oprot.writeFieldBegin(USE_STRING_FOR_DECIMAL_FIELD_DESC);
        oprot.writeBool(struct.useStringForDecimal);
        oprot.writeFieldEnd();
      }
      if (struct.properties != null) {
        if (struct.isSetProperties()) {
          oprot.writeFieldBegin(PROPERTIES_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.properties.size()));
            for (Map.Entry _iter106 : struct.properties.entrySet())
            {
              oprot.writeString(_iter106.getKey());
              oprot.writeString(_iter106.getValue());
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class OpenConnectionArgsTupleSchemeFactory implements SchemeFactory {
    public OpenConnectionArgsTupleScheme getScheme() {
      return new OpenConnectionArgsTupleScheme();
    }
  }

  private static class OpenConnectionArgsTupleScheme extends TupleScheme {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, OpenConnectionArgs struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      oprot.writeString(struct.clientHostName);
      oprot.writeString(struct.clientID);
      oprot.writeI32(struct.security.getValue());
      BitSet optionals = new BitSet();
      if (struct.isSetUserName()) {
        optionals.set(0);
      }
      if (struct.isSetPassword()) {
        optionals.set(1);
      }
      if (struct.isSetForXA()) {
        optionals.set(2);
      }
      if (struct.isSetTokenSize()) {
        optionals.set(3);
      }
      if (struct.isSetUseStringForDecimal()) {
        optionals.set(4);
      }
      if (struct.isSetProperties()) {
        optionals.set(5);
      }
      oprot.writeBitSet(optionals, 6);
      if (struct.isSetUserName()) {
        oprot.writeString(struct.userName);
      }
      if (struct.isSetPassword()) {
        oprot.writeString(struct.password);
      }
      if (struct.isSetForXA()) {
        oprot.writeBool(struct.forXA);
      }
      if (struct.isSetTokenSize()) {
        oprot.writeI32(struct.tokenSize);
      }
      if (struct.isSetUseStringForDecimal()) {
        oprot.writeBool(struct.useStringForDecimal);
      }
      if (struct.isSetProperties()) {
        {
          oprot.writeI32(struct.properties.size());
          for (Map.Entry _iter107 : struct.properties.entrySet())
          {
            oprot.writeString(_iter107.getKey());
            oprot.writeString(_iter107.getValue());
          }
        }
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, OpenConnectionArgs struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      struct.clientHostName = iprot.readString();
      struct.setClientHostNameIsSet(true);
      struct.clientID = iprot.readString();
      struct.setClientIDIsSet(true);
      struct.security = io.snappydata.thrift.SecurityMechanism.findByValue(iprot.readI32());
      struct.setSecurityIsSet(true);
      BitSet incoming = iprot.readBitSet(6);
      if (incoming.get(0)) {
        struct.userName = iprot.readString();
        struct.setUserNameIsSet(true);
      }
      if (incoming.get(1)) {
        struct.password = iprot.readString();
        struct.setPasswordIsSet(true);
      }
      if (incoming.get(2)) {
        struct.forXA = iprot.readBool();
        struct.setForXAIsSet(true);
      }
      if (incoming.get(3)) {
        struct.tokenSize = iprot.readI32();
        struct.setTokenSizeIsSet(true);
      }
      if (incoming.get(4)) {
        struct.useStringForDecimal = iprot.readBool();
        struct.setUseStringForDecimalIsSet(true);
      }
      if (incoming.get(5)) {
        {
          org.apache.thrift.protocol.TMap _map108 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.properties = new HashMap(2*_map108.size);
          String _key109;
          String _val110;
          for (int _i111 = 0; _i111 < _map108.size; ++_i111)
          {
            _key109 = iprot.readString();
            _val110 = iprot.readString();
            struct.properties.put(_key109, _val110);
          }
        }
        struct.setPropertiesIsSet(true);
      }
    }
  }

}