Subversion Repositories SmartDukaan

Rev

Blame | Last modification | View Log | RSS feed

/**
 * Autogenerated by Thrift Compiler (0.7.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 */
package in.shop2020.utils;

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 org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class DealerAuth implements org.apache.thrift.TBase<DealerAuth, DealerAuth._Fields>, java.io.Serializable, Cloneable {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("DealerAuth");

  private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)1);
  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)2);
  private static final org.apache.thrift.protocol.TField ROLE_FIELD_DESC = new org.apache.thrift.protocol.TField("role", org.apache.thrift.protocol.TType.I32, (short)3);
  private static final org.apache.thrift.protocol.TField CREATED_ON_FIELD_DESC = new org.apache.thrift.protocol.TField("createdOn", org.apache.thrift.protocol.TType.I64, (short)4);
  private static final org.apache.thrift.protocol.TField LAST_LOGGED_IN_FIELD_DESC = new org.apache.thrift.protocol.TField("lastLoggedIn", org.apache.thrift.protocol.TType.I64, (short)5);
  private static final org.apache.thrift.protocol.TField LAST_LOCATION_FIELD_DESC = new org.apache.thrift.protocol.TField("lastLocation", org.apache.thrift.protocol.TType.STRUCT, (short)6);
  private static final org.apache.thrift.protocol.TField IS_ACTIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("isActive", org.apache.thrift.protocol.TType.BOOL, (short)7);

  private String username; // required
  private String password; // required
  private DealerAuthRole role; // required
  private long createdOn; // required
  private long lastLoggedIn; // required
  private Location lastLocation; // required
  private boolean isActive; // required

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    USERNAME((short)1, "username"),
    PASSWORD((short)2, "password"),
    /**
     * 
     * @see DealerAuthRole
     */
    ROLE((short)3, "role"),
    CREATED_ON((short)4, "createdOn"),
    LAST_LOGGED_IN((short)5, "lastLoggedIn"),
    LAST_LOCATION((short)6, "lastLocation"),
    IS_ACTIVE((short)7, "isActive");

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

    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: // USERNAME
          return USERNAME;
        case 2: // PASSWORD
          return PASSWORD;
        case 3: // ROLE
          return ROLE;
        case 4: // CREATED_ON
          return CREATED_ON;
        case 5: // LAST_LOGGED_IN
          return LAST_LOGGED_IN;
        case 6: // LAST_LOCATION
          return LAST_LOCATION;
        case 7: // IS_ACTIVE
          return IS_ACTIVE;
        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 __CREATEDON_ISSET_ID = 0;
  private static final int __LASTLOGGEDIN_ISSET_ID = 1;
  private static final int __ISACTIVE_ISSET_ID = 2;
  private BitSet __isset_bit_vector = new BitSet(3);

  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.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        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.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.ROLE, new org.apache.thrift.meta_data.FieldMetaData("role", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, DealerAuthRole.class)));
    tmpMap.put(_Fields.CREATED_ON, new org.apache.thrift.meta_data.FieldMetaData("createdOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.LAST_LOGGED_IN, new org.apache.thrift.meta_data.FieldMetaData("lastLoggedIn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.LAST_LOCATION, new org.apache.thrift.meta_data.FieldMetaData("lastLocation", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Location.class)));
    tmpMap.put(_Fields.IS_ACTIVE, new org.apache.thrift.meta_data.FieldMetaData("isActive", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DealerAuth.class, metaDataMap);
  }

  public DealerAuth() {
  }

  public DealerAuth(
    String username,
    String password,
    DealerAuthRole role,
    long createdOn,
    long lastLoggedIn,
    Location lastLocation,
    boolean isActive)
  {
    this();
    this.username = username;
    this.password = password;
    this.role = role;
    this.createdOn = createdOn;
    setCreatedOnIsSet(true);
    this.lastLoggedIn = lastLoggedIn;
    setLastLoggedInIsSet(true);
    this.lastLocation = lastLocation;
    this.isActive = isActive;
    setIsActiveIsSet(true);
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public DealerAuth(DealerAuth other) {
    __isset_bit_vector.clear();
    __isset_bit_vector.or(other.__isset_bit_vector);
    if (other.isSetUsername()) {
      this.username = other.username;
    }
    if (other.isSetPassword()) {
      this.password = other.password;
    }
    if (other.isSetRole()) {
      this.role = other.role;
    }
    this.createdOn = other.createdOn;
    this.lastLoggedIn = other.lastLoggedIn;
    if (other.isSetLastLocation()) {
      this.lastLocation = new Location(other.lastLocation);
    }
    this.isActive = other.isActive;
  }

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

  @Override
  public void clear() {
    this.username = null;
    this.password = null;
    this.role = null;
    setCreatedOnIsSet(false);
    this.createdOn = 0;
    setLastLoggedInIsSet(false);
    this.lastLoggedIn = 0;
    this.lastLocation = null;
    setIsActiveIsSet(false);
    this.isActive = false;
  }

  public String getUsername() {
    return this.username;
  }

  public void setUsername(String username) {
    this.username = username;
  }

  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 void setPassword(String password) {
    this.password = password;
  }

  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;
    }
  }

  /**
   * 
   * @see DealerAuthRole
   */
  public DealerAuthRole getRole() {
    return this.role;
  }

  /**
   * 
   * @see DealerAuthRole
   */
  public void setRole(DealerAuthRole role) {
    this.role = role;
  }

  public void unsetRole() {
    this.role = null;
  }

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

  public void setRoleIsSet(boolean value) {
    if (!value) {
      this.role = null;
    }
  }

  public long getCreatedOn() {
    return this.createdOn;
  }

  public void setCreatedOn(long createdOn) {
    this.createdOn = createdOn;
    setCreatedOnIsSet(true);
  }

  public void unsetCreatedOn() {
    __isset_bit_vector.clear(__CREATEDON_ISSET_ID);
  }

  /** Returns true if field createdOn is set (has been assigned a value) and false otherwise */
  public boolean isSetCreatedOn() {
    return __isset_bit_vector.get(__CREATEDON_ISSET_ID);
  }

  public void setCreatedOnIsSet(boolean value) {
    __isset_bit_vector.set(__CREATEDON_ISSET_ID, value);
  }

  public long getLastLoggedIn() {
    return this.lastLoggedIn;
  }

  public void setLastLoggedIn(long lastLoggedIn) {
    this.lastLoggedIn = lastLoggedIn;
    setLastLoggedInIsSet(true);
  }

  public void unsetLastLoggedIn() {
    __isset_bit_vector.clear(__LASTLOGGEDIN_ISSET_ID);
  }

  /** Returns true if field lastLoggedIn is set (has been assigned a value) and false otherwise */
  public boolean isSetLastLoggedIn() {
    return __isset_bit_vector.get(__LASTLOGGEDIN_ISSET_ID);
  }

  public void setLastLoggedInIsSet(boolean value) {
    __isset_bit_vector.set(__LASTLOGGEDIN_ISSET_ID, value);
  }

  public Location getLastLocation() {
    return this.lastLocation;
  }

  public void setLastLocation(Location lastLocation) {
    this.lastLocation = lastLocation;
  }

  public void unsetLastLocation() {
    this.lastLocation = null;
  }

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

  public void setLastLocationIsSet(boolean value) {
    if (!value) {
      this.lastLocation = null;
    }
  }

  public boolean isIsActive() {
    return this.isActive;
  }

  public void setIsActive(boolean isActive) {
    this.isActive = isActive;
    setIsActiveIsSet(true);
  }

  public void unsetIsActive() {
    __isset_bit_vector.clear(__ISACTIVE_ISSET_ID);
  }

  /** Returns true if field isActive is set (has been assigned a value) and false otherwise */
  public boolean isSetIsActive() {
    return __isset_bit_vector.get(__ISACTIVE_ISSET_ID);
  }

  public void setIsActiveIsSet(boolean value) {
    __isset_bit_vector.set(__ISACTIVE_ISSET_ID, value);
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case USERNAME:
      if (value == null) {
        unsetUsername();
      } else {
        setUsername((String)value);
      }
      break;

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

    case ROLE:
      if (value == null) {
        unsetRole();
      } else {
        setRole((DealerAuthRole)value);
      }
      break;

    case CREATED_ON:
      if (value == null) {
        unsetCreatedOn();
      } else {
        setCreatedOn((Long)value);
      }
      break;

    case LAST_LOGGED_IN:
      if (value == null) {
        unsetLastLoggedIn();
      } else {
        setLastLoggedIn((Long)value);
      }
      break;

    case LAST_LOCATION:
      if (value == null) {
        unsetLastLocation();
      } else {
        setLastLocation((Location)value);
      }
      break;

    case IS_ACTIVE:
      if (value == null) {
        unsetIsActive();
      } else {
        setIsActive((Boolean)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case USERNAME:
      return getUsername();

    case PASSWORD:
      return getPassword();

    case ROLE:
      return getRole();

    case CREATED_ON:
      return Long.valueOf(getCreatedOn());

    case LAST_LOGGED_IN:
      return Long.valueOf(getLastLoggedIn());

    case LAST_LOCATION:
      return getLastLocation();

    case IS_ACTIVE:
      return Boolean.valueOf(isIsActive());

    }
    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 USERNAME:
      return isSetUsername();
    case PASSWORD:
      return isSetPassword();
    case ROLE:
      return isSetRole();
    case CREATED_ON:
      return isSetCreatedOn();
    case LAST_LOGGED_IN:
      return isSetLastLoggedIn();
    case LAST_LOCATION:
      return isSetLastLocation();
    case IS_ACTIVE:
      return isSetIsActive();
    }
    throw new IllegalStateException();
  }

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

  public boolean equals(DealerAuth that) {
    if (that == null)
      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_role = true && this.isSetRole();
    boolean that_present_role = true && that.isSetRole();
    if (this_present_role || that_present_role) {
      if (!(this_present_role && that_present_role))
        return false;
      if (!this.role.equals(that.role))
        return false;
    }

    boolean this_present_createdOn = true;
    boolean that_present_createdOn = true;
    if (this_present_createdOn || that_present_createdOn) {
      if (!(this_present_createdOn && that_present_createdOn))
        return false;
      if (this.createdOn != that.createdOn)
        return false;
    }

    boolean this_present_lastLoggedIn = true;
    boolean that_present_lastLoggedIn = true;
    if (this_present_lastLoggedIn || that_present_lastLoggedIn) {
      if (!(this_present_lastLoggedIn && that_present_lastLoggedIn))
        return false;
      if (this.lastLoggedIn != that.lastLoggedIn)
        return false;
    }

    boolean this_present_lastLocation = true && this.isSetLastLocation();
    boolean that_present_lastLocation = true && that.isSetLastLocation();
    if (this_present_lastLocation || that_present_lastLocation) {
      if (!(this_present_lastLocation && that_present_lastLocation))
        return false;
      if (!this.lastLocation.equals(that.lastLocation))
        return false;
    }

    boolean this_present_isActive = true;
    boolean that_present_isActive = true;
    if (this_present_isActive || that_present_isActive) {
      if (!(this_present_isActive && that_present_isActive))
        return false;
      if (this.isActive != that.isActive)
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    return 0;
  }

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

    int lastComparison = 0;
    DealerAuth typedOther = (DealerAuth)other;

    lastComparison = Boolean.valueOf(isSetUsername()).compareTo(typedOther.isSetUsername());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUsername()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, typedOther.username);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetPassword()).compareTo(typedOther.isSetPassword());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPassword()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.password, typedOther.password);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetRole()).compareTo(typedOther.isSetRole());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRole()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.role, typedOther.role);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCreatedOn()).compareTo(typedOther.isSetCreatedOn());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCreatedOn()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.createdOn, typedOther.createdOn);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetLastLoggedIn()).compareTo(typedOther.isSetLastLoggedIn());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLastLoggedIn()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lastLoggedIn, typedOther.lastLoggedIn);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetLastLocation()).compareTo(typedOther.isSetLastLocation());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLastLocation()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lastLocation, typedOther.lastLocation);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetIsActive()).compareTo(typedOther.isSetIsActive());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetIsActive()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isActive, typedOther.isActive);
      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 {
    org.apache.thrift.protocol.TField field;
    iprot.readStructBegin();
    while (true)
    {
      field = iprot.readFieldBegin();
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
        break;
      }
      switch (field.id) {
        case 1: // USERNAME
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.username = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 2: // PASSWORD
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.password = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 3: // ROLE
          if (field.type == org.apache.thrift.protocol.TType.I32) {
            this.role = DealerAuthRole.findByValue(iprot.readI32());
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 4: // CREATED_ON
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.createdOn = iprot.readI64();
            setCreatedOnIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 5: // LAST_LOGGED_IN
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.lastLoggedIn = iprot.readI64();
            setLastLoggedInIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 6: // LAST_LOCATION
          if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
            this.lastLocation = new Location();
            this.lastLocation.read(iprot);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 7: // IS_ACTIVE
          if (field.type == org.apache.thrift.protocol.TType.BOOL) {
            this.isActive = iprot.readBool();
            setIsActiveIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        default:
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
      }
      iprot.readFieldEnd();
    }
    iprot.readStructEnd();
    validate();
  }

  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    validate();

    oprot.writeStructBegin(STRUCT_DESC);
    if (this.username != null) {
      oprot.writeFieldBegin(USERNAME_FIELD_DESC);
      oprot.writeString(this.username);
      oprot.writeFieldEnd();
    }
    if (this.password != null) {
      oprot.writeFieldBegin(PASSWORD_FIELD_DESC);
      oprot.writeString(this.password);
      oprot.writeFieldEnd();
    }
    if (this.role != null) {
      oprot.writeFieldBegin(ROLE_FIELD_DESC);
      oprot.writeI32(this.role.getValue());
      oprot.writeFieldEnd();
    }
    oprot.writeFieldBegin(CREATED_ON_FIELD_DESC);
    oprot.writeI64(this.createdOn);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(LAST_LOGGED_IN_FIELD_DESC);
    oprot.writeI64(this.lastLoggedIn);
    oprot.writeFieldEnd();
    if (this.lastLocation != null) {
      oprot.writeFieldBegin(LAST_LOCATION_FIELD_DESC);
      this.lastLocation.write(oprot);
      oprot.writeFieldEnd();
    }
    oprot.writeFieldBegin(IS_ACTIVE_FIELD_DESC);
    oprot.writeBool(this.isActive);
    oprot.writeFieldEnd();
    oprot.writeFieldStop();
    oprot.writeStructEnd();
  }

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

    sb.append("username:");
    if (this.username == null) {
      sb.append("null");
    } else {
      sb.append(this.username);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("password:");
    if (this.password == null) {
      sb.append("null");
    } else {
      sb.append(this.password);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("role:");
    if (this.role == null) {
      sb.append("null");
    } else {
      sb.append(this.role);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("createdOn:");
    sb.append(this.createdOn);
    first = false;
    if (!first) sb.append(", ");
    sb.append("lastLoggedIn:");
    sb.append(this.lastLoggedIn);
    first = false;
    if (!first) sb.append(", ");
    sb.append("lastLocation:");
    if (this.lastLocation == null) {
      sb.append("null");
    } else {
      sb.append(this.lastLocation);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("isActive:");
    sb.append(this.isActive);
    first = false;
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
  }

  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_bit_vector = new BitSet(1);
      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);
    }
  }

}