Subversion Repositories SmartDukaan

Rev

Rev 6031 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

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

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

  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 AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("amount", org.apache.thrift.protocol.TType.I64, (short)2);
  private static final org.apache.thrift.protocol.TField TRANSACTION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("transactionId", org.apache.thrift.protocol.TType.I64, (short)3);
  private static final org.apache.thrift.protocol.TField INVOICE_NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("invoiceNumber", org.apache.thrift.protocol.TType.STRING, (short)4);
  private static final org.apache.thrift.protocol.TField ORDER_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("orderType", org.apache.thrift.protocol.TType.I32, (short)5);
  private static final org.apache.thrift.protocol.TField OPERATOR_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("operatorId", org.apache.thrift.protocol.TType.I64, (short)6);
  private static final org.apache.thrift.protocol.TField RECHARGE_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("rechargeType", org.apache.thrift.protocol.TType.I32, (short)7);
  private static final org.apache.thrift.protocol.TField RECHARGE_ORDER_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("rechargeOrderStatus", org.apache.thrift.protocol.TType.I32, (short)8);
  private static final org.apache.thrift.protocol.TField DEVICE_NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("deviceNumber", org.apache.thrift.protocol.TType.STRING, (short)9);
  private static final org.apache.thrift.protocol.TField CUSTOMER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("customerId", org.apache.thrift.protocol.TType.I64, (short)10);
  private static final org.apache.thrift.protocol.TField CUSTOMER_EMAIL_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("customerEmailId", org.apache.thrift.protocol.TType.I64, (short)11);
  private static final org.apache.thrift.protocol.TField CREATION_TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("creationTimestamp", org.apache.thrift.protocol.TType.I64, (short)12);

  private String id; // required
  private long amount; // required
  private long transactionId; // required
  private String invoiceNumber; // required
  private OrderType orderType; // required
  private long operatorId; // required
  private RechargeType rechargeType; // required
  private RechargeOrderStatus rechargeOrderStatus; // required
  private String deviceNumber; // required
  private long customerId; // required
  private long customerEmailId; // required
  private long creationTimestamp; // 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"),
    AMOUNT((short)2, "amount"),
    TRANSACTION_ID((short)3, "transactionId"),
    INVOICE_NUMBER((short)4, "invoiceNumber"),
    /**
     * 
     * @see OrderType
     */
    ORDER_TYPE((short)5, "orderType"),
    OPERATOR_ID((short)6, "operatorId"),
    /**
     * 
     * @see RechargeType
     */
    RECHARGE_TYPE((short)7, "rechargeType"),
    /**
     * 
     * @see RechargeOrderStatus
     */
    RECHARGE_ORDER_STATUS((short)8, "rechargeOrderStatus"),
    DEVICE_NUMBER((short)9, "deviceNumber"),
    CUSTOMER_ID((short)10, "customerId"),
    CUSTOMER_EMAIL_ID((short)11, "customerEmailId"),
    CREATION_TIMESTAMP((short)12, "creationTimestamp");

    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: // ID
          return ID;
        case 2: // AMOUNT
          return AMOUNT;
        case 3: // TRANSACTION_ID
          return TRANSACTION_ID;
        case 4: // INVOICE_NUMBER
          return INVOICE_NUMBER;
        case 5: // ORDER_TYPE
          return ORDER_TYPE;
        case 6: // OPERATOR_ID
          return OPERATOR_ID;
        case 7: // RECHARGE_TYPE
          return RECHARGE_TYPE;
        case 8: // RECHARGE_ORDER_STATUS
          return RECHARGE_ORDER_STATUS;
        case 9: // DEVICE_NUMBER
          return DEVICE_NUMBER;
        case 10: // CUSTOMER_ID
          return CUSTOMER_ID;
        case 11: // CUSTOMER_EMAIL_ID
          return CUSTOMER_EMAIL_ID;
        case 12: // CREATION_TIMESTAMP
          return CREATION_TIMESTAMP;
        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 __AMOUNT_ISSET_ID = 0;
  private static final int __TRANSACTIONID_ISSET_ID = 1;
  private static final int __OPERATORID_ISSET_ID = 2;
  private static final int __CUSTOMERID_ISSET_ID = 3;
  private static final int __CUSTOMEREMAILID_ISSET_ID = 4;
  private static final int __CREATIONTIMESTAMP_ISSET_ID = 5;
  private BitSet __isset_bit_vector = new BitSet(6);

  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.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.AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("amount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.TRANSACTION_ID, new org.apache.thrift.meta_data.FieldMetaData("transactionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.INVOICE_NUMBER, new org.apache.thrift.meta_data.FieldMetaData("invoiceNumber", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.ORDER_TYPE, new org.apache.thrift.meta_data.FieldMetaData("orderType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, OrderType.class)));
    tmpMap.put(_Fields.OPERATOR_ID, new org.apache.thrift.meta_data.FieldMetaData("operatorId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.RECHARGE_TYPE, new org.apache.thrift.meta_data.FieldMetaData("rechargeType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, RechargeType.class)));
    tmpMap.put(_Fields.RECHARGE_ORDER_STATUS, new org.apache.thrift.meta_data.FieldMetaData("rechargeOrderStatus", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, RechargeOrderStatus.class)));
    tmpMap.put(_Fields.DEVICE_NUMBER, new org.apache.thrift.meta_data.FieldMetaData("deviceNumber", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.CUSTOMER_ID, new org.apache.thrift.meta_data.FieldMetaData("customerId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.CUSTOMER_EMAIL_ID, new org.apache.thrift.meta_data.FieldMetaData("customerEmailId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.CREATION_TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("creationTimestamp", 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(RechargeOrder.class, metaDataMap);
  }

  public RechargeOrder() {
  }

  public RechargeOrder(
    String id,
    long amount,
    long transactionId,
    String invoiceNumber,
    OrderType orderType,
    long operatorId,
    RechargeType rechargeType,
    RechargeOrderStatus rechargeOrderStatus,
    String deviceNumber,
    long customerId,
    long customerEmailId,
    long creationTimestamp)
  {
    this();
    this.id = id;
    this.amount = amount;
    setAmountIsSet(true);
    this.transactionId = transactionId;
    setTransactionIdIsSet(true);
    this.invoiceNumber = invoiceNumber;
    this.orderType = orderType;
    this.operatorId = operatorId;
    setOperatorIdIsSet(true);
    this.rechargeType = rechargeType;
    this.rechargeOrderStatus = rechargeOrderStatus;
    this.deviceNumber = deviceNumber;
    this.customerId = customerId;
    setCustomerIdIsSet(true);
    this.customerEmailId = customerEmailId;
    setCustomerEmailIdIsSet(true);
    this.creationTimestamp = creationTimestamp;
    setCreationTimestampIsSet(true);
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public RechargeOrder(RechargeOrder other) {
    __isset_bit_vector.clear();
    __isset_bit_vector.or(other.__isset_bit_vector);
    if (other.isSetId()) {
      this.id = other.id;
    }
    this.amount = other.amount;
    this.transactionId = other.transactionId;
    if (other.isSetInvoiceNumber()) {
      this.invoiceNumber = other.invoiceNumber;
    }
    if (other.isSetOrderType()) {
      this.orderType = other.orderType;
    }
    this.operatorId = other.operatorId;
    if (other.isSetRechargeType()) {
      this.rechargeType = other.rechargeType;
    }
    if (other.isSetRechargeOrderStatus()) {
      this.rechargeOrderStatus = other.rechargeOrderStatus;
    }
    if (other.isSetDeviceNumber()) {
      this.deviceNumber = other.deviceNumber;
    }
    this.customerId = other.customerId;
    this.customerEmailId = other.customerEmailId;
    this.creationTimestamp = other.creationTimestamp;
  }

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

  @Override
  public void clear() {
    this.id = null;
    setAmountIsSet(false);
    this.amount = 0;
    setTransactionIdIsSet(false);
    this.transactionId = 0;
    this.invoiceNumber = null;
    this.orderType = null;
    setOperatorIdIsSet(false);
    this.operatorId = 0;
    this.rechargeType = null;
    this.rechargeOrderStatus = null;
    this.deviceNumber = null;
    setCustomerIdIsSet(false);
    this.customerId = 0;
    setCustomerEmailIdIsSet(false);
    this.customerEmailId = 0;
    setCreationTimestampIsSet(false);
    this.creationTimestamp = 0;
  }

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

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

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

  public void setAmount(long amount) {
    this.amount = amount;
    setAmountIsSet(true);
  }

  public void unsetAmount() {
    __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
  }

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

  public void setAmountIsSet(boolean value) {
    __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
  }

  public long getTransactionId() {
    return this.transactionId;
  }

  public void setTransactionId(long transactionId) {
    this.transactionId = transactionId;
    setTransactionIdIsSet(true);
  }

  public void unsetTransactionId() {
    __isset_bit_vector.clear(__TRANSACTIONID_ISSET_ID);
  }

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

  public void setTransactionIdIsSet(boolean value) {
    __isset_bit_vector.set(__TRANSACTIONID_ISSET_ID, value);
  }

  public String getInvoiceNumber() {
    return this.invoiceNumber;
  }

  public void setInvoiceNumber(String invoiceNumber) {
    this.invoiceNumber = invoiceNumber;
  }

  public void unsetInvoiceNumber() {
    this.invoiceNumber = null;
  }

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

  public void setInvoiceNumberIsSet(boolean value) {
    if (!value) {
      this.invoiceNumber = null;
    }
  }

  /**
   * 
   * @see OrderType
   */
  public OrderType getOrderType() {
    return this.orderType;
  }

  /**
   * 
   * @see OrderType
   */
  public void setOrderType(OrderType orderType) {
    this.orderType = orderType;
  }

  public void unsetOrderType() {
    this.orderType = null;
  }

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

  public void setOrderTypeIsSet(boolean value) {
    if (!value) {
      this.orderType = null;
    }
  }

  public long getOperatorId() {
    return this.operatorId;
  }

  public void setOperatorId(long operatorId) {
    this.operatorId = operatorId;
    setOperatorIdIsSet(true);
  }

  public void unsetOperatorId() {
    __isset_bit_vector.clear(__OPERATORID_ISSET_ID);
  }

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

  public void setOperatorIdIsSet(boolean value) {
    __isset_bit_vector.set(__OPERATORID_ISSET_ID, value);
  }

  /**
   * 
   * @see RechargeType
   */
  public RechargeType getRechargeType() {
    return this.rechargeType;
  }

  /**
   * 
   * @see RechargeType
   */
  public void setRechargeType(RechargeType rechargeType) {
    this.rechargeType = rechargeType;
  }

  public void unsetRechargeType() {
    this.rechargeType = null;
  }

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

  public void setRechargeTypeIsSet(boolean value) {
    if (!value) {
      this.rechargeType = null;
    }
  }

  /**
   * 
   * @see RechargeOrderStatus
   */
  public RechargeOrderStatus getRechargeOrderStatus() {
    return this.rechargeOrderStatus;
  }

  /**
   * 
   * @see RechargeOrderStatus
   */
  public void setRechargeOrderStatus(RechargeOrderStatus rechargeOrderStatus) {
    this.rechargeOrderStatus = rechargeOrderStatus;
  }

  public void unsetRechargeOrderStatus() {
    this.rechargeOrderStatus = null;
  }

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

  public void setRechargeOrderStatusIsSet(boolean value) {
    if (!value) {
      this.rechargeOrderStatus = null;
    }
  }

  public String getDeviceNumber() {
    return this.deviceNumber;
  }

  public void setDeviceNumber(String deviceNumber) {
    this.deviceNumber = deviceNumber;
  }

  public void unsetDeviceNumber() {
    this.deviceNumber = null;
  }

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

  public void setDeviceNumberIsSet(boolean value) {
    if (!value) {
      this.deviceNumber = null;
    }
  }

  public long getCustomerId() {
    return this.customerId;
  }

  public void setCustomerId(long customerId) {
    this.customerId = customerId;
    setCustomerIdIsSet(true);
  }

  public void unsetCustomerId() {
    __isset_bit_vector.clear(__CUSTOMERID_ISSET_ID);
  }

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

  public void setCustomerIdIsSet(boolean value) {
    __isset_bit_vector.set(__CUSTOMERID_ISSET_ID, value);
  }

  public long getCustomerEmailId() {
    return this.customerEmailId;
  }

  public void setCustomerEmailId(long customerEmailId) {
    this.customerEmailId = customerEmailId;
    setCustomerEmailIdIsSet(true);
  }

  public void unsetCustomerEmailId() {
    __isset_bit_vector.clear(__CUSTOMEREMAILID_ISSET_ID);
  }

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

  public void setCustomerEmailIdIsSet(boolean value) {
    __isset_bit_vector.set(__CUSTOMEREMAILID_ISSET_ID, value);
  }

  public long getCreationTimestamp() {
    return this.creationTimestamp;
  }

  public void setCreationTimestamp(long creationTimestamp) {
    this.creationTimestamp = creationTimestamp;
    setCreationTimestampIsSet(true);
  }

  public void unsetCreationTimestamp() {
    __isset_bit_vector.clear(__CREATIONTIMESTAMP_ISSET_ID);
  }

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

  public void setCreationTimestampIsSet(boolean value) {
    __isset_bit_vector.set(__CREATIONTIMESTAMP_ISSET_ID, value);
  }

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

    case AMOUNT:
      if (value == null) {
        unsetAmount();
      } else {
        setAmount((Long)value);
      }
      break;

    case TRANSACTION_ID:
      if (value == null) {
        unsetTransactionId();
      } else {
        setTransactionId((Long)value);
      }
      break;

    case INVOICE_NUMBER:
      if (value == null) {
        unsetInvoiceNumber();
      } else {
        setInvoiceNumber((String)value);
      }
      break;

    case ORDER_TYPE:
      if (value == null) {
        unsetOrderType();
      } else {
        setOrderType((OrderType)value);
      }
      break;

    case OPERATOR_ID:
      if (value == null) {
        unsetOperatorId();
      } else {
        setOperatorId((Long)value);
      }
      break;

    case RECHARGE_TYPE:
      if (value == null) {
        unsetRechargeType();
      } else {
        setRechargeType((RechargeType)value);
      }
      break;

    case RECHARGE_ORDER_STATUS:
      if (value == null) {
        unsetRechargeOrderStatus();
      } else {
        setRechargeOrderStatus((RechargeOrderStatus)value);
      }
      break;

    case DEVICE_NUMBER:
      if (value == null) {
        unsetDeviceNumber();
      } else {
        setDeviceNumber((String)value);
      }
      break;

    case CUSTOMER_ID:
      if (value == null) {
        unsetCustomerId();
      } else {
        setCustomerId((Long)value);
      }
      break;

    case CUSTOMER_EMAIL_ID:
      if (value == null) {
        unsetCustomerEmailId();
      } else {
        setCustomerEmailId((Long)value);
      }
      break;

    case CREATION_TIMESTAMP:
      if (value == null) {
        unsetCreationTimestamp();
      } else {
        setCreationTimestamp((Long)value);
      }
      break;

    }
  }

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

    case AMOUNT:
      return Long.valueOf(getAmount());

    case TRANSACTION_ID:
      return Long.valueOf(getTransactionId());

    case INVOICE_NUMBER:
      return getInvoiceNumber();

    case ORDER_TYPE:
      return getOrderType();

    case OPERATOR_ID:
      return Long.valueOf(getOperatorId());

    case RECHARGE_TYPE:
      return getRechargeType();

    case RECHARGE_ORDER_STATUS:
      return getRechargeOrderStatus();

    case DEVICE_NUMBER:
      return getDeviceNumber();

    case CUSTOMER_ID:
      return Long.valueOf(getCustomerId());

    case CUSTOMER_EMAIL_ID:
      return Long.valueOf(getCustomerEmailId());

    case CREATION_TIMESTAMP:
      return Long.valueOf(getCreationTimestamp());

    }
    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 AMOUNT:
      return isSetAmount();
    case TRANSACTION_ID:
      return isSetTransactionId();
    case INVOICE_NUMBER:
      return isSetInvoiceNumber();
    case ORDER_TYPE:
      return isSetOrderType();
    case OPERATOR_ID:
      return isSetOperatorId();
    case RECHARGE_TYPE:
      return isSetRechargeType();
    case RECHARGE_ORDER_STATUS:
      return isSetRechargeOrderStatus();
    case DEVICE_NUMBER:
      return isSetDeviceNumber();
    case CUSTOMER_ID:
      return isSetCustomerId();
    case CUSTOMER_EMAIL_ID:
      return isSetCustomerEmailId();
    case CREATION_TIMESTAMP:
      return isSetCreationTimestamp();
    }
    throw new IllegalStateException();
  }

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

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

    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_amount = true;
    boolean that_present_amount = true;
    if (this_present_amount || that_present_amount) {
      if (!(this_present_amount && that_present_amount))
        return false;
      if (this.amount != that.amount)
        return false;
    }

    boolean this_present_transactionId = true;
    boolean that_present_transactionId = true;
    if (this_present_transactionId || that_present_transactionId) {
      if (!(this_present_transactionId && that_present_transactionId))
        return false;
      if (this.transactionId != that.transactionId)
        return false;
    }

    boolean this_present_invoiceNumber = true && this.isSetInvoiceNumber();
    boolean that_present_invoiceNumber = true && that.isSetInvoiceNumber();
    if (this_present_invoiceNumber || that_present_invoiceNumber) {
      if (!(this_present_invoiceNumber && that_present_invoiceNumber))
        return false;
      if (!this.invoiceNumber.equals(that.invoiceNumber))
        return false;
    }

    boolean this_present_orderType = true && this.isSetOrderType();
    boolean that_present_orderType = true && that.isSetOrderType();
    if (this_present_orderType || that_present_orderType) {
      if (!(this_present_orderType && that_present_orderType))
        return false;
      if (!this.orderType.equals(that.orderType))
        return false;
    }

    boolean this_present_operatorId = true;
    boolean that_present_operatorId = true;
    if (this_present_operatorId || that_present_operatorId) {
      if (!(this_present_operatorId && that_present_operatorId))
        return false;
      if (this.operatorId != that.operatorId)
        return false;
    }

    boolean this_present_rechargeType = true && this.isSetRechargeType();
    boolean that_present_rechargeType = true && that.isSetRechargeType();
    if (this_present_rechargeType || that_present_rechargeType) {
      if (!(this_present_rechargeType && that_present_rechargeType))
        return false;
      if (!this.rechargeType.equals(that.rechargeType))
        return false;
    }

    boolean this_present_rechargeOrderStatus = true && this.isSetRechargeOrderStatus();
    boolean that_present_rechargeOrderStatus = true && that.isSetRechargeOrderStatus();
    if (this_present_rechargeOrderStatus || that_present_rechargeOrderStatus) {
      if (!(this_present_rechargeOrderStatus && that_present_rechargeOrderStatus))
        return false;
      if (!this.rechargeOrderStatus.equals(that.rechargeOrderStatus))
        return false;
    }

    boolean this_present_deviceNumber = true && this.isSetDeviceNumber();
    boolean that_present_deviceNumber = true && that.isSetDeviceNumber();
    if (this_present_deviceNumber || that_present_deviceNumber) {
      if (!(this_present_deviceNumber && that_present_deviceNumber))
        return false;
      if (!this.deviceNumber.equals(that.deviceNumber))
        return false;
    }

    boolean this_present_customerId = true;
    boolean that_present_customerId = true;
    if (this_present_customerId || that_present_customerId) {
      if (!(this_present_customerId && that_present_customerId))
        return false;
      if (this.customerId != that.customerId)
        return false;
    }

    boolean this_present_customerEmailId = true;
    boolean that_present_customerEmailId = true;
    if (this_present_customerEmailId || that_present_customerEmailId) {
      if (!(this_present_customerEmailId && that_present_customerEmailId))
        return false;
      if (this.customerEmailId != that.customerEmailId)
        return false;
    }

    boolean this_present_creationTimestamp = true;
    boolean that_present_creationTimestamp = true;
    if (this_present_creationTimestamp || that_present_creationTimestamp) {
      if (!(this_present_creationTimestamp && that_present_creationTimestamp))
        return false;
      if (this.creationTimestamp != that.creationTimestamp)
        return false;
    }

    return true;
  }

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

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

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

    lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAmount()).compareTo(typedOther.isSetAmount());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAmount()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amount, typedOther.amount);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTransactionId()).compareTo(typedOther.isSetTransactionId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTransactionId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transactionId, typedOther.transactionId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetInvoiceNumber()).compareTo(typedOther.isSetInvoiceNumber());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetInvoiceNumber()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.invoiceNumber, typedOther.invoiceNumber);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetOrderType()).compareTo(typedOther.isSetOrderType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOrderType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.orderType, typedOther.orderType);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetOperatorId()).compareTo(typedOther.isSetOperatorId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOperatorId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operatorId, typedOther.operatorId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetRechargeType()).compareTo(typedOther.isSetRechargeType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRechargeType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rechargeType, typedOther.rechargeType);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetRechargeOrderStatus()).compareTo(typedOther.isSetRechargeOrderStatus());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRechargeOrderStatus()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rechargeOrderStatus, typedOther.rechargeOrderStatus);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDeviceNumber()).compareTo(typedOther.isSetDeviceNumber());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDeviceNumber()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.deviceNumber, typedOther.deviceNumber);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCustomerId()).compareTo(typedOther.isSetCustomerId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCustomerId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.customerId, typedOther.customerId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCustomerEmailId()).compareTo(typedOther.isSetCustomerEmailId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCustomerEmailId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.customerEmailId, typedOther.customerEmailId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCreationTimestamp()).compareTo(typedOther.isSetCreationTimestamp());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCreationTimestamp()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.creationTimestamp, typedOther.creationTimestamp);
      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: // ID
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.id = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 2: // AMOUNT
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.amount = iprot.readI64();
            setAmountIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 3: // TRANSACTION_ID
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.transactionId = iprot.readI64();
            setTransactionIdIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 4: // INVOICE_NUMBER
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.invoiceNumber = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 5: // ORDER_TYPE
          if (field.type == org.apache.thrift.protocol.TType.I32) {
            this.orderType = OrderType.findByValue(iprot.readI32());
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 6: // OPERATOR_ID
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.operatorId = iprot.readI64();
            setOperatorIdIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 7: // RECHARGE_TYPE
          if (field.type == org.apache.thrift.protocol.TType.I32) {
            this.rechargeType = RechargeType.findByValue(iprot.readI32());
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 8: // RECHARGE_ORDER_STATUS
          if (field.type == org.apache.thrift.protocol.TType.I32) {
            this.rechargeOrderStatus = RechargeOrderStatus.findByValue(iprot.readI32());
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 9: // DEVICE_NUMBER
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.deviceNumber = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 10: // CUSTOMER_ID
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.customerId = iprot.readI64();
            setCustomerIdIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 11: // CUSTOMER_EMAIL_ID
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.customerEmailId = iprot.readI64();
            setCustomerEmailIdIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 12: // CREATION_TIMESTAMP
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.creationTimestamp = iprot.readI64();
            setCreationTimestampIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        default:
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
      }
      iprot.readFieldEnd();
    }
    iprot.readStructEnd();
    validate();
  }

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

    oprot.writeStructBegin(STRUCT_DESC);
    if (this.id != null) {
      oprot.writeFieldBegin(ID_FIELD_DESC);
      oprot.writeString(this.id);
      oprot.writeFieldEnd();
    }
    oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
    oprot.writeI64(this.amount);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(TRANSACTION_ID_FIELD_DESC);
    oprot.writeI64(this.transactionId);
    oprot.writeFieldEnd();
    if (this.invoiceNumber != null) {
      oprot.writeFieldBegin(INVOICE_NUMBER_FIELD_DESC);
      oprot.writeString(this.invoiceNumber);
      oprot.writeFieldEnd();
    }
    if (this.orderType != null) {
      oprot.writeFieldBegin(ORDER_TYPE_FIELD_DESC);
      oprot.writeI32(this.orderType.getValue());
      oprot.writeFieldEnd();
    }
    oprot.writeFieldBegin(OPERATOR_ID_FIELD_DESC);
    oprot.writeI64(this.operatorId);
    oprot.writeFieldEnd();
    if (this.rechargeType != null) {
      oprot.writeFieldBegin(RECHARGE_TYPE_FIELD_DESC);
      oprot.writeI32(this.rechargeType.getValue());
      oprot.writeFieldEnd();
    }
    if (this.rechargeOrderStatus != null) {
      oprot.writeFieldBegin(RECHARGE_ORDER_STATUS_FIELD_DESC);
      oprot.writeI32(this.rechargeOrderStatus.getValue());
      oprot.writeFieldEnd();
    }
    if (this.deviceNumber != null) {
      oprot.writeFieldBegin(DEVICE_NUMBER_FIELD_DESC);
      oprot.writeString(this.deviceNumber);
      oprot.writeFieldEnd();
    }
    oprot.writeFieldBegin(CUSTOMER_ID_FIELD_DESC);
    oprot.writeI64(this.customerId);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(CUSTOMER_EMAIL_ID_FIELD_DESC);
    oprot.writeI64(this.customerEmailId);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(CREATION_TIMESTAMP_FIELD_DESC);
    oprot.writeI64(this.creationTimestamp);
    oprot.writeFieldEnd();
    oprot.writeFieldStop();
    oprot.writeStructEnd();
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder("RechargeOrder(");
    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("amount:");
    sb.append(this.amount);
    first = false;
    if (!first) sb.append(", ");
    sb.append("transactionId:");
    sb.append(this.transactionId);
    first = false;
    if (!first) sb.append(", ");
    sb.append("invoiceNumber:");
    if (this.invoiceNumber == null) {
      sb.append("null");
    } else {
      sb.append(this.invoiceNumber);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("orderType:");
    if (this.orderType == null) {
      sb.append("null");
    } else {
      sb.append(this.orderType);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("operatorId:");
    sb.append(this.operatorId);
    first = false;
    if (!first) sb.append(", ");
    sb.append("rechargeType:");
    if (this.rechargeType == null) {
      sb.append("null");
    } else {
      sb.append(this.rechargeType);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("rechargeOrderStatus:");
    if (this.rechargeOrderStatus == null) {
      sb.append("null");
    } else {
      sb.append(this.rechargeOrderStatus);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("deviceNumber:");
    if (this.deviceNumber == null) {
      sb.append("null");
    } else {
      sb.append(this.deviceNumber);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("customerId:");
    sb.append(this.customerId);
    first = false;
    if (!first) sb.append(", ");
    sb.append("customerEmailId:");
    sb.append(this.customerEmailId);
    first = false;
    if (!first) sb.append(", ");
    sb.append("creationTimestamp:");
    sb.append(this.creationTimestamp);
    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);
    }
  }

}