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

cicada.userdriver.config.ReceiveAddress Maven / Gradle / Ivy

There is a newer version: 1.0.6.6
Show newest version
/**
 * Autogenerated by Thrift Compiler (0.10.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package cicada.userdriver.config;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)", date = "2017-08-15")
public class ReceiveAddress implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ReceiveAddress");

  private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField USER_BASE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("userBaseId", org.apache.thrift.protocol.TType.STRING, (short)2);
  private static final org.apache.thrift.protocol.TField CONSIGNEE_FIELD_DESC = new org.apache.thrift.protocol.TField("consignee", org.apache.thrift.protocol.TType.STRING, (short)3);
  private static final org.apache.thrift.protocol.TField PHONE_FIELD_DESC = new org.apache.thrift.protocol.TField("phone", org.apache.thrift.protocol.TType.STRING, (short)4);
  private static final org.apache.thrift.protocol.TField AREA_INFO_FIELD_DESC = new org.apache.thrift.protocol.TField("areaInfo", org.apache.thrift.protocol.TType.STRING, (short)5);
  private static final org.apache.thrift.protocol.TField AREA_INFO_STRING_FIELD_DESC = new org.apache.thrift.protocol.TField("areaInfoString", org.apache.thrift.protocol.TType.STRING, (short)6);
  private static final org.apache.thrift.protocol.TField ADDRESS_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("addressName", org.apache.thrift.protocol.TType.STRING, (short)7);
  private static final org.apache.thrift.protocol.TField IS_DEFAULT_ADDRESS_FIELD_DESC = new org.apache.thrift.protocol.TField("isDefaultAddress", org.apache.thrift.protocol.TType.BOOL, (short)8);

  private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new ReceiveAddressStandardSchemeFactory();
  private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new ReceiveAddressTupleSchemeFactory();

  public String id; // required
  public String userBaseId; // required
  public String consignee; // required
  public String phone; // required
  public String areaInfo; // required
  public String areaInfoString; // required
  public String addressName; // required
  public boolean isDefaultAddress; // 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 {
    ID((short)1, "id"),
    USER_BASE_ID((short)2, "userBaseId"),
    CONSIGNEE((short)3, "consignee"),
    PHONE((short)4, "phone"),
    AREA_INFO((short)5, "areaInfo"),
    AREA_INFO_STRING((short)6, "areaInfoString"),
    ADDRESS_NAME((short)7, "addressName"),
    IS_DEFAULT_ADDRESS((short)8, "isDefaultAddress");

    private static final java.util.Map byName = new java.util.HashMap();

    static {
      for (_Fields field : java.util.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: // ID
          return ID;
        case 2: // USER_BASE_ID
          return USER_BASE_ID;
        case 3: // CONSIGNEE
          return CONSIGNEE;
        case 4: // PHONE
          return PHONE;
        case 5: // AREA_INFO
          return AREA_INFO;
        case 6: // AREA_INFO_STRING
          return AREA_INFO_STRING;
        case 7: // ADDRESS_NAME
          return ADDRESS_NAME;
        case 8: // IS_DEFAULT_ADDRESS
          return IS_DEFAULT_ADDRESS;
        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 __ISDEFAULTADDRESS_ISSET_ID = 0;
  private byte __isset_bitfield = 0;
  public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.USER_BASE_ID, new org.apache.thrift.meta_data.FieldMetaData("userBaseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.CONSIGNEE, new org.apache.thrift.meta_data.FieldMetaData("consignee", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.PHONE, new org.apache.thrift.meta_data.FieldMetaData("phone", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.AREA_INFO, new org.apache.thrift.meta_data.FieldMetaData("areaInfo", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.AREA_INFO_STRING, new org.apache.thrift.meta_data.FieldMetaData("areaInfoString", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.ADDRESS_NAME, new org.apache.thrift.meta_data.FieldMetaData("addressName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.IS_DEFAULT_ADDRESS, new org.apache.thrift.meta_data.FieldMetaData("isDefaultAddress", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ReceiveAddress.class, metaDataMap);
  }

  public ReceiveAddress() {
  }

  public ReceiveAddress(
    String id,
    String userBaseId,
    String consignee,
    String phone,
    String areaInfo,
    String areaInfoString,
    String addressName,
    boolean isDefaultAddress)
  {
    this();
    this.id = id;
    this.userBaseId = userBaseId;
    this.consignee = consignee;
    this.phone = phone;
    this.areaInfo = areaInfo;
    this.areaInfoString = areaInfoString;
    this.addressName = addressName;
    this.isDefaultAddress = isDefaultAddress;
    setIsDefaultAddressIsSet(true);
  }

  /**
   * Performs a deep copy on other.
   */
  public ReceiveAddress(ReceiveAddress other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetId()) {
      this.id = other.id;
    }
    if (other.isSetUserBaseId()) {
      this.userBaseId = other.userBaseId;
    }
    if (other.isSetConsignee()) {
      this.consignee = other.consignee;
    }
    if (other.isSetPhone()) {
      this.phone = other.phone;
    }
    if (other.isSetAreaInfo()) {
      this.areaInfo = other.areaInfo;
    }
    if (other.isSetAreaInfoString()) {
      this.areaInfoString = other.areaInfoString;
    }
    if (other.isSetAddressName()) {
      this.addressName = other.addressName;
    }
    this.isDefaultAddress = other.isDefaultAddress;
  }

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

  @Override
  public void clear() {
    this.id = null;
    this.userBaseId = null;
    this.consignee = null;
    this.phone = null;
    this.areaInfo = null;
    this.areaInfoString = null;
    this.addressName = null;
    setIsDefaultAddressIsSet(false);
    this.isDefaultAddress = false;
  }

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

  public ReceiveAddress setId(String id) {
    this.id = id;
    return this;
  }

  public void unsetId() {
    this.id = null;
  }

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

  public void setIdIsSet(boolean value) {
    if (!value) {
      this.id = null;
    }
  }

  public String getUserBaseId() {
    return this.userBaseId;
  }

  public ReceiveAddress setUserBaseId(String userBaseId) {
    this.userBaseId = userBaseId;
    return this;
  }

  public void unsetUserBaseId() {
    this.userBaseId = null;
  }

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

  public void setUserBaseIdIsSet(boolean value) {
    if (!value) {
      this.userBaseId = null;
    }
  }

  public String getConsignee() {
    return this.consignee;
  }

  public ReceiveAddress setConsignee(String consignee) {
    this.consignee = consignee;
    return this;
  }

  public void unsetConsignee() {
    this.consignee = null;
  }

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

  public void setConsigneeIsSet(boolean value) {
    if (!value) {
      this.consignee = null;
    }
  }

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

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

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

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

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

  public String getAreaInfo() {
    return this.areaInfo;
  }

  public ReceiveAddress setAreaInfo(String areaInfo) {
    this.areaInfo = areaInfo;
    return this;
  }

  public void unsetAreaInfo() {
    this.areaInfo = null;
  }

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

  public void setAreaInfoIsSet(boolean value) {
    if (!value) {
      this.areaInfo = null;
    }
  }

  public String getAreaInfoString() {
    return this.areaInfoString;
  }

  public ReceiveAddress setAreaInfoString(String areaInfoString) {
    this.areaInfoString = areaInfoString;
    return this;
  }

  public void unsetAreaInfoString() {
    this.areaInfoString = null;
  }

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

  public void setAreaInfoStringIsSet(boolean value) {
    if (!value) {
      this.areaInfoString = null;
    }
  }

  public String getAddressName() {
    return this.addressName;
  }

  public ReceiveAddress setAddressName(String addressName) {
    this.addressName = addressName;
    return this;
  }

  public void unsetAddressName() {
    this.addressName = null;
  }

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

  public void setAddressNameIsSet(boolean value) {
    if (!value) {
      this.addressName = null;
    }
  }

  public boolean isIsDefaultAddress() {
    return this.isDefaultAddress;
  }

  public ReceiveAddress setIsDefaultAddress(boolean isDefaultAddress) {
    this.isDefaultAddress = isDefaultAddress;
    setIsDefaultAddressIsSet(true);
    return this;
  }

  public void unsetIsDefaultAddress() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ISDEFAULTADDRESS_ISSET_ID);
  }

  /** Returns true if field isDefaultAddress is set (has been assigned a value) and false otherwise */
  public boolean isSetIsDefaultAddress() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ISDEFAULTADDRESS_ISSET_ID);
  }

  public void setIsDefaultAddressIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ISDEFAULTADDRESS_ISSET_ID, value);
  }

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

    case USER_BASE_ID:
      if (value == null) {
        unsetUserBaseId();
      } else {
        setUserBaseId((String)value);
      }
      break;

    case CONSIGNEE:
      if (value == null) {
        unsetConsignee();
      } else {
        setConsignee((String)value);
      }
      break;

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

    case AREA_INFO:
      if (value == null) {
        unsetAreaInfo();
      } else {
        setAreaInfo((String)value);
      }
      break;

    case AREA_INFO_STRING:
      if (value == null) {
        unsetAreaInfoString();
      } else {
        setAreaInfoString((String)value);
      }
      break;

    case ADDRESS_NAME:
      if (value == null) {
        unsetAddressName();
      } else {
        setAddressName((String)value);
      }
      break;

    case IS_DEFAULT_ADDRESS:
      if (value == null) {
        unsetIsDefaultAddress();
      } else {
        setIsDefaultAddress((Boolean)value);
      }
      break;

    }
  }

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

    case USER_BASE_ID:
      return getUserBaseId();

    case CONSIGNEE:
      return getConsignee();

    case PHONE:
      return getPhone();

    case AREA_INFO:
      return getAreaInfo();

    case AREA_INFO_STRING:
      return getAreaInfoString();

    case ADDRESS_NAME:
      return getAddressName();

    case IS_DEFAULT_ADDRESS:
      return isIsDefaultAddress();

    }
    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 ID:
      return isSetId();
    case USER_BASE_ID:
      return isSetUserBaseId();
    case CONSIGNEE:
      return isSetConsignee();
    case PHONE:
      return isSetPhone();
    case AREA_INFO:
      return isSetAreaInfo();
    case AREA_INFO_STRING:
      return isSetAreaInfoString();
    case ADDRESS_NAME:
      return isSetAddressName();
    case IS_DEFAULT_ADDRESS:
      return isSetIsDefaultAddress();
    }
    throw new IllegalStateException();
  }

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

  public boolean equals(ReceiveAddress that) {
    if (that == null)
      return false;
    if (this == that)
      return true;

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

    boolean this_present_userBaseId = true && this.isSetUserBaseId();
    boolean that_present_userBaseId = true && that.isSetUserBaseId();
    if (this_present_userBaseId || that_present_userBaseId) {
      if (!(this_present_userBaseId && that_present_userBaseId))
        return false;
      if (!this.userBaseId.equals(that.userBaseId))
        return false;
    }

    boolean this_present_consignee = true && this.isSetConsignee();
    boolean that_present_consignee = true && that.isSetConsignee();
    if (this_present_consignee || that_present_consignee) {
      if (!(this_present_consignee && that_present_consignee))
        return false;
      if (!this.consignee.equals(that.consignee))
        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_areaInfo = true && this.isSetAreaInfo();
    boolean that_present_areaInfo = true && that.isSetAreaInfo();
    if (this_present_areaInfo || that_present_areaInfo) {
      if (!(this_present_areaInfo && that_present_areaInfo))
        return false;
      if (!this.areaInfo.equals(that.areaInfo))
        return false;
    }

    boolean this_present_areaInfoString = true && this.isSetAreaInfoString();
    boolean that_present_areaInfoString = true && that.isSetAreaInfoString();
    if (this_present_areaInfoString || that_present_areaInfoString) {
      if (!(this_present_areaInfoString && that_present_areaInfoString))
        return false;
      if (!this.areaInfoString.equals(that.areaInfoString))
        return false;
    }

    boolean this_present_addressName = true && this.isSetAddressName();
    boolean that_present_addressName = true && that.isSetAddressName();
    if (this_present_addressName || that_present_addressName) {
      if (!(this_present_addressName && that_present_addressName))
        return false;
      if (!this.addressName.equals(that.addressName))
        return false;
    }

    boolean this_present_isDefaultAddress = true;
    boolean that_present_isDefaultAddress = true;
    if (this_present_isDefaultAddress || that_present_isDefaultAddress) {
      if (!(this_present_isDefaultAddress && that_present_isDefaultAddress))
        return false;
      if (this.isDefaultAddress != that.isDefaultAddress)
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    int hashCode = 1;

    hashCode = hashCode * 8191 + ((isSetId()) ? 131071 : 524287);
    if (isSetId())
      hashCode = hashCode * 8191 + id.hashCode();

    hashCode = hashCode * 8191 + ((isSetUserBaseId()) ? 131071 : 524287);
    if (isSetUserBaseId())
      hashCode = hashCode * 8191 + userBaseId.hashCode();

    hashCode = hashCode * 8191 + ((isSetConsignee()) ? 131071 : 524287);
    if (isSetConsignee())
      hashCode = hashCode * 8191 + consignee.hashCode();

    hashCode = hashCode * 8191 + ((isSetPhone()) ? 131071 : 524287);
    if (isSetPhone())
      hashCode = hashCode * 8191 + phone.hashCode();

    hashCode = hashCode * 8191 + ((isSetAreaInfo()) ? 131071 : 524287);
    if (isSetAreaInfo())
      hashCode = hashCode * 8191 + areaInfo.hashCode();

    hashCode = hashCode * 8191 + ((isSetAreaInfoString()) ? 131071 : 524287);
    if (isSetAreaInfoString())
      hashCode = hashCode * 8191 + areaInfoString.hashCode();

    hashCode = hashCode * 8191 + ((isSetAddressName()) ? 131071 : 524287);
    if (isSetAddressName())
      hashCode = hashCode * 8191 + addressName.hashCode();

    hashCode = hashCode * 8191 + ((isDefaultAddress) ? 131071 : 524287);

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetUserBaseId()).compareTo(other.isSetUserBaseId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUserBaseId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userBaseId, other.userBaseId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetConsignee()).compareTo(other.isSetConsignee());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetConsignee()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.consignee, other.consignee);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetPhone()).compareTo(other.isSetPhone());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPhone()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.phone, other.phone);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAreaInfo()).compareTo(other.isSetAreaInfo());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAreaInfo()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.areaInfo, other.areaInfo);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAreaInfoString()).compareTo(other.isSetAreaInfoString());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAreaInfoString()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.areaInfoString, other.areaInfoString);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAddressName()).compareTo(other.isSetAddressName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAddressName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.addressName, other.addressName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetIsDefaultAddress()).compareTo(other.isSetIsDefaultAddress());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetIsDefaultAddress()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isDefaultAddress, other.isDefaultAddress);
      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 {
    scheme(iprot).read(iprot, this);
  }

  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    scheme(oprot).write(oprot, this);
  }

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

    sb.append("id:");
    if (this.id == null) {
      sb.append("null");
    } else {
      sb.append(this.id);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("userBaseId:");
    if (this.userBaseId == null) {
      sb.append("null");
    } else {
      sb.append(this.userBaseId);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("consignee:");
    if (this.consignee == null) {
      sb.append("null");
    } else {
      sb.append(this.consignee);
    }
    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("areaInfo:");
    if (this.areaInfo == null) {
      sb.append("null");
    } else {
      sb.append(this.areaInfo);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("areaInfoString:");
    if (this.areaInfoString == null) {
      sb.append("null");
    } else {
      sb.append(this.areaInfoString);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("addressName:");
    if (this.addressName == null) {
      sb.append("null");
    } else {
      sb.append(this.addressName);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("isDefaultAddress:");
    sb.append(this.isDefaultAddress);
    first = false;
    sb.append(")");
    return sb.toString();
  }

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

  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
    try {
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
    try {
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
      __isset_bitfield = 0;
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private static class ReceiveAddressStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public ReceiveAddressStandardScheme getScheme() {
      return new ReceiveAddressStandardScheme();
    }
  }

  private static class ReceiveAddressStandardScheme extends org.apache.thrift.scheme.StandardScheme {

    public void read(org.apache.thrift.protocol.TProtocol iprot, ReceiveAddress struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true)
      {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (schemeField.id) {
          case 1: // ID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.id = iprot.readString();
              struct.setIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // USER_BASE_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.userBaseId = iprot.readString();
              struct.setUserBaseIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // CONSIGNEE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.consignee = iprot.readString();
              struct.setConsigneeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // PHONE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.phone = iprot.readString();
              struct.setPhoneIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // AREA_INFO
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.areaInfo = iprot.readString();
              struct.setAreaInfoIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // AREA_INFO_STRING
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.areaInfoString = iprot.readString();
              struct.setAreaInfoStringIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // ADDRESS_NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.addressName = iprot.readString();
              struct.setAddressNameIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // IS_DEFAULT_ADDRESS
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.isDefaultAddress = iprot.readBool();
              struct.setIsDefaultAddressIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      struct.validate();
    }

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

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.id != null) {
        oprot.writeFieldBegin(ID_FIELD_DESC);
        oprot.writeString(struct.id);
        oprot.writeFieldEnd();
      }
      if (struct.userBaseId != null) {
        oprot.writeFieldBegin(USER_BASE_ID_FIELD_DESC);
        oprot.writeString(struct.userBaseId);
        oprot.writeFieldEnd();
      }
      if (struct.consignee != null) {
        oprot.writeFieldBegin(CONSIGNEE_FIELD_DESC);
        oprot.writeString(struct.consignee);
        oprot.writeFieldEnd();
      }
      if (struct.phone != null) {
        oprot.writeFieldBegin(PHONE_FIELD_DESC);
        oprot.writeString(struct.phone);
        oprot.writeFieldEnd();
      }
      if (struct.areaInfo != null) {
        oprot.writeFieldBegin(AREA_INFO_FIELD_DESC);
        oprot.writeString(struct.areaInfo);
        oprot.writeFieldEnd();
      }
      if (struct.areaInfoString != null) {
        oprot.writeFieldBegin(AREA_INFO_STRING_FIELD_DESC);
        oprot.writeString(struct.areaInfoString);
        oprot.writeFieldEnd();
      }
      if (struct.addressName != null) {
        oprot.writeFieldBegin(ADDRESS_NAME_FIELD_DESC);
        oprot.writeString(struct.addressName);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(IS_DEFAULT_ADDRESS_FIELD_DESC);
      oprot.writeBool(struct.isDefaultAddress);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class ReceiveAddressTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public ReceiveAddressTupleScheme getScheme() {
      return new ReceiveAddressTupleScheme();
    }
  }

  private static class ReceiveAddressTupleScheme extends org.apache.thrift.scheme.TupleScheme {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, ReceiveAddress struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet optionals = new java.util.BitSet();
      if (struct.isSetId()) {
        optionals.set(0);
      }
      if (struct.isSetUserBaseId()) {
        optionals.set(1);
      }
      if (struct.isSetConsignee()) {
        optionals.set(2);
      }
      if (struct.isSetPhone()) {
        optionals.set(3);
      }
      if (struct.isSetAreaInfo()) {
        optionals.set(4);
      }
      if (struct.isSetAreaInfoString()) {
        optionals.set(5);
      }
      if (struct.isSetAddressName()) {
        optionals.set(6);
      }
      if (struct.isSetIsDefaultAddress()) {
        optionals.set(7);
      }
      oprot.writeBitSet(optionals, 8);
      if (struct.isSetId()) {
        oprot.writeString(struct.id);
      }
      if (struct.isSetUserBaseId()) {
        oprot.writeString(struct.userBaseId);
      }
      if (struct.isSetConsignee()) {
        oprot.writeString(struct.consignee);
      }
      if (struct.isSetPhone()) {
        oprot.writeString(struct.phone);
      }
      if (struct.isSetAreaInfo()) {
        oprot.writeString(struct.areaInfo);
      }
      if (struct.isSetAreaInfoString()) {
        oprot.writeString(struct.areaInfoString);
      }
      if (struct.isSetAddressName()) {
        oprot.writeString(struct.addressName);
      }
      if (struct.isSetIsDefaultAddress()) {
        oprot.writeBool(struct.isDefaultAddress);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, ReceiveAddress struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet incoming = iprot.readBitSet(8);
      if (incoming.get(0)) {
        struct.id = iprot.readString();
        struct.setIdIsSet(true);
      }
      if (incoming.get(1)) {
        struct.userBaseId = iprot.readString();
        struct.setUserBaseIdIsSet(true);
      }
      if (incoming.get(2)) {
        struct.consignee = iprot.readString();
        struct.setConsigneeIsSet(true);
      }
      if (incoming.get(3)) {
        struct.phone = iprot.readString();
        struct.setPhoneIsSet(true);
      }
      if (incoming.get(4)) {
        struct.areaInfo = iprot.readString();
        struct.setAreaInfoIsSet(true);
      }
      if (incoming.get(5)) {
        struct.areaInfoString = iprot.readString();
        struct.setAreaInfoStringIsSet(true);
      }
      if (incoming.get(6)) {
        struct.addressName = iprot.readString();
        struct.setAddressNameIsSet(true);
      }
      if (incoming.get(7)) {
        struct.isDefaultAddress = iprot.readBool();
        struct.setIsDefaultAddressIsSet(true);
      }
    }
  }

  private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
  }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy