Subversion Repositories SmartDukaan

Rev

Blame | Last modification | View Log | RSS feed

/**
 * Autogenerated by Thrift
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 */
package in.shop2020.warehouse;

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

import org.apache.thrift.*;
import org.apache.thrift.meta_data.*;
import org.apache.thrift.protocol.*;

public class Supplier implements TBase<Supplier._Fields>, java.io.Serializable, Cloneable, Comparable<Supplier> {
  private static final TStruct STRUCT_DESC = new TStruct("Supplier");

  private static final TField ID_FIELD_DESC = new TField("id", TType.I64, (short)1);
  private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)2);
  private static final TField PHONE_FIELD_DESC = new TField("phone", TType.STRING, (short)3);
  private static final TField FAX_FIELD_DESC = new TField("fax", TType.STRING, (short)4);
  private static final TField TIN_FIELD_DESC = new TField("tin", TType.STRING, (short)5);
  private static final TField PAN_FIELD_DESC = new TField("pan", TType.STRING, (short)6);
  private static final TField HEAD_NAME_FIELD_DESC = new TField("headName", TType.STRING, (short)7);
  private static final TField HEAD_DESIGNATION_FIELD_DESC = new TField("headDesignation", TType.STRING, (short)8);
  private static final TField HEAD_EMAIL_FIELD_DESC = new TField("headEmail", TType.STRING, (short)9);
  private static final TField CONTACT_NAME_FIELD_DESC = new TField("contactName", TType.STRING, (short)10);
  private static final TField CONTACT_PHONE_FIELD_DESC = new TField("contactPhone", TType.STRING, (short)11);
  private static final TField CONTACT_FAX_FIELD_DESC = new TField("contactFax", TType.STRING, (short)12);
  private static final TField CONTACT_EMAIL_FIELD_DESC = new TField("contactEmail", TType.STRING, (short)13);
  private static final TField REGISTERED_ADDRESS_FIELD_DESC = new TField("registeredAddress", TType.STRING, (short)14);
  private static final TField COMMUNICATION_ADDRESS_FIELD_DESC = new TField("communicationAddress", TType.STRING, (short)15);

  private long id;
  private String name;
  private String phone;
  private String fax;
  private String tin;
  private String pan;
  private String headName;
  private String headDesignation;
  private String headEmail;
  private String contactName;
  private String contactPhone;
  private String contactFax;
  private String contactEmail;
  private String registeredAddress;
  private String communicationAddress;

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements TFieldIdEnum {
    ID((short)1, "id"),
    NAME((short)2, "name"),
    PHONE((short)3, "phone"),
    FAX((short)4, "fax"),
    TIN((short)5, "tin"),
    PAN((short)6, "pan"),
    HEAD_NAME((short)7, "headName"),
    HEAD_DESIGNATION((short)8, "headDesignation"),
    HEAD_EMAIL((short)9, "headEmail"),
    CONTACT_NAME((short)10, "contactName"),
    CONTACT_PHONE((short)11, "contactPhone"),
    CONTACT_FAX((short)12, "contactFax"),
    CONTACT_EMAIL((short)13, "contactEmail"),
    REGISTERED_ADDRESS((short)14, "registeredAddress"),
    COMMUNICATION_ADDRESS((short)15, "communicationAddress");

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

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

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    public static _Fields findByThriftId(int fieldId) {
      return byId.get(fieldId);
    }

    /**
     * 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 __ID_ISSET_ID = 0;
  private BitSet __isset_bit_vector = new BitSet(1);

  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
        new FieldValueMetaData(TType.I64)));
    put(_Fields.NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT, 
        new FieldValueMetaData(TType.STRING)));
    put(_Fields.PHONE, new FieldMetaData("phone", TFieldRequirementType.DEFAULT, 
        new FieldValueMetaData(TType.STRING)));
    put(_Fields.FAX, new FieldMetaData("fax", TFieldRequirementType.DEFAULT, 
        new FieldValueMetaData(TType.STRING)));
    put(_Fields.TIN, new FieldMetaData("tin", TFieldRequirementType.DEFAULT, 
        new FieldValueMetaData(TType.STRING)));
    put(_Fields.PAN, new FieldMetaData("pan", TFieldRequirementType.DEFAULT, 
        new FieldValueMetaData(TType.STRING)));
    put(_Fields.HEAD_NAME, new FieldMetaData("headName", TFieldRequirementType.DEFAULT, 
        new FieldValueMetaData(TType.STRING)));
    put(_Fields.HEAD_DESIGNATION, new FieldMetaData("headDesignation", TFieldRequirementType.DEFAULT, 
        new FieldValueMetaData(TType.STRING)));
    put(_Fields.HEAD_EMAIL, new FieldMetaData("headEmail", TFieldRequirementType.DEFAULT, 
        new FieldValueMetaData(TType.STRING)));
    put(_Fields.CONTACT_NAME, new FieldMetaData("contactName", TFieldRequirementType.DEFAULT, 
        new FieldValueMetaData(TType.STRING)));
    put(_Fields.CONTACT_PHONE, new FieldMetaData("contactPhone", TFieldRequirementType.DEFAULT, 
        new FieldValueMetaData(TType.STRING)));
    put(_Fields.CONTACT_FAX, new FieldMetaData("contactFax", TFieldRequirementType.DEFAULT, 
        new FieldValueMetaData(TType.STRING)));
    put(_Fields.CONTACT_EMAIL, new FieldMetaData("contactEmail", TFieldRequirementType.DEFAULT, 
        new FieldValueMetaData(TType.STRING)));
    put(_Fields.REGISTERED_ADDRESS, new FieldMetaData("registeredAddress", TFieldRequirementType.DEFAULT, 
        new FieldValueMetaData(TType.STRING)));
    put(_Fields.COMMUNICATION_ADDRESS, new FieldMetaData("communicationAddress", TFieldRequirementType.DEFAULT, 
        new FieldValueMetaData(TType.STRING)));
  }});

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

  public Supplier() {
  }

  public Supplier(
    long id,
    String name,
    String phone,
    String fax,
    String tin,
    String pan,
    String headName,
    String headDesignation,
    String headEmail,
    String contactName,
    String contactPhone,
    String contactFax,
    String contactEmail,
    String registeredAddress,
    String communicationAddress)
  {
    this();
    this.id = id;
    setIdIsSet(true);
    this.name = name;
    this.phone = phone;
    this.fax = fax;
    this.tin = tin;
    this.pan = pan;
    this.headName = headName;
    this.headDesignation = headDesignation;
    this.headEmail = headEmail;
    this.contactName = contactName;
    this.contactPhone = contactPhone;
    this.contactFax = contactFax;
    this.contactEmail = contactEmail;
    this.registeredAddress = registeredAddress;
    this.communicationAddress = communicationAddress;
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public Supplier(Supplier other) {
    __isset_bit_vector.clear();
    __isset_bit_vector.or(other.__isset_bit_vector);
    this.id = other.id;
    if (other.isSetName()) {
      this.name = other.name;
    }
    if (other.isSetPhone()) {
      this.phone = other.phone;
    }
    if (other.isSetFax()) {
      this.fax = other.fax;
    }
    if (other.isSetTin()) {
      this.tin = other.tin;
    }
    if (other.isSetPan()) {
      this.pan = other.pan;
    }
    if (other.isSetHeadName()) {
      this.headName = other.headName;
    }
    if (other.isSetHeadDesignation()) {
      this.headDesignation = other.headDesignation;
    }
    if (other.isSetHeadEmail()) {
      this.headEmail = other.headEmail;
    }
    if (other.isSetContactName()) {
      this.contactName = other.contactName;
    }
    if (other.isSetContactPhone()) {
      this.contactPhone = other.contactPhone;
    }
    if (other.isSetContactFax()) {
      this.contactFax = other.contactFax;
    }
    if (other.isSetContactEmail()) {
      this.contactEmail = other.contactEmail;
    }
    if (other.isSetRegisteredAddress()) {
      this.registeredAddress = other.registeredAddress;
    }
    if (other.isSetCommunicationAddress()) {
      this.communicationAddress = other.communicationAddress;
    }
  }

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

  @Deprecated
  public Supplier clone() {
    return new Supplier(this);
  }

  public long getId() {
    return this.id;
  }

  public Supplier setId(long id) {
    this.id = id;
    setIdIsSet(true);
    return this;
  }

  public void unsetId() {
    __isset_bit_vector.clear(__ID_ISSET_ID);
  }

  /** Returns true if field id is set (has been asigned a value) and false otherwise */
  public boolean isSetId() {
    return __isset_bit_vector.get(__ID_ISSET_ID);
  }

  public void setIdIsSet(boolean value) {
    __isset_bit_vector.set(__ID_ISSET_ID, value);
  }

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

  public Supplier setName(String name) {
    this.name = name;
    return this;
  }

  public void unsetName() {
    this.name = null;
  }

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

  public void setNameIsSet(boolean value) {
    if (!value) {
      this.name = null;
    }
  }

  public String getPhone() {
    return this.phone;
  }

  public Supplier setPhone(String phone) {
    this.phone = phone;
    return this;
  }

  public void unsetPhone() {
    this.phone = null;
  }

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

  public void setPhoneIsSet(boolean value) {
    if (!value) {
      this.phone = null;
    }
  }

  public String getFax() {
    return this.fax;
  }

  public Supplier setFax(String fax) {
    this.fax = fax;
    return this;
  }

  public void unsetFax() {
    this.fax = null;
  }

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

  public void setFaxIsSet(boolean value) {
    if (!value) {
      this.fax = null;
    }
  }

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

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

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

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

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

  public String getPan() {
    return this.pan;
  }

  public Supplier setPan(String pan) {
    this.pan = pan;
    return this;
  }

  public void unsetPan() {
    this.pan = null;
  }

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

  public void setPanIsSet(boolean value) {
    if (!value) {
      this.pan = null;
    }
  }

  public String getHeadName() {
    return this.headName;
  }

  public Supplier setHeadName(String headName) {
    this.headName = headName;
    return this;
  }

  public void unsetHeadName() {
    this.headName = null;
  }

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

  public void setHeadNameIsSet(boolean value) {
    if (!value) {
      this.headName = null;
    }
  }

  public String getHeadDesignation() {
    return this.headDesignation;
  }

  public Supplier setHeadDesignation(String headDesignation) {
    this.headDesignation = headDesignation;
    return this;
  }

  public void unsetHeadDesignation() {
    this.headDesignation = null;
  }

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

  public void setHeadDesignationIsSet(boolean value) {
    if (!value) {
      this.headDesignation = null;
    }
  }

  public String getHeadEmail() {
    return this.headEmail;
  }

  public Supplier setHeadEmail(String headEmail) {
    this.headEmail = headEmail;
    return this;
  }

  public void unsetHeadEmail() {
    this.headEmail = null;
  }

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

  public void setHeadEmailIsSet(boolean value) {
    if (!value) {
      this.headEmail = null;
    }
  }

  public String getContactName() {
    return this.contactName;
  }

  public Supplier setContactName(String contactName) {
    this.contactName = contactName;
    return this;
  }

  public void unsetContactName() {
    this.contactName = null;
  }

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

  public void setContactNameIsSet(boolean value) {
    if (!value) {
      this.contactName = null;
    }
  }

  public String getContactPhone() {
    return this.contactPhone;
  }

  public Supplier setContactPhone(String contactPhone) {
    this.contactPhone = contactPhone;
    return this;
  }

  public void unsetContactPhone() {
    this.contactPhone = null;
  }

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

  public void setContactPhoneIsSet(boolean value) {
    if (!value) {
      this.contactPhone = null;
    }
  }

  public String getContactFax() {
    return this.contactFax;
  }

  public Supplier setContactFax(String contactFax) {
    this.contactFax = contactFax;
    return this;
  }

  public void unsetContactFax() {
    this.contactFax = null;
  }

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

  public void setContactFaxIsSet(boolean value) {
    if (!value) {
      this.contactFax = null;
    }
  }

  public String getContactEmail() {
    return this.contactEmail;
  }

  public Supplier setContactEmail(String contactEmail) {
    this.contactEmail = contactEmail;
    return this;
  }

  public void unsetContactEmail() {
    this.contactEmail = null;
  }

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

  public void setContactEmailIsSet(boolean value) {
    if (!value) {
      this.contactEmail = null;
    }
  }

  public String getRegisteredAddress() {
    return this.registeredAddress;
  }

  public Supplier setRegisteredAddress(String registeredAddress) {
    this.registeredAddress = registeredAddress;
    return this;
  }

  public void unsetRegisteredAddress() {
    this.registeredAddress = null;
  }

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

  public void setRegisteredAddressIsSet(boolean value) {
    if (!value) {
      this.registeredAddress = null;
    }
  }

  public String getCommunicationAddress() {
    return this.communicationAddress;
  }

  public Supplier setCommunicationAddress(String communicationAddress) {
    this.communicationAddress = communicationAddress;
    return this;
  }

  public void unsetCommunicationAddress() {
    this.communicationAddress = null;
  }

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

  public void setCommunicationAddressIsSet(boolean value) {
    if (!value) {
      this.communicationAddress = null;
    }
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case ID:
      if (value == null) {
        unsetId();
      } else {
        setId((Long)value);
      }
      break;

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

    case PHONE:
      if (value == null) {
        unsetPhone();
      } else {
        setPhone((String)value);
      }
      break;

    case FAX:
      if (value == null) {
        unsetFax();
      } else {
        setFax((String)value);
      }
      break;

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

    case PAN:
      if (value == null) {
        unsetPan();
      } else {
        setPan((String)value);
      }
      break;

    case HEAD_NAME:
      if (value == null) {
        unsetHeadName();
      } else {
        setHeadName((String)value);
      }
      break;

    case HEAD_DESIGNATION:
      if (value == null) {
        unsetHeadDesignation();
      } else {
        setHeadDesignation((String)value);
      }
      break;

    case HEAD_EMAIL:
      if (value == null) {
        unsetHeadEmail();
      } else {
        setHeadEmail((String)value);
      }
      break;

    case CONTACT_NAME:
      if (value == null) {
        unsetContactName();
      } else {
        setContactName((String)value);
      }
      break;

    case CONTACT_PHONE:
      if (value == null) {
        unsetContactPhone();
      } else {
        setContactPhone((String)value);
      }
      break;

    case CONTACT_FAX:
      if (value == null) {
        unsetContactFax();
      } else {
        setContactFax((String)value);
      }
      break;

    case CONTACT_EMAIL:
      if (value == null) {
        unsetContactEmail();
      } else {
        setContactEmail((String)value);
      }
      break;

    case REGISTERED_ADDRESS:
      if (value == null) {
        unsetRegisteredAddress();
      } else {
        setRegisteredAddress((String)value);
      }
      break;

    case COMMUNICATION_ADDRESS:
      if (value == null) {
        unsetCommunicationAddress();
      } else {
        setCommunicationAddress((String)value);
      }
      break;

    }
  }

  public void setFieldValue(int fieldID, Object value) {
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case ID:
      return new Long(getId());

    case NAME:
      return getName();

    case PHONE:
      return getPhone();

    case FAX:
      return getFax();

    case TIN:
      return getTin();

    case PAN:
      return getPan();

    case HEAD_NAME:
      return getHeadName();

    case HEAD_DESIGNATION:
      return getHeadDesignation();

    case HEAD_EMAIL:
      return getHeadEmail();

    case CONTACT_NAME:
      return getContactName();

    case CONTACT_PHONE:
      return getContactPhone();

    case CONTACT_FAX:
      return getContactFax();

    case CONTACT_EMAIL:
      return getContactEmail();

    case REGISTERED_ADDRESS:
      return getRegisteredAddress();

    case COMMUNICATION_ADDRESS:
      return getCommunicationAddress();

    }
    throw new IllegalStateException();
  }

  public Object getFieldValue(int fieldId) {
    return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
  }

  /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
  public boolean isSet(_Fields field) {
    switch (field) {
    case ID:
      return isSetId();
    case NAME:
      return isSetName();
    case PHONE:
      return isSetPhone();
    case FAX:
      return isSetFax();
    case TIN:
      return isSetTin();
    case PAN:
      return isSetPan();
    case HEAD_NAME:
      return isSetHeadName();
    case HEAD_DESIGNATION:
      return isSetHeadDesignation();
    case HEAD_EMAIL:
      return isSetHeadEmail();
    case CONTACT_NAME:
      return isSetContactName();
    case CONTACT_PHONE:
      return isSetContactPhone();
    case CONTACT_FAX:
      return isSetContactFax();
    case CONTACT_EMAIL:
      return isSetContactEmail();
    case REGISTERED_ADDRESS:
      return isSetRegisteredAddress();
    case COMMUNICATION_ADDRESS:
      return isSetCommunicationAddress();
    }
    throw new IllegalStateException();
  }

  public boolean isSet(int fieldID) {
    return isSet(_Fields.findByThriftIdOrThrow(fieldID));
  }

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

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

    boolean this_present_id = true;
    boolean that_present_id = true;
    if (this_present_id || that_present_id) {
      if (!(this_present_id && that_present_id))
        return false;
      if (this.id != that.id)
        return false;
    }

    boolean this_present_name = true && this.isSetName();
    boolean that_present_name = true && that.isSetName();
    if (this_present_name || that_present_name) {
      if (!(this_present_name && that_present_name))
        return false;
      if (!this.name.equals(that.name))
        return false;
    }

    boolean this_present_phone = true && this.isSetPhone();
    boolean that_present_phone = true && that.isSetPhone();
    if (this_present_phone || that_present_phone) {
      if (!(this_present_phone && that_present_phone))
        return false;
      if (!this.phone.equals(that.phone))
        return false;
    }

    boolean this_present_fax = true && this.isSetFax();
    boolean that_present_fax = true && that.isSetFax();
    if (this_present_fax || that_present_fax) {
      if (!(this_present_fax && that_present_fax))
        return false;
      if (!this.fax.equals(that.fax))
        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_pan = true && this.isSetPan();
    boolean that_present_pan = true && that.isSetPan();
    if (this_present_pan || that_present_pan) {
      if (!(this_present_pan && that_present_pan))
        return false;
      if (!this.pan.equals(that.pan))
        return false;
    }

    boolean this_present_headName = true && this.isSetHeadName();
    boolean that_present_headName = true && that.isSetHeadName();
    if (this_present_headName || that_present_headName) {
      if (!(this_present_headName && that_present_headName))
        return false;
      if (!this.headName.equals(that.headName))
        return false;
    }

    boolean this_present_headDesignation = true && this.isSetHeadDesignation();
    boolean that_present_headDesignation = true && that.isSetHeadDesignation();
    if (this_present_headDesignation || that_present_headDesignation) {
      if (!(this_present_headDesignation && that_present_headDesignation))
        return false;
      if (!this.headDesignation.equals(that.headDesignation))
        return false;
    }

    boolean this_present_headEmail = true && this.isSetHeadEmail();
    boolean that_present_headEmail = true && that.isSetHeadEmail();
    if (this_present_headEmail || that_present_headEmail) {
      if (!(this_present_headEmail && that_present_headEmail))
        return false;
      if (!this.headEmail.equals(that.headEmail))
        return false;
    }

    boolean this_present_contactName = true && this.isSetContactName();
    boolean that_present_contactName = true && that.isSetContactName();
    if (this_present_contactName || that_present_contactName) {
      if (!(this_present_contactName && that_present_contactName))
        return false;
      if (!this.contactName.equals(that.contactName))
        return false;
    }

    boolean this_present_contactPhone = true && this.isSetContactPhone();
    boolean that_present_contactPhone = true && that.isSetContactPhone();
    if (this_present_contactPhone || that_present_contactPhone) {
      if (!(this_present_contactPhone && that_present_contactPhone))
        return false;
      if (!this.contactPhone.equals(that.contactPhone))
        return false;
    }

    boolean this_present_contactFax = true && this.isSetContactFax();
    boolean that_present_contactFax = true && that.isSetContactFax();
    if (this_present_contactFax || that_present_contactFax) {
      if (!(this_present_contactFax && that_present_contactFax))
        return false;
      if (!this.contactFax.equals(that.contactFax))
        return false;
    }

    boolean this_present_contactEmail = true && this.isSetContactEmail();
    boolean that_present_contactEmail = true && that.isSetContactEmail();
    if (this_present_contactEmail || that_present_contactEmail) {
      if (!(this_present_contactEmail && that_present_contactEmail))
        return false;
      if (!this.contactEmail.equals(that.contactEmail))
        return false;
    }

    boolean this_present_registeredAddress = true && this.isSetRegisteredAddress();
    boolean that_present_registeredAddress = true && that.isSetRegisteredAddress();
    if (this_present_registeredAddress || that_present_registeredAddress) {
      if (!(this_present_registeredAddress && that_present_registeredAddress))
        return false;
      if (!this.registeredAddress.equals(that.registeredAddress))
        return false;
    }

    boolean this_present_communicationAddress = true && this.isSetCommunicationAddress();
    boolean that_present_communicationAddress = true && that.isSetCommunicationAddress();
    if (this_present_communicationAddress || that_present_communicationAddress) {
      if (!(this_present_communicationAddress && that_present_communicationAddress))
        return false;
      if (!this.communicationAddress.equals(that.communicationAddress))
        return false;
    }

    return true;
  }

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

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

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

    lastComparison = Boolean.valueOf(isSetId()).compareTo(isSetId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(id, typedOther.id);
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetName()).compareTo(isSetName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(name, typedOther.name);
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetPhone()).compareTo(isSetPhone());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(phone, typedOther.phone);
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetFax()).compareTo(isSetFax());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(fax, typedOther.fax);
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetTin()).compareTo(isSetTin());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(tin, typedOther.tin);
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetPan()).compareTo(isSetPan());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(pan, typedOther.pan);
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetHeadName()).compareTo(isSetHeadName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(headName, typedOther.headName);
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetHeadDesignation()).compareTo(isSetHeadDesignation());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(headDesignation, typedOther.headDesignation);
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetHeadEmail()).compareTo(isSetHeadEmail());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(headEmail, typedOther.headEmail);
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetContactName()).compareTo(isSetContactName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(contactName, typedOther.contactName);
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetContactPhone()).compareTo(isSetContactPhone());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(contactPhone, typedOther.contactPhone);
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetContactFax()).compareTo(isSetContactFax());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(contactFax, typedOther.contactFax);
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetContactEmail()).compareTo(isSetContactEmail());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(contactEmail, typedOther.contactEmail);
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetRegisteredAddress()).compareTo(isSetRegisteredAddress());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(registeredAddress, typedOther.registeredAddress);
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetCommunicationAddress()).compareTo(isSetCommunicationAddress());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(communicationAddress, typedOther.communicationAddress);
    if (lastComparison != 0) {
      return lastComparison;
    }
    return 0;
  }

  public void read(TProtocol iprot) throws TException {
    TField field;
    iprot.readStructBegin();
    while (true)
    {
      field = iprot.readFieldBegin();
      if (field.type == TType.STOP) { 
        break;
      }
      _Fields fieldId = _Fields.findByThriftId(field.id);
      if (fieldId == null) {
        TProtocolUtil.skip(iprot, field.type);
      } else {
        switch (fieldId) {
          case ID:
            if (field.type == TType.I64) {
              this.id = iprot.readI64();
              setIdIsSet(true);
            } else { 
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case NAME:
            if (field.type == TType.STRING) {
              this.name = iprot.readString();
            } else { 
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case PHONE:
            if (field.type == TType.STRING) {
              this.phone = iprot.readString();
            } else { 
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case FAX:
            if (field.type == TType.STRING) {
              this.fax = iprot.readString();
            } else { 
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case TIN:
            if (field.type == TType.STRING) {
              this.tin = iprot.readString();
            } else { 
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case PAN:
            if (field.type == TType.STRING) {
              this.pan = iprot.readString();
            } else { 
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case HEAD_NAME:
            if (field.type == TType.STRING) {
              this.headName = iprot.readString();
            } else { 
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case HEAD_DESIGNATION:
            if (field.type == TType.STRING) {
              this.headDesignation = iprot.readString();
            } else { 
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case HEAD_EMAIL:
            if (field.type == TType.STRING) {
              this.headEmail = iprot.readString();
            } else { 
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case CONTACT_NAME:
            if (field.type == TType.STRING) {
              this.contactName = iprot.readString();
            } else { 
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case CONTACT_PHONE:
            if (field.type == TType.STRING) {
              this.contactPhone = iprot.readString();
            } else { 
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case CONTACT_FAX:
            if (field.type == TType.STRING) {
              this.contactFax = iprot.readString();
            } else { 
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case CONTACT_EMAIL:
            if (field.type == TType.STRING) {
              this.contactEmail = iprot.readString();
            } else { 
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case REGISTERED_ADDRESS:
            if (field.type == TType.STRING) {
              this.registeredAddress = iprot.readString();
            } else { 
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case COMMUNICATION_ADDRESS:
            if (field.type == TType.STRING) {
              this.communicationAddress = iprot.readString();
            } else { 
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
        }
        iprot.readFieldEnd();
      }
    }
    iprot.readStructEnd();
    validate();
  }

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

    oprot.writeStructBegin(STRUCT_DESC);
    oprot.writeFieldBegin(ID_FIELD_DESC);
    oprot.writeI64(this.id);
    oprot.writeFieldEnd();
    if (this.name != null) {
      oprot.writeFieldBegin(NAME_FIELD_DESC);
      oprot.writeString(this.name);
      oprot.writeFieldEnd();
    }
    if (this.phone != null) {
      oprot.writeFieldBegin(PHONE_FIELD_DESC);
      oprot.writeString(this.phone);
      oprot.writeFieldEnd();
    }
    if (this.fax != null) {
      oprot.writeFieldBegin(FAX_FIELD_DESC);
      oprot.writeString(this.fax);
      oprot.writeFieldEnd();
    }
    if (this.tin != null) {
      oprot.writeFieldBegin(TIN_FIELD_DESC);
      oprot.writeString(this.tin);
      oprot.writeFieldEnd();
    }
    if (this.pan != null) {
      oprot.writeFieldBegin(PAN_FIELD_DESC);
      oprot.writeString(this.pan);
      oprot.writeFieldEnd();
    }
    if (this.headName != null) {
      oprot.writeFieldBegin(HEAD_NAME_FIELD_DESC);
      oprot.writeString(this.headName);
      oprot.writeFieldEnd();
    }
    if (this.headDesignation != null) {
      oprot.writeFieldBegin(HEAD_DESIGNATION_FIELD_DESC);
      oprot.writeString(this.headDesignation);
      oprot.writeFieldEnd();
    }
    if (this.headEmail != null) {
      oprot.writeFieldBegin(HEAD_EMAIL_FIELD_DESC);
      oprot.writeString(this.headEmail);
      oprot.writeFieldEnd();
    }
    if (this.contactName != null) {
      oprot.writeFieldBegin(CONTACT_NAME_FIELD_DESC);
      oprot.writeString(this.contactName);
      oprot.writeFieldEnd();
    }
    if (this.contactPhone != null) {
      oprot.writeFieldBegin(CONTACT_PHONE_FIELD_DESC);
      oprot.writeString(this.contactPhone);
      oprot.writeFieldEnd();
    }
    if (this.contactFax != null) {
      oprot.writeFieldBegin(CONTACT_FAX_FIELD_DESC);
      oprot.writeString(this.contactFax);
      oprot.writeFieldEnd();
    }
    if (this.contactEmail != null) {
      oprot.writeFieldBegin(CONTACT_EMAIL_FIELD_DESC);
      oprot.writeString(this.contactEmail);
      oprot.writeFieldEnd();
    }
    if (this.registeredAddress != null) {
      oprot.writeFieldBegin(REGISTERED_ADDRESS_FIELD_DESC);
      oprot.writeString(this.registeredAddress);
      oprot.writeFieldEnd();
    }
    if (this.communicationAddress != null) {
      oprot.writeFieldBegin(COMMUNICATION_ADDRESS_FIELD_DESC);
      oprot.writeString(this.communicationAddress);
      oprot.writeFieldEnd();
    }
    oprot.writeFieldStop();
    oprot.writeStructEnd();
  }

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

    sb.append("id:");
    sb.append(this.id);
    first = false;
    if (!first) sb.append(", ");
    sb.append("name:");
    if (this.name == null) {
      sb.append("null");
    } else {
      sb.append(this.name);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("phone:");
    if (this.phone == null) {
      sb.append("null");
    } else {
      sb.append(this.phone);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("fax:");
    if (this.fax == null) {
      sb.append("null");
    } else {
      sb.append(this.fax);
    }
    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("pan:");
    if (this.pan == null) {
      sb.append("null");
    } else {
      sb.append(this.pan);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("headName:");
    if (this.headName == null) {
      sb.append("null");
    } else {
      sb.append(this.headName);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("headDesignation:");
    if (this.headDesignation == null) {
      sb.append("null");
    } else {
      sb.append(this.headDesignation);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("headEmail:");
    if (this.headEmail == null) {
      sb.append("null");
    } else {
      sb.append(this.headEmail);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("contactName:");
    if (this.contactName == null) {
      sb.append("null");
    } else {
      sb.append(this.contactName);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("contactPhone:");
    if (this.contactPhone == null) {
      sb.append("null");
    } else {
      sb.append(this.contactPhone);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("contactFax:");
    if (this.contactFax == null) {
      sb.append("null");
    } else {
      sb.append(this.contactFax);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("contactEmail:");
    if (this.contactEmail == null) {
      sb.append("null");
    } else {
      sb.append(this.contactEmail);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("registeredAddress:");
    if (this.registeredAddress == null) {
      sb.append("null");
    } else {
      sb.append(this.registeredAddress);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("communicationAddress:");
    if (this.communicationAddress == null) {
      sb.append("null");
    } else {
      sb.append(this.communicationAddress);
    }
    first = false;
    sb.append(")");
    return sb.toString();
  }

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

}