Subversion Repositories SmartDukaan

Rev

Rev 13146 | Rev 18735 | Go to most recent revision | Blame | Compare with Previous | 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.model.v1.user;

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 PrivateDealUser implements org.apache.thrift.TBase<PrivateDealUser, PrivateDealUser._Fields>, java.io.Serializable, Cloneable {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("PrivateDealUser");

  private static final org.apache.thrift.protocol.TField USER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("userId", org.apache.thrift.protocol.TType.I64, (short)1);
  private static final org.apache.thrift.protocol.TField ADDED_ON_FIELD_DESC = new org.apache.thrift.protocol.TField("addedOn", org.apache.thrift.protocol.TType.I64, (short)2);
  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)3);
  private static final org.apache.thrift.protocol.TField COUNTER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("counterId", org.apache.thrift.protocol.TType.I64, (short)4);
  private static final org.apache.thrift.protocol.TField TIN_FIELD_DESC = new org.apache.thrift.protocol.TField("tin", org.apache.thrift.protocol.TType.STRING, (short)5);
  private static final org.apache.thrift.protocol.TField BULK_SHIPMENT_AMOUNT_LIMIT_FIELD_DESC = new org.apache.thrift.protocol.TField("bulkShipmentAmountLimit", org.apache.thrift.protocol.TType.DOUBLE, (short)6);
  private static final org.apache.thrift.protocol.TField CREDITOR_ASSIGNED_FIELD_DESC = new org.apache.thrift.protocol.TField("creditorAssigned", org.apache.thrift.protocol.TType.BOOL, (short)7);

  private long userId; // required
  private long addedOn; // required
  private boolean isActive; // required
  private long counterId; // required
  private String tin; // required
  private double bulkShipmentAmountLimit; // required
  private boolean creditorAssigned; // 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 {
    USER_ID((short)1, "userId"),
    ADDED_ON((short)2, "addedOn"),
    IS_ACTIVE((short)3, "isActive"),
    COUNTER_ID((short)4, "counterId"),
    TIN((short)5, "tin"),
    BULK_SHIPMENT_AMOUNT_LIMIT((short)6, "bulkShipmentAmountLimit"),
    CREDITOR_ASSIGNED((short)7, "creditorAssigned");

    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: // USER_ID
          return USER_ID;
        case 2: // ADDED_ON
          return ADDED_ON;
        case 3: // IS_ACTIVE
          return IS_ACTIVE;
        case 4: // COUNTER_ID
          return COUNTER_ID;
        case 5: // TIN
          return TIN;
        case 6: // BULK_SHIPMENT_AMOUNT_LIMIT
          return BULK_SHIPMENT_AMOUNT_LIMIT;
        case 7: // CREDITOR_ASSIGNED
          return CREDITOR_ASSIGNED;
        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 __USERID_ISSET_ID = 0;
  private static final int __ADDEDON_ISSET_ID = 1;
  private static final int __ISACTIVE_ISSET_ID = 2;
  private static final int __COUNTERID_ISSET_ID = 3;
  private static final int __BULKSHIPMENTAMOUNTLIMIT_ISSET_ID = 4;
  private static final int __CREDITORASSIGNED_ISSET_ID = 5;
  private BitSet __isset_bit_vector = new BitSet(6);

  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.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.ADDED_ON, new org.apache.thrift.meta_data.FieldMetaData("addedOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    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)));
    tmpMap.put(_Fields.COUNTER_ID, new org.apache.thrift.meta_data.FieldMetaData("counterId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.TIN, new org.apache.thrift.meta_data.FieldMetaData("tin", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.BULK_SHIPMENT_AMOUNT_LIMIT, new org.apache.thrift.meta_data.FieldMetaData("bulkShipmentAmountLimit", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
    tmpMap.put(_Fields.CREDITOR_ASSIGNED, new org.apache.thrift.meta_data.FieldMetaData("creditorAssigned", 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(PrivateDealUser.class, metaDataMap);
  }

  public PrivateDealUser() {
  }

  public PrivateDealUser(
    long userId,
    long addedOn,
    boolean isActive,
    long counterId,
    String tin,
    double bulkShipmentAmountLimit,
    boolean creditorAssigned)
  {
    this();
    this.userId = userId;
    setUserIdIsSet(true);
    this.addedOn = addedOn;
    setAddedOnIsSet(true);
    this.isActive = isActive;
    setIsActiveIsSet(true);
    this.counterId = counterId;
    setCounterIdIsSet(true);
    this.tin = tin;
    this.bulkShipmentAmountLimit = bulkShipmentAmountLimit;
    setBulkShipmentAmountLimitIsSet(true);
    this.creditorAssigned = creditorAssigned;
    setCreditorAssignedIsSet(true);
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public PrivateDealUser(PrivateDealUser other) {
    __isset_bit_vector.clear();
    __isset_bit_vector.or(other.__isset_bit_vector);
    this.userId = other.userId;
    this.addedOn = other.addedOn;
    this.isActive = other.isActive;
    this.counterId = other.counterId;
    if (other.isSetTin()) {
      this.tin = other.tin;
    }
    this.bulkShipmentAmountLimit = other.bulkShipmentAmountLimit;
    this.creditorAssigned = other.creditorAssigned;
  }

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

  @Override
  public void clear() {
    setUserIdIsSet(false);
    this.userId = 0;
    setAddedOnIsSet(false);
    this.addedOn = 0;
    setIsActiveIsSet(false);
    this.isActive = false;
    setCounterIdIsSet(false);
    this.counterId = 0;
    this.tin = null;
    setBulkShipmentAmountLimitIsSet(false);
    this.bulkShipmentAmountLimit = 0.0;
    setCreditorAssignedIsSet(false);
    this.creditorAssigned = false;
  }

  public long getUserId() {
    return this.userId;
  }

  public void setUserId(long userId) {
    this.userId = userId;
    setUserIdIsSet(true);
  }

  public void unsetUserId() {
    __isset_bit_vector.clear(__USERID_ISSET_ID);
  }

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

  public void setUserIdIsSet(boolean value) {
    __isset_bit_vector.set(__USERID_ISSET_ID, value);
  }

  public long getAddedOn() {
    return this.addedOn;
  }

  public void setAddedOn(long addedOn) {
    this.addedOn = addedOn;
    setAddedOnIsSet(true);
  }

  public void unsetAddedOn() {
    __isset_bit_vector.clear(__ADDEDON_ISSET_ID);
  }

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

  public void setAddedOnIsSet(boolean value) {
    __isset_bit_vector.set(__ADDEDON_ISSET_ID, value);
  }

  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 long getCounterId() {
    return this.counterId;
  }

  public void setCounterId(long counterId) {
    this.counterId = counterId;
    setCounterIdIsSet(true);
  }

  public void unsetCounterId() {
    __isset_bit_vector.clear(__COUNTERID_ISSET_ID);
  }

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

  public void setCounterIdIsSet(boolean value) {
    __isset_bit_vector.set(__COUNTERID_ISSET_ID, value);
  }

  public String getTin() {
    return this.tin;
  }

  public void setTin(String tin) {
    this.tin = tin;
  }

  public void unsetTin() {
    this.tin = null;
  }

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

  public void setTinIsSet(boolean value) {
    if (!value) {
      this.tin = null;
    }
  }

  public double getBulkShipmentAmountLimit() {
    return this.bulkShipmentAmountLimit;
  }

  public void setBulkShipmentAmountLimit(double bulkShipmentAmountLimit) {
    this.bulkShipmentAmountLimit = bulkShipmentAmountLimit;
    setBulkShipmentAmountLimitIsSet(true);
  }

  public void unsetBulkShipmentAmountLimit() {
    __isset_bit_vector.clear(__BULKSHIPMENTAMOUNTLIMIT_ISSET_ID);
  }

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

  public void setBulkShipmentAmountLimitIsSet(boolean value) {
    __isset_bit_vector.set(__BULKSHIPMENTAMOUNTLIMIT_ISSET_ID, value);
  }

  public boolean isCreditorAssigned() {
    return this.creditorAssigned;
  }

  public void setCreditorAssigned(boolean creditorAssigned) {
    this.creditorAssigned = creditorAssigned;
    setCreditorAssignedIsSet(true);
  }

  public void unsetCreditorAssigned() {
    __isset_bit_vector.clear(__CREDITORASSIGNED_ISSET_ID);
  }

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

  public void setCreditorAssignedIsSet(boolean value) {
    __isset_bit_vector.set(__CREDITORASSIGNED_ISSET_ID, value);
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case USER_ID:
      if (value == null) {
        unsetUserId();
      } else {
        setUserId((Long)value);
      }
      break;

    case ADDED_ON:
      if (value == null) {
        unsetAddedOn();
      } else {
        setAddedOn((Long)value);
      }
      break;

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

    case COUNTER_ID:
      if (value == null) {
        unsetCounterId();
      } else {
        setCounterId((Long)value);
      }
      break;

    case TIN:
      if (value == null) {
        unsetTin();
      } else {
        setTin((String)value);
      }
      break;

    case BULK_SHIPMENT_AMOUNT_LIMIT:
      if (value == null) {
        unsetBulkShipmentAmountLimit();
      } else {
        setBulkShipmentAmountLimit((Double)value);
      }
      break;

    case CREDITOR_ASSIGNED:
      if (value == null) {
        unsetCreditorAssigned();
      } else {
        setCreditorAssigned((Boolean)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case USER_ID:
      return Long.valueOf(getUserId());

    case ADDED_ON:
      return Long.valueOf(getAddedOn());

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

    case COUNTER_ID:
      return Long.valueOf(getCounterId());

    case TIN:
      return getTin();

    case BULK_SHIPMENT_AMOUNT_LIMIT:
      return Double.valueOf(getBulkShipmentAmountLimit());

    case CREDITOR_ASSIGNED:
      return Boolean.valueOf(isCreditorAssigned());

    }
    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 USER_ID:
      return isSetUserId();
    case ADDED_ON:
      return isSetAddedOn();
    case IS_ACTIVE:
      return isSetIsActive();
    case COUNTER_ID:
      return isSetCounterId();
    case TIN:
      return isSetTin();
    case BULK_SHIPMENT_AMOUNT_LIMIT:
      return isSetBulkShipmentAmountLimit();
    case CREDITOR_ASSIGNED:
      return isSetCreditorAssigned();
    }
    throw new IllegalStateException();
  }

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

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

    boolean this_present_userId = true;
    boolean that_present_userId = true;
    if (this_present_userId || that_present_userId) {
      if (!(this_present_userId && that_present_userId))
        return false;
      if (this.userId != that.userId)
        return false;
    }

    boolean this_present_addedOn = true;
    boolean that_present_addedOn = true;
    if (this_present_addedOn || that_present_addedOn) {
      if (!(this_present_addedOn && that_present_addedOn))
        return false;
      if (this.addedOn != that.addedOn)
        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;
    }

    boolean this_present_counterId = true;
    boolean that_present_counterId = true;
    if (this_present_counterId || that_present_counterId) {
      if (!(this_present_counterId && that_present_counterId))
        return false;
      if (this.counterId != that.counterId)
        return false;
    }

    boolean this_present_tin = true && this.isSetTin();
    boolean that_present_tin = true && that.isSetTin();
    if (this_present_tin || that_present_tin) {
      if (!(this_present_tin && that_present_tin))
        return false;
      if (!this.tin.equals(that.tin))
        return false;
    }

    boolean this_present_bulkShipmentAmountLimit = true;
    boolean that_present_bulkShipmentAmountLimit = true;
    if (this_present_bulkShipmentAmountLimit || that_present_bulkShipmentAmountLimit) {
      if (!(this_present_bulkShipmentAmountLimit && that_present_bulkShipmentAmountLimit))
        return false;
      if (this.bulkShipmentAmountLimit != that.bulkShipmentAmountLimit)
        return false;
    }

    boolean this_present_creditorAssigned = true;
    boolean that_present_creditorAssigned = true;
    if (this_present_creditorAssigned || that_present_creditorAssigned) {
      if (!(this_present_creditorAssigned && that_present_creditorAssigned))
        return false;
      if (this.creditorAssigned != that.creditorAssigned)
        return false;
    }

    return true;
  }

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

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

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

    lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUserId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAddedOn()).compareTo(typedOther.isSetAddedOn());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAddedOn()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.addedOn, typedOther.addedOn);
      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;
      }
    }
    lastComparison = Boolean.valueOf(isSetCounterId()).compareTo(typedOther.isSetCounterId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCounterId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.counterId, typedOther.counterId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTin()).compareTo(typedOther.isSetTin());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTin()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tin, typedOther.tin);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetBulkShipmentAmountLimit()).compareTo(typedOther.isSetBulkShipmentAmountLimit());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBulkShipmentAmountLimit()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bulkShipmentAmountLimit, typedOther.bulkShipmentAmountLimit);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCreditorAssigned()).compareTo(typedOther.isSetCreditorAssigned());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCreditorAssigned()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.creditorAssigned, typedOther.creditorAssigned);
      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: // USER_ID
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.userId = iprot.readI64();
            setUserIdIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 2: // ADDED_ON
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.addedOn = iprot.readI64();
            setAddedOnIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 3: // 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;
        case 4: // COUNTER_ID
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.counterId = iprot.readI64();
            setCounterIdIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 5: // TIN
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.tin = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 6: // BULK_SHIPMENT_AMOUNT_LIMIT
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
            this.bulkShipmentAmountLimit = iprot.readDouble();
            setBulkShipmentAmountLimitIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 7: // CREDITOR_ASSIGNED
          if (field.type == org.apache.thrift.protocol.TType.BOOL) {
            this.creditorAssigned = iprot.readBool();
            setCreditorAssignedIsSet(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);
    oprot.writeFieldBegin(USER_ID_FIELD_DESC);
    oprot.writeI64(this.userId);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(ADDED_ON_FIELD_DESC);
    oprot.writeI64(this.addedOn);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(IS_ACTIVE_FIELD_DESC);
    oprot.writeBool(this.isActive);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(COUNTER_ID_FIELD_DESC);
    oprot.writeI64(this.counterId);
    oprot.writeFieldEnd();
    if (this.tin != null) {
      oprot.writeFieldBegin(TIN_FIELD_DESC);
      oprot.writeString(this.tin);
      oprot.writeFieldEnd();
    }
    oprot.writeFieldBegin(BULK_SHIPMENT_AMOUNT_LIMIT_FIELD_DESC);
    oprot.writeDouble(this.bulkShipmentAmountLimit);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(CREDITOR_ASSIGNED_FIELD_DESC);
    oprot.writeBool(this.creditorAssigned);
    oprot.writeFieldEnd();
    oprot.writeFieldStop();
    oprot.writeStructEnd();
  }

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

    sb.append("userId:");
    sb.append(this.userId);
    first = false;
    if (!first) sb.append(", ");
    sb.append("addedOn:");
    sb.append(this.addedOn);
    first = false;
    if (!first) sb.append(", ");
    sb.append("isActive:");
    sb.append(this.isActive);
    first = false;
    if (!first) sb.append(", ");
    sb.append("counterId:");
    sb.append(this.counterId);
    first = false;
    if (!first) sb.append(", ");
    sb.append("tin:");
    if (this.tin == null) {
      sb.append("null");
    } else {
      sb.append(this.tin);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("bulkShipmentAmountLimit:");
    sb.append(this.bulkShipmentAmountLimit);
    first = false;
    if (!first) sb.append(", ");
    sb.append("creditorAssigned:");
    sb.append(this.creditorAssigned);
    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);
    }
  }

}