Subversion Repositories SmartDukaan

Rev

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.logistics;

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

  private static final org.apache.thrift.protocol.TField PROVIDER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("providerId", org.apache.thrift.protocol.TType.I64, (short)1);
  private static final org.apache.thrift.protocol.TField PIN_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("pinCode", org.apache.thrift.protocol.TType.STRING, (short)2);
  private static final org.apache.thrift.protocol.TField DESTINATION_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("destinationCode", org.apache.thrift.protocol.TType.STRING, (short)3);
  private static final org.apache.thrift.protocol.TField EXP_AVAILABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("expAvailable", org.apache.thrift.protocol.TType.BOOL, (short)4);
  private static final org.apache.thrift.protocol.TField COD_AVAILABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("codAvailable", org.apache.thrift.protocol.TType.BOOL, (short)5);
  private static final org.apache.thrift.protocol.TField OTG_AVAILABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("otgAvailable", org.apache.thrift.protocol.TType.BOOL, (short)6);
  private static final org.apache.thrift.protocol.TField COD_LIMIT_FIELD_DESC = new org.apache.thrift.protocol.TField("codLimit", org.apache.thrift.protocol.TType.I64, (short)7);
  private static final org.apache.thrift.protocol.TField PREPAID_LIMIT_FIELD_DESC = new org.apache.thrift.protocol.TField("prepaidLimit", org.apache.thrift.protocol.TType.I64, (short)8);
  private static final org.apache.thrift.protocol.TField WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("warehouseId", org.apache.thrift.protocol.TType.I64, (short)9);
  private static final org.apache.thrift.protocol.TField DELIVERY_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("deliveryTime", org.apache.thrift.protocol.TType.I64, (short)10);
  private static final org.apache.thrift.protocol.TField DELIVERY_DELAY_FIELD_DESC = new org.apache.thrift.protocol.TField("delivery_delay", org.apache.thrift.protocol.TType.I64, (short)11);

  private long providerId; // required
  private String pinCode; // required
  private String destinationCode; // required
  private boolean expAvailable; // required
  private boolean codAvailable; // required
  private boolean otgAvailable; // required
  private long codLimit; // required
  private long prepaidLimit; // required
  private long warehouseId; // required
  private long deliveryTime; // required
  private long delivery_delay; // 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 {
    PROVIDER_ID((short)1, "providerId"),
    PIN_CODE((short)2, "pinCode"),
    DESTINATION_CODE((short)3, "destinationCode"),
    EXP_AVAILABLE((short)4, "expAvailable"),
    COD_AVAILABLE((short)5, "codAvailable"),
    OTG_AVAILABLE((short)6, "otgAvailable"),
    COD_LIMIT((short)7, "codLimit"),
    PREPAID_LIMIT((short)8, "prepaidLimit"),
    WAREHOUSE_ID((short)9, "warehouseId"),
    DELIVERY_TIME((short)10, "deliveryTime"),
    DELIVERY_DELAY((short)11, "delivery_delay");

    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: // PROVIDER_ID
          return PROVIDER_ID;
        case 2: // PIN_CODE
          return PIN_CODE;
        case 3: // DESTINATION_CODE
          return DESTINATION_CODE;
        case 4: // EXP_AVAILABLE
          return EXP_AVAILABLE;
        case 5: // COD_AVAILABLE
          return COD_AVAILABLE;
        case 6: // OTG_AVAILABLE
          return OTG_AVAILABLE;
        case 7: // COD_LIMIT
          return COD_LIMIT;
        case 8: // PREPAID_LIMIT
          return PREPAID_LIMIT;
        case 9: // WAREHOUSE_ID
          return WAREHOUSE_ID;
        case 10: // DELIVERY_TIME
          return DELIVERY_TIME;
        case 11: // DELIVERY_DELAY
          return DELIVERY_DELAY;
        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 __PROVIDERID_ISSET_ID = 0;
  private static final int __EXPAVAILABLE_ISSET_ID = 1;
  private static final int __CODAVAILABLE_ISSET_ID = 2;
  private static final int __OTGAVAILABLE_ISSET_ID = 3;
  private static final int __CODLIMIT_ISSET_ID = 4;
  private static final int __PREPAIDLIMIT_ISSET_ID = 5;
  private static final int __WAREHOUSEID_ISSET_ID = 6;
  private static final int __DELIVERYTIME_ISSET_ID = 7;
  private static final int __DELIVERY_DELAY_ISSET_ID = 8;
  private BitSet __isset_bit_vector = new BitSet(9);

  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.PROVIDER_ID, new org.apache.thrift.meta_data.FieldMetaData("providerId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.PIN_CODE, new org.apache.thrift.meta_data.FieldMetaData("pinCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.DESTINATION_CODE, new org.apache.thrift.meta_data.FieldMetaData("destinationCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.EXP_AVAILABLE, new org.apache.thrift.meta_data.FieldMetaData("expAvailable", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.COD_AVAILABLE, new org.apache.thrift.meta_data.FieldMetaData("codAvailable", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.OTG_AVAILABLE, new org.apache.thrift.meta_data.FieldMetaData("otgAvailable", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.COD_LIMIT, new org.apache.thrift.meta_data.FieldMetaData("codLimit", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.PREPAID_LIMIT, new org.apache.thrift.meta_data.FieldMetaData("prepaidLimit", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("warehouseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.DELIVERY_TIME, new org.apache.thrift.meta_data.FieldMetaData("deliveryTime", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.DELIVERY_DELAY, new org.apache.thrift.meta_data.FieldMetaData("delivery_delay", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(LogisticsLocationInfo.class, metaDataMap);
  }

  public LogisticsLocationInfo() {
  }

  public LogisticsLocationInfo(
    long providerId,
    String pinCode,
    String destinationCode,
    boolean expAvailable,
    boolean codAvailable,
    boolean otgAvailable,
    long codLimit,
    long prepaidLimit,
    long warehouseId,
    long deliveryTime,
    long delivery_delay)
  {
    this();
    this.providerId = providerId;
    setProviderIdIsSet(true);
    this.pinCode = pinCode;
    this.destinationCode = destinationCode;
    this.expAvailable = expAvailable;
    setExpAvailableIsSet(true);
    this.codAvailable = codAvailable;
    setCodAvailableIsSet(true);
    this.otgAvailable = otgAvailable;
    setOtgAvailableIsSet(true);
    this.codLimit = codLimit;
    setCodLimitIsSet(true);
    this.prepaidLimit = prepaidLimit;
    setPrepaidLimitIsSet(true);
    this.warehouseId = warehouseId;
    setWarehouseIdIsSet(true);
    this.deliveryTime = deliveryTime;
    setDeliveryTimeIsSet(true);
    this.delivery_delay = delivery_delay;
    setDelivery_delayIsSet(true);
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public LogisticsLocationInfo(LogisticsLocationInfo other) {
    __isset_bit_vector.clear();
    __isset_bit_vector.or(other.__isset_bit_vector);
    this.providerId = other.providerId;
    if (other.isSetPinCode()) {
      this.pinCode = other.pinCode;
    }
    if (other.isSetDestinationCode()) {
      this.destinationCode = other.destinationCode;
    }
    this.expAvailable = other.expAvailable;
    this.codAvailable = other.codAvailable;
    this.otgAvailable = other.otgAvailable;
    this.codLimit = other.codLimit;
    this.prepaidLimit = other.prepaidLimit;
    this.warehouseId = other.warehouseId;
    this.deliveryTime = other.deliveryTime;
    this.delivery_delay = other.delivery_delay;
  }

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

  @Override
  public void clear() {
    setProviderIdIsSet(false);
    this.providerId = 0;
    this.pinCode = null;
    this.destinationCode = null;
    setExpAvailableIsSet(false);
    this.expAvailable = false;
    setCodAvailableIsSet(false);
    this.codAvailable = false;
    setOtgAvailableIsSet(false);
    this.otgAvailable = false;
    setCodLimitIsSet(false);
    this.codLimit = 0;
    setPrepaidLimitIsSet(false);
    this.prepaidLimit = 0;
    setWarehouseIdIsSet(false);
    this.warehouseId = 0;
    setDeliveryTimeIsSet(false);
    this.deliveryTime = 0;
    setDelivery_delayIsSet(false);
    this.delivery_delay = 0;
  }

  public long getProviderId() {
    return this.providerId;
  }

  public void setProviderId(long providerId) {
    this.providerId = providerId;
    setProviderIdIsSet(true);
  }

  public void unsetProviderId() {
    __isset_bit_vector.clear(__PROVIDERID_ISSET_ID);
  }

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

  public void setProviderIdIsSet(boolean value) {
    __isset_bit_vector.set(__PROVIDERID_ISSET_ID, value);
  }

  public String getPinCode() {
    return this.pinCode;
  }

  public void setPinCode(String pinCode) {
    this.pinCode = pinCode;
  }

  public void unsetPinCode() {
    this.pinCode = null;
  }

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

  public void setPinCodeIsSet(boolean value) {
    if (!value) {
      this.pinCode = null;
    }
  }

  public String getDestinationCode() {
    return this.destinationCode;
  }

  public void setDestinationCode(String destinationCode) {
    this.destinationCode = destinationCode;
  }

  public void unsetDestinationCode() {
    this.destinationCode = null;
  }

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

  public void setDestinationCodeIsSet(boolean value) {
    if (!value) {
      this.destinationCode = null;
    }
  }

  public boolean isExpAvailable() {
    return this.expAvailable;
  }

  public void setExpAvailable(boolean expAvailable) {
    this.expAvailable = expAvailable;
    setExpAvailableIsSet(true);
  }

  public void unsetExpAvailable() {
    __isset_bit_vector.clear(__EXPAVAILABLE_ISSET_ID);
  }

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

  public void setExpAvailableIsSet(boolean value) {
    __isset_bit_vector.set(__EXPAVAILABLE_ISSET_ID, value);
  }

  public boolean isCodAvailable() {
    return this.codAvailable;
  }

  public void setCodAvailable(boolean codAvailable) {
    this.codAvailable = codAvailable;
    setCodAvailableIsSet(true);
  }

  public void unsetCodAvailable() {
    __isset_bit_vector.clear(__CODAVAILABLE_ISSET_ID);
  }

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

  public void setCodAvailableIsSet(boolean value) {
    __isset_bit_vector.set(__CODAVAILABLE_ISSET_ID, value);
  }

  public boolean isOtgAvailable() {
    return this.otgAvailable;
  }

  public void setOtgAvailable(boolean otgAvailable) {
    this.otgAvailable = otgAvailable;
    setOtgAvailableIsSet(true);
  }

  public void unsetOtgAvailable() {
    __isset_bit_vector.clear(__OTGAVAILABLE_ISSET_ID);
  }

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

  public void setOtgAvailableIsSet(boolean value) {
    __isset_bit_vector.set(__OTGAVAILABLE_ISSET_ID, value);
  }

  public long getCodLimit() {
    return this.codLimit;
  }

  public void setCodLimit(long codLimit) {
    this.codLimit = codLimit;
    setCodLimitIsSet(true);
  }

  public void unsetCodLimit() {
    __isset_bit_vector.clear(__CODLIMIT_ISSET_ID);
  }

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

  public void setCodLimitIsSet(boolean value) {
    __isset_bit_vector.set(__CODLIMIT_ISSET_ID, value);
  }

  public long getPrepaidLimit() {
    return this.prepaidLimit;
  }

  public void setPrepaidLimit(long prepaidLimit) {
    this.prepaidLimit = prepaidLimit;
    setPrepaidLimitIsSet(true);
  }

  public void unsetPrepaidLimit() {
    __isset_bit_vector.clear(__PREPAIDLIMIT_ISSET_ID);
  }

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

  public void setPrepaidLimitIsSet(boolean value) {
    __isset_bit_vector.set(__PREPAIDLIMIT_ISSET_ID, value);
  }

  public long getWarehouseId() {
    return this.warehouseId;
  }

  public void setWarehouseId(long warehouseId) {
    this.warehouseId = warehouseId;
    setWarehouseIdIsSet(true);
  }

  public void unsetWarehouseId() {
    __isset_bit_vector.clear(__WAREHOUSEID_ISSET_ID);
  }

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

  public void setWarehouseIdIsSet(boolean value) {
    __isset_bit_vector.set(__WAREHOUSEID_ISSET_ID, value);
  }

  public long getDeliveryTime() {
    return this.deliveryTime;
  }

  public void setDeliveryTime(long deliveryTime) {
    this.deliveryTime = deliveryTime;
    setDeliveryTimeIsSet(true);
  }

  public void unsetDeliveryTime() {
    __isset_bit_vector.clear(__DELIVERYTIME_ISSET_ID);
  }

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

  public void setDeliveryTimeIsSet(boolean value) {
    __isset_bit_vector.set(__DELIVERYTIME_ISSET_ID, value);
  }

  public long getDelivery_delay() {
    return this.delivery_delay;
  }

  public void setDelivery_delay(long delivery_delay) {
    this.delivery_delay = delivery_delay;
    setDelivery_delayIsSet(true);
  }

  public void unsetDelivery_delay() {
    __isset_bit_vector.clear(__DELIVERY_DELAY_ISSET_ID);
  }

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

  public void setDelivery_delayIsSet(boolean value) {
    __isset_bit_vector.set(__DELIVERY_DELAY_ISSET_ID, value);
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case PROVIDER_ID:
      if (value == null) {
        unsetProviderId();
      } else {
        setProviderId((Long)value);
      }
      break;

    case PIN_CODE:
      if (value == null) {
        unsetPinCode();
      } else {
        setPinCode((String)value);
      }
      break;

    case DESTINATION_CODE:
      if (value == null) {
        unsetDestinationCode();
      } else {
        setDestinationCode((String)value);
      }
      break;

    case EXP_AVAILABLE:
      if (value == null) {
        unsetExpAvailable();
      } else {
        setExpAvailable((Boolean)value);
      }
      break;

    case COD_AVAILABLE:
      if (value == null) {
        unsetCodAvailable();
      } else {
        setCodAvailable((Boolean)value);
      }
      break;

    case OTG_AVAILABLE:
      if (value == null) {
        unsetOtgAvailable();
      } else {
        setOtgAvailable((Boolean)value);
      }
      break;

    case COD_LIMIT:
      if (value == null) {
        unsetCodLimit();
      } else {
        setCodLimit((Long)value);
      }
      break;

    case PREPAID_LIMIT:
      if (value == null) {
        unsetPrepaidLimit();
      } else {
        setPrepaidLimit((Long)value);
      }
      break;

    case WAREHOUSE_ID:
      if (value == null) {
        unsetWarehouseId();
      } else {
        setWarehouseId((Long)value);
      }
      break;

    case DELIVERY_TIME:
      if (value == null) {
        unsetDeliveryTime();
      } else {
        setDeliveryTime((Long)value);
      }
      break;

    case DELIVERY_DELAY:
      if (value == null) {
        unsetDelivery_delay();
      } else {
        setDelivery_delay((Long)value);
      }
      break;

    }
  }

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

    case PIN_CODE:
      return getPinCode();

    case DESTINATION_CODE:
      return getDestinationCode();

    case EXP_AVAILABLE:
      return Boolean.valueOf(isExpAvailable());

    case COD_AVAILABLE:
      return Boolean.valueOf(isCodAvailable());

    case OTG_AVAILABLE:
      return Boolean.valueOf(isOtgAvailable());

    case COD_LIMIT:
      return Long.valueOf(getCodLimit());

    case PREPAID_LIMIT:
      return Long.valueOf(getPrepaidLimit());

    case WAREHOUSE_ID:
      return Long.valueOf(getWarehouseId());

    case DELIVERY_TIME:
      return Long.valueOf(getDeliveryTime());

    case DELIVERY_DELAY:
      return Long.valueOf(getDelivery_delay());

    }
    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 PROVIDER_ID:
      return isSetProviderId();
    case PIN_CODE:
      return isSetPinCode();
    case DESTINATION_CODE:
      return isSetDestinationCode();
    case EXP_AVAILABLE:
      return isSetExpAvailable();
    case COD_AVAILABLE:
      return isSetCodAvailable();
    case OTG_AVAILABLE:
      return isSetOtgAvailable();
    case COD_LIMIT:
      return isSetCodLimit();
    case PREPAID_LIMIT:
      return isSetPrepaidLimit();
    case WAREHOUSE_ID:
      return isSetWarehouseId();
    case DELIVERY_TIME:
      return isSetDeliveryTime();
    case DELIVERY_DELAY:
      return isSetDelivery_delay();
    }
    throw new IllegalStateException();
  }

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

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

    boolean this_present_providerId = true;
    boolean that_present_providerId = true;
    if (this_present_providerId || that_present_providerId) {
      if (!(this_present_providerId && that_present_providerId))
        return false;
      if (this.providerId != that.providerId)
        return false;
    }

    boolean this_present_pinCode = true && this.isSetPinCode();
    boolean that_present_pinCode = true && that.isSetPinCode();
    if (this_present_pinCode || that_present_pinCode) {
      if (!(this_present_pinCode && that_present_pinCode))
        return false;
      if (!this.pinCode.equals(that.pinCode))
        return false;
    }

    boolean this_present_destinationCode = true && this.isSetDestinationCode();
    boolean that_present_destinationCode = true && that.isSetDestinationCode();
    if (this_present_destinationCode || that_present_destinationCode) {
      if (!(this_present_destinationCode && that_present_destinationCode))
        return false;
      if (!this.destinationCode.equals(that.destinationCode))
        return false;
    }

    boolean this_present_expAvailable = true;
    boolean that_present_expAvailable = true;
    if (this_present_expAvailable || that_present_expAvailable) {
      if (!(this_present_expAvailable && that_present_expAvailable))
        return false;
      if (this.expAvailable != that.expAvailable)
        return false;
    }

    boolean this_present_codAvailable = true;
    boolean that_present_codAvailable = true;
    if (this_present_codAvailable || that_present_codAvailable) {
      if (!(this_present_codAvailable && that_present_codAvailable))
        return false;
      if (this.codAvailable != that.codAvailable)
        return false;
    }

    boolean this_present_otgAvailable = true;
    boolean that_present_otgAvailable = true;
    if (this_present_otgAvailable || that_present_otgAvailable) {
      if (!(this_present_otgAvailable && that_present_otgAvailable))
        return false;
      if (this.otgAvailable != that.otgAvailable)
        return false;
    }

    boolean this_present_codLimit = true;
    boolean that_present_codLimit = true;
    if (this_present_codLimit || that_present_codLimit) {
      if (!(this_present_codLimit && that_present_codLimit))
        return false;
      if (this.codLimit != that.codLimit)
        return false;
    }

    boolean this_present_prepaidLimit = true;
    boolean that_present_prepaidLimit = true;
    if (this_present_prepaidLimit || that_present_prepaidLimit) {
      if (!(this_present_prepaidLimit && that_present_prepaidLimit))
        return false;
      if (this.prepaidLimit != that.prepaidLimit)
        return false;
    }

    boolean this_present_warehouseId = true;
    boolean that_present_warehouseId = true;
    if (this_present_warehouseId || that_present_warehouseId) {
      if (!(this_present_warehouseId && that_present_warehouseId))
        return false;
      if (this.warehouseId != that.warehouseId)
        return false;
    }

    boolean this_present_deliveryTime = true;
    boolean that_present_deliveryTime = true;
    if (this_present_deliveryTime || that_present_deliveryTime) {
      if (!(this_present_deliveryTime && that_present_deliveryTime))
        return false;
      if (this.deliveryTime != that.deliveryTime)
        return false;
    }

    boolean this_present_delivery_delay = true;
    boolean that_present_delivery_delay = true;
    if (this_present_delivery_delay || that_present_delivery_delay) {
      if (!(this_present_delivery_delay && that_present_delivery_delay))
        return false;
      if (this.delivery_delay != that.delivery_delay)
        return false;
    }

    return true;
  }

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

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

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

    lastComparison = Boolean.valueOf(isSetProviderId()).compareTo(typedOther.isSetProviderId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetProviderId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.providerId, typedOther.providerId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetPinCode()).compareTo(typedOther.isSetPinCode());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPinCode()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pinCode, typedOther.pinCode);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDestinationCode()).compareTo(typedOther.isSetDestinationCode());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDestinationCode()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.destinationCode, typedOther.destinationCode);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetExpAvailable()).compareTo(typedOther.isSetExpAvailable());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetExpAvailable()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.expAvailable, typedOther.expAvailable);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCodAvailable()).compareTo(typedOther.isSetCodAvailable());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCodAvailable()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.codAvailable, typedOther.codAvailable);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetOtgAvailable()).compareTo(typedOther.isSetOtgAvailable());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOtgAvailable()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.otgAvailable, typedOther.otgAvailable);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCodLimit()).compareTo(typedOther.isSetCodLimit());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCodLimit()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.codLimit, typedOther.codLimit);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetPrepaidLimit()).compareTo(typedOther.isSetPrepaidLimit());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPrepaidLimit()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.prepaidLimit, typedOther.prepaidLimit);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetWarehouseId()).compareTo(typedOther.isSetWarehouseId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetWarehouseId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.warehouseId, typedOther.warehouseId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDeliveryTime()).compareTo(typedOther.isSetDeliveryTime());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDeliveryTime()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.deliveryTime, typedOther.deliveryTime);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDelivery_delay()).compareTo(typedOther.isSetDelivery_delay());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDelivery_delay()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.delivery_delay, typedOther.delivery_delay);
      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: // PROVIDER_ID
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.providerId = iprot.readI64();
            setProviderIdIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 2: // PIN_CODE
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.pinCode = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 3: // DESTINATION_CODE
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.destinationCode = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 4: // EXP_AVAILABLE
          if (field.type == org.apache.thrift.protocol.TType.BOOL) {
            this.expAvailable = iprot.readBool();
            setExpAvailableIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 5: // COD_AVAILABLE
          if (field.type == org.apache.thrift.protocol.TType.BOOL) {
            this.codAvailable = iprot.readBool();
            setCodAvailableIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 6: // OTG_AVAILABLE
          if (field.type == org.apache.thrift.protocol.TType.BOOL) {
            this.otgAvailable = iprot.readBool();
            setOtgAvailableIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 7: // COD_LIMIT
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.codLimit = iprot.readI64();
            setCodLimitIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 8: // PREPAID_LIMIT
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.prepaidLimit = iprot.readI64();
            setPrepaidLimitIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 9: // WAREHOUSE_ID
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.warehouseId = iprot.readI64();
            setWarehouseIdIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 10: // DELIVERY_TIME
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.deliveryTime = iprot.readI64();
            setDeliveryTimeIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 11: // DELIVERY_DELAY
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.delivery_delay = iprot.readI64();
            setDelivery_delayIsSet(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(PROVIDER_ID_FIELD_DESC);
    oprot.writeI64(this.providerId);
    oprot.writeFieldEnd();
    if (this.pinCode != null) {
      oprot.writeFieldBegin(PIN_CODE_FIELD_DESC);
      oprot.writeString(this.pinCode);
      oprot.writeFieldEnd();
    }
    if (this.destinationCode != null) {
      oprot.writeFieldBegin(DESTINATION_CODE_FIELD_DESC);
      oprot.writeString(this.destinationCode);
      oprot.writeFieldEnd();
    }
    oprot.writeFieldBegin(EXP_AVAILABLE_FIELD_DESC);
    oprot.writeBool(this.expAvailable);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(COD_AVAILABLE_FIELD_DESC);
    oprot.writeBool(this.codAvailable);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(OTG_AVAILABLE_FIELD_DESC);
    oprot.writeBool(this.otgAvailable);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(COD_LIMIT_FIELD_DESC);
    oprot.writeI64(this.codLimit);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(PREPAID_LIMIT_FIELD_DESC);
    oprot.writeI64(this.prepaidLimit);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(WAREHOUSE_ID_FIELD_DESC);
    oprot.writeI64(this.warehouseId);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(DELIVERY_TIME_FIELD_DESC);
    oprot.writeI64(this.deliveryTime);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(DELIVERY_DELAY_FIELD_DESC);
    oprot.writeI64(this.delivery_delay);
    oprot.writeFieldEnd();
    oprot.writeFieldStop();
    oprot.writeStructEnd();
  }

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

    sb.append("providerId:");
    sb.append(this.providerId);
    first = false;
    if (!first) sb.append(", ");
    sb.append("pinCode:");
    if (this.pinCode == null) {
      sb.append("null");
    } else {
      sb.append(this.pinCode);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("destinationCode:");
    if (this.destinationCode == null) {
      sb.append("null");
    } else {
      sb.append(this.destinationCode);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("expAvailable:");
    sb.append(this.expAvailable);
    first = false;
    if (!first) sb.append(", ");
    sb.append("codAvailable:");
    sb.append(this.codAvailable);
    first = false;
    if (!first) sb.append(", ");
    sb.append("otgAvailable:");
    sb.append(this.otgAvailable);
    first = false;
    if (!first) sb.append(", ");
    sb.append("codLimit:");
    sb.append(this.codLimit);
    first = false;
    if (!first) sb.append(", ");
    sb.append("prepaidLimit:");
    sb.append(this.prepaidLimit);
    first = false;
    if (!first) sb.append(", ");
    sb.append("warehouseId:");
    sb.append(this.warehouseId);
    first = false;
    if (!first) sb.append(", ");
    sb.append("deliveryTime:");
    sb.append(this.deliveryTime);
    first = false;
    if (!first) sb.append(", ");
    sb.append("delivery_delay:");
    sb.append(this.delivery_delay);
    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);
    }
  }

}