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

  private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I64, (short)1);
  private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.I32, (short)2);
  private static final org.apache.thrift.protocol.TField CUSTOMER_EMAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("customer_email", org.apache.thrift.protocol.TType.STRING, (short)3);
  private static final org.apache.thrift.protocol.TField CUSTOMER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("customer_name", org.apache.thrift.protocol.TType.STRING, (short)4);
  private static final org.apache.thrift.protocol.TField CUSTOMER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("customer_id", org.apache.thrift.protocol.TType.I64, (short)5);
  private static final org.apache.thrift.protocol.TField ADDRESS_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("address_id", org.apache.thrift.protocol.TType.I64, (short)6);
  private static final org.apache.thrift.protocol.TField TICKET_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("ticketId", org.apache.thrift.protocol.TType.I64, (short)7);
  private static final org.apache.thrift.protocol.TField CREATED_AT_FIELD_DESC = new org.apache.thrift.protocol.TField("createdAt", org.apache.thrift.protocol.TType.I64, (short)8);
  private static final org.apache.thrift.protocol.TField PROCESSED_AT_FIELD_DESC = new org.apache.thrift.protocol.TField("processedAt", org.apache.thrift.protocol.TType.I64, (short)9);
  private static final org.apache.thrift.protocol.TField AUTHORIZED_AT_FIELD_DESC = new org.apache.thrift.protocol.TField("authorizedAt", org.apache.thrift.protocol.TType.I64, (short)10);
  private static final org.apache.thrift.protocol.TField CLOSED_AT_FIELD_DESC = new org.apache.thrift.protocol.TField("closedAt", org.apache.thrift.protocol.TType.I64, (short)11);
  private static final org.apache.thrift.protocol.TField CUSTOMER_ADDRESS_FIELD_DESC = new org.apache.thrift.protocol.TField("customerAddress", org.apache.thrift.protocol.TType.STRING, (short)12);
  private static final org.apache.thrift.protocol.TField PINCODE_FIELD_DESC = new org.apache.thrift.protocol.TField("pincode", org.apache.thrift.protocol.TType.STRING, (short)13);
  private static final org.apache.thrift.protocol.TField CUSTOMER_CITY_FIELD_DESC = new org.apache.thrift.protocol.TField("customerCity", org.apache.thrift.protocol.TType.STRING, (short)14);
  private static final org.apache.thrift.protocol.TField CUSTOMER_STATE_FIELD_DESC = new org.apache.thrift.protocol.TField("customerState", org.apache.thrift.protocol.TType.STRING, (short)15);
  private static final org.apache.thrift.protocol.TField CUSTOMER_PHONE_FIELD_DESC = new org.apache.thrift.protocol.TField("customerPhone", org.apache.thrift.protocol.TType.STRING, (short)16);
  private static final org.apache.thrift.protocol.TField RETURN_ORDERS_FIELD_DESC = new org.apache.thrift.protocol.TField("returnOrders", org.apache.thrift.protocol.TType.LIST, (short)17);

  private long id; // required
  private ReturnTransactionStatus status; // required
  private String customer_email; // required
  private String customer_name; // required
  private long customer_id; // required
  private long address_id; // required
  private long ticketId; // required
  private long createdAt; // required
  private long processedAt; // required
  private long authorizedAt; // required
  private long closedAt; // required
  private String customerAddress; // required
  private String pincode; // required
  private String customerCity; // required
  private String customerState; // required
  private String customerPhone; // required
  private List<ReturnOrderInfo> returnOrders; // 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"),
    /**
     * 
     * @see ReturnTransactionStatus
     */
    STATUS((short)2, "status"),
    CUSTOMER_EMAIL((short)3, "customer_email"),
    CUSTOMER_NAME((short)4, "customer_name"),
    CUSTOMER_ID((short)5, "customer_id"),
    ADDRESS_ID((short)6, "address_id"),
    TICKET_ID((short)7, "ticketId"),
    CREATED_AT((short)8, "createdAt"),
    PROCESSED_AT((short)9, "processedAt"),
    AUTHORIZED_AT((short)10, "authorizedAt"),
    CLOSED_AT((short)11, "closedAt"),
    CUSTOMER_ADDRESS((short)12, "customerAddress"),
    PINCODE((short)13, "pincode"),
    CUSTOMER_CITY((short)14, "customerCity"),
    CUSTOMER_STATE((short)15, "customerState"),
    CUSTOMER_PHONE((short)16, "customerPhone"),
    RETURN_ORDERS((short)17, "returnOrders");

    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: // STATUS
          return STATUS;
        case 3: // CUSTOMER_EMAIL
          return CUSTOMER_EMAIL;
        case 4: // CUSTOMER_NAME
          return CUSTOMER_NAME;
        case 5: // CUSTOMER_ID
          return CUSTOMER_ID;
        case 6: // ADDRESS_ID
          return ADDRESS_ID;
        case 7: // TICKET_ID
          return TICKET_ID;
        case 8: // CREATED_AT
          return CREATED_AT;
        case 9: // PROCESSED_AT
          return PROCESSED_AT;
        case 10: // AUTHORIZED_AT
          return AUTHORIZED_AT;
        case 11: // CLOSED_AT
          return CLOSED_AT;
        case 12: // CUSTOMER_ADDRESS
          return CUSTOMER_ADDRESS;
        case 13: // PINCODE
          return PINCODE;
        case 14: // CUSTOMER_CITY
          return CUSTOMER_CITY;
        case 15: // CUSTOMER_STATE
          return CUSTOMER_STATE;
        case 16: // CUSTOMER_PHONE
          return CUSTOMER_PHONE;
        case 17: // RETURN_ORDERS
          return RETURN_ORDERS;
        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 __ID_ISSET_ID = 0;
  private static final int __CUSTOMER_ID_ISSET_ID = 1;
  private static final int __ADDRESS_ID_ISSET_ID = 2;
  private static final int __TICKETID_ISSET_ID = 3;
  private static final int __CREATEDAT_ISSET_ID = 4;
  private static final int __PROCESSEDAT_ISSET_ID = 5;
  private static final int __AUTHORIZEDAT_ISSET_ID = 6;
  private static final int __CLOSEDAT_ISSET_ID = 7;
  private BitSet __isset_bit_vector = new BitSet(8);

  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.I64)));
    tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ReturnTransactionStatus.class)));
    tmpMap.put(_Fields.CUSTOMER_EMAIL, new org.apache.thrift.meta_data.FieldMetaData("customer_email", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.CUSTOMER_NAME, new org.apache.thrift.meta_data.FieldMetaData("customer_name", 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("customer_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.ADDRESS_ID, new org.apache.thrift.meta_data.FieldMetaData("address_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.TICKET_ID, new org.apache.thrift.meta_data.FieldMetaData("ticketId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.CREATED_AT, new org.apache.thrift.meta_data.FieldMetaData("createdAt", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.PROCESSED_AT, new org.apache.thrift.meta_data.FieldMetaData("processedAt", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.AUTHORIZED_AT, new org.apache.thrift.meta_data.FieldMetaData("authorizedAt", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.CLOSED_AT, new org.apache.thrift.meta_data.FieldMetaData("closedAt", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.CUSTOMER_ADDRESS, new org.apache.thrift.meta_data.FieldMetaData("customerAddress", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.PINCODE, 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.CUSTOMER_CITY, new org.apache.thrift.meta_data.FieldMetaData("customerCity", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.CUSTOMER_STATE, new org.apache.thrift.meta_data.FieldMetaData("customerState", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.CUSTOMER_PHONE, new org.apache.thrift.meta_data.FieldMetaData("customerPhone", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.RETURN_ORDERS, new org.apache.thrift.meta_data.FieldMetaData("returnOrders", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ReturnOrderInfo.class))));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ReturnTransaction.class, metaDataMap);
  }

  public ReturnTransaction() {
  }

  public ReturnTransaction(
    long id,
    ReturnTransactionStatus status,
    String customer_email,
    String customer_name,
    long customer_id,
    long address_id,
    long ticketId,
    long createdAt,
    long processedAt,
    long authorizedAt,
    long closedAt,
    String customerAddress,
    String pincode,
    String customerCity,
    String customerState,
    String customerPhone,
    List<ReturnOrderInfo> returnOrders)
  {
    this();
    this.id = id;
    setIdIsSet(true);
    this.status = status;
    this.customer_email = customer_email;
    this.customer_name = customer_name;
    this.customer_id = customer_id;
    setCustomer_idIsSet(true);
    this.address_id = address_id;
    setAddress_idIsSet(true);
    this.ticketId = ticketId;
    setTicketIdIsSet(true);
    this.createdAt = createdAt;
    setCreatedAtIsSet(true);
    this.processedAt = processedAt;
    setProcessedAtIsSet(true);
    this.authorizedAt = authorizedAt;
    setAuthorizedAtIsSet(true);
    this.closedAt = closedAt;
    setClosedAtIsSet(true);
    this.customerAddress = customerAddress;
    this.pincode = pincode;
    this.customerCity = customerCity;
    this.customerState = customerState;
    this.customerPhone = customerPhone;
    this.returnOrders = returnOrders;
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public ReturnTransaction(ReturnTransaction other) {
    __isset_bit_vector.clear();
    __isset_bit_vector.or(other.__isset_bit_vector);
    this.id = other.id;
    if (other.isSetStatus()) {
      this.status = other.status;
    }
    if (other.isSetCustomer_email()) {
      this.customer_email = other.customer_email;
    }
    if (other.isSetCustomer_name()) {
      this.customer_name = other.customer_name;
    }
    this.customer_id = other.customer_id;
    this.address_id = other.address_id;
    this.ticketId = other.ticketId;
    this.createdAt = other.createdAt;
    this.processedAt = other.processedAt;
    this.authorizedAt = other.authorizedAt;
    this.closedAt = other.closedAt;
    if (other.isSetCustomerAddress()) {
      this.customerAddress = other.customerAddress;
    }
    if (other.isSetPincode()) {
      this.pincode = other.pincode;
    }
    if (other.isSetCustomerCity()) {
      this.customerCity = other.customerCity;
    }
    if (other.isSetCustomerState()) {
      this.customerState = other.customerState;
    }
    if (other.isSetCustomerPhone()) {
      this.customerPhone = other.customerPhone;
    }
    if (other.isSetReturnOrders()) {
      List<ReturnOrderInfo> __this__returnOrders = new ArrayList<ReturnOrderInfo>();
      for (ReturnOrderInfo other_element : other.returnOrders) {
        __this__returnOrders.add(new ReturnOrderInfo(other_element));
      }
      this.returnOrders = __this__returnOrders;
    }
  }

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

  @Override
  public void clear() {
    setIdIsSet(false);
    this.id = 0;
    this.status = null;
    this.customer_email = null;
    this.customer_name = null;
    setCustomer_idIsSet(false);
    this.customer_id = 0;
    setAddress_idIsSet(false);
    this.address_id = 0;
    setTicketIdIsSet(false);
    this.ticketId = 0;
    setCreatedAtIsSet(false);
    this.createdAt = 0;
    setProcessedAtIsSet(false);
    this.processedAt = 0;
    setAuthorizedAtIsSet(false);
    this.authorizedAt = 0;
    setClosedAtIsSet(false);
    this.closedAt = 0;
    this.customerAddress = null;
    this.pincode = null;
    this.customerCity = null;
    this.customerState = null;
    this.customerPhone = null;
    this.returnOrders = null;
  }

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

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

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

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

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

  /**
   * 
   * @see ReturnTransactionStatus
   */
  public ReturnTransactionStatus getStatus() {
    return this.status;
  }

  /**
   * 
   * @see ReturnTransactionStatus
   */
  public void setStatus(ReturnTransactionStatus status) {
    this.status = status;
  }

  public void unsetStatus() {
    this.status = null;
  }

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

  public void setStatusIsSet(boolean value) {
    if (!value) {
      this.status = null;
    }
  }

  public String getCustomer_email() {
    return this.customer_email;
  }

  public void setCustomer_email(String customer_email) {
    this.customer_email = customer_email;
  }

  public void unsetCustomer_email() {
    this.customer_email = null;
  }

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

  public void setCustomer_emailIsSet(boolean value) {
    if (!value) {
      this.customer_email = null;
    }
  }

  public String getCustomer_name() {
    return this.customer_name;
  }

  public void setCustomer_name(String customer_name) {
    this.customer_name = customer_name;
  }

  public void unsetCustomer_name() {
    this.customer_name = null;
  }

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

  public void setCustomer_nameIsSet(boolean value) {
    if (!value) {
      this.customer_name = null;
    }
  }

  public long getCustomer_id() {
    return this.customer_id;
  }

  public void setCustomer_id(long customer_id) {
    this.customer_id = customer_id;
    setCustomer_idIsSet(true);
  }

  public void unsetCustomer_id() {
    __isset_bit_vector.clear(__CUSTOMER_ID_ISSET_ID);
  }

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

  public void setCustomer_idIsSet(boolean value) {
    __isset_bit_vector.set(__CUSTOMER_ID_ISSET_ID, value);
  }

  public long getAddress_id() {
    return this.address_id;
  }

  public void setAddress_id(long address_id) {
    this.address_id = address_id;
    setAddress_idIsSet(true);
  }

  public void unsetAddress_id() {
    __isset_bit_vector.clear(__ADDRESS_ID_ISSET_ID);
  }

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

  public void setAddress_idIsSet(boolean value) {
    __isset_bit_vector.set(__ADDRESS_ID_ISSET_ID, value);
  }

  public long getTicketId() {
    return this.ticketId;
  }

  public void setTicketId(long ticketId) {
    this.ticketId = ticketId;
    setTicketIdIsSet(true);
  }

  public void unsetTicketId() {
    __isset_bit_vector.clear(__TICKETID_ISSET_ID);
  }

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

  public void setTicketIdIsSet(boolean value) {
    __isset_bit_vector.set(__TICKETID_ISSET_ID, value);
  }

  public long getCreatedAt() {
    return this.createdAt;
  }

  public void setCreatedAt(long createdAt) {
    this.createdAt = createdAt;
    setCreatedAtIsSet(true);
  }

  public void unsetCreatedAt() {
    __isset_bit_vector.clear(__CREATEDAT_ISSET_ID);
  }

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

  public void setCreatedAtIsSet(boolean value) {
    __isset_bit_vector.set(__CREATEDAT_ISSET_ID, value);
  }

  public long getProcessedAt() {
    return this.processedAt;
  }

  public void setProcessedAt(long processedAt) {
    this.processedAt = processedAt;
    setProcessedAtIsSet(true);
  }

  public void unsetProcessedAt() {
    __isset_bit_vector.clear(__PROCESSEDAT_ISSET_ID);
  }

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

  public void setProcessedAtIsSet(boolean value) {
    __isset_bit_vector.set(__PROCESSEDAT_ISSET_ID, value);
  }

  public long getAuthorizedAt() {
    return this.authorizedAt;
  }

  public void setAuthorizedAt(long authorizedAt) {
    this.authorizedAt = authorizedAt;
    setAuthorizedAtIsSet(true);
  }

  public void unsetAuthorizedAt() {
    __isset_bit_vector.clear(__AUTHORIZEDAT_ISSET_ID);
  }

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

  public void setAuthorizedAtIsSet(boolean value) {
    __isset_bit_vector.set(__AUTHORIZEDAT_ISSET_ID, value);
  }

  public long getClosedAt() {
    return this.closedAt;
  }

  public void setClosedAt(long closedAt) {
    this.closedAt = closedAt;
    setClosedAtIsSet(true);
  }

  public void unsetClosedAt() {
    __isset_bit_vector.clear(__CLOSEDAT_ISSET_ID);
  }

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

  public void setClosedAtIsSet(boolean value) {
    __isset_bit_vector.set(__CLOSEDAT_ISSET_ID, value);
  }

  public String getCustomerAddress() {
    return this.customerAddress;
  }

  public void setCustomerAddress(String customerAddress) {
    this.customerAddress = customerAddress;
  }

  public void unsetCustomerAddress() {
    this.customerAddress = null;
  }

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

  public void setCustomerAddressIsSet(boolean value) {
    if (!value) {
      this.customerAddress = null;
    }
  }

  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 getCustomerCity() {
    return this.customerCity;
  }

  public void setCustomerCity(String customerCity) {
    this.customerCity = customerCity;
  }

  public void unsetCustomerCity() {
    this.customerCity = null;
  }

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

  public void setCustomerCityIsSet(boolean value) {
    if (!value) {
      this.customerCity = null;
    }
  }

  public String getCustomerState() {
    return this.customerState;
  }

  public void setCustomerState(String customerState) {
    this.customerState = customerState;
  }

  public void unsetCustomerState() {
    this.customerState = null;
  }

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

  public void setCustomerStateIsSet(boolean value) {
    if (!value) {
      this.customerState = null;
    }
  }

  public String getCustomerPhone() {
    return this.customerPhone;
  }

  public void setCustomerPhone(String customerPhone) {
    this.customerPhone = customerPhone;
  }

  public void unsetCustomerPhone() {
    this.customerPhone = null;
  }

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

  public void setCustomerPhoneIsSet(boolean value) {
    if (!value) {
      this.customerPhone = null;
    }
  }

  public int getReturnOrdersSize() {
    return (this.returnOrders == null) ? 0 : this.returnOrders.size();
  }

  public java.util.Iterator<ReturnOrderInfo> getReturnOrdersIterator() {
    return (this.returnOrders == null) ? null : this.returnOrders.iterator();
  }

  public void addToReturnOrders(ReturnOrderInfo elem) {
    if (this.returnOrders == null) {
      this.returnOrders = new ArrayList<ReturnOrderInfo>();
    }
    this.returnOrders.add(elem);
  }

  public List<ReturnOrderInfo> getReturnOrders() {
    return this.returnOrders;
  }

  public void setReturnOrders(List<ReturnOrderInfo> returnOrders) {
    this.returnOrders = returnOrders;
  }

  public void unsetReturnOrders() {
    this.returnOrders = null;
  }

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

  public void setReturnOrdersIsSet(boolean value) {
    if (!value) {
      this.returnOrders = null;
    }
  }

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

    case STATUS:
      if (value == null) {
        unsetStatus();
      } else {
        setStatus((ReturnTransactionStatus)value);
      }
      break;

    case CUSTOMER_EMAIL:
      if (value == null) {
        unsetCustomer_email();
      } else {
        setCustomer_email((String)value);
      }
      break;

    case CUSTOMER_NAME:
      if (value == null) {
        unsetCustomer_name();
      } else {
        setCustomer_name((String)value);
      }
      break;

    case CUSTOMER_ID:
      if (value == null) {
        unsetCustomer_id();
      } else {
        setCustomer_id((Long)value);
      }
      break;

    case ADDRESS_ID:
      if (value == null) {
        unsetAddress_id();
      } else {
        setAddress_id((Long)value);
      }
      break;

    case TICKET_ID:
      if (value == null) {
        unsetTicketId();
      } else {
        setTicketId((Long)value);
      }
      break;

    case CREATED_AT:
      if (value == null) {
        unsetCreatedAt();
      } else {
        setCreatedAt((Long)value);
      }
      break;

    case PROCESSED_AT:
      if (value == null) {
        unsetProcessedAt();
      } else {
        setProcessedAt((Long)value);
      }
      break;

    case AUTHORIZED_AT:
      if (value == null) {
        unsetAuthorizedAt();
      } else {
        setAuthorizedAt((Long)value);
      }
      break;

    case CLOSED_AT:
      if (value == null) {
        unsetClosedAt();
      } else {
        setClosedAt((Long)value);
      }
      break;

    case CUSTOMER_ADDRESS:
      if (value == null) {
        unsetCustomerAddress();
      } else {
        setCustomerAddress((String)value);
      }
      break;

    case PINCODE:
      if (value == null) {
        unsetPincode();
      } else {
        setPincode((String)value);
      }
      break;

    case CUSTOMER_CITY:
      if (value == null) {
        unsetCustomerCity();
      } else {
        setCustomerCity((String)value);
      }
      break;

    case CUSTOMER_STATE:
      if (value == null) {
        unsetCustomerState();
      } else {
        setCustomerState((String)value);
      }
      break;

    case CUSTOMER_PHONE:
      if (value == null) {
        unsetCustomerPhone();
      } else {
        setCustomerPhone((String)value);
      }
      break;

    case RETURN_ORDERS:
      if (value == null) {
        unsetReturnOrders();
      } else {
        setReturnOrders((List<ReturnOrderInfo>)value);
      }
      break;

    }
  }

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

    case STATUS:
      return getStatus();

    case CUSTOMER_EMAIL:
      return getCustomer_email();

    case CUSTOMER_NAME:
      return getCustomer_name();

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

    case ADDRESS_ID:
      return Long.valueOf(getAddress_id());

    case TICKET_ID:
      return Long.valueOf(getTicketId());

    case CREATED_AT:
      return Long.valueOf(getCreatedAt());

    case PROCESSED_AT:
      return Long.valueOf(getProcessedAt());

    case AUTHORIZED_AT:
      return Long.valueOf(getAuthorizedAt());

    case CLOSED_AT:
      return Long.valueOf(getClosedAt());

    case CUSTOMER_ADDRESS:
      return getCustomerAddress();

    case PINCODE:
      return getPincode();

    case CUSTOMER_CITY:
      return getCustomerCity();

    case CUSTOMER_STATE:
      return getCustomerState();

    case CUSTOMER_PHONE:
      return getCustomerPhone();

    case RETURN_ORDERS:
      return getReturnOrders();

    }
    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 STATUS:
      return isSetStatus();
    case CUSTOMER_EMAIL:
      return isSetCustomer_email();
    case CUSTOMER_NAME:
      return isSetCustomer_name();
    case CUSTOMER_ID:
      return isSetCustomer_id();
    case ADDRESS_ID:
      return isSetAddress_id();
    case TICKET_ID:
      return isSetTicketId();
    case CREATED_AT:
      return isSetCreatedAt();
    case PROCESSED_AT:
      return isSetProcessedAt();
    case AUTHORIZED_AT:
      return isSetAuthorizedAt();
    case CLOSED_AT:
      return isSetClosedAt();
    case CUSTOMER_ADDRESS:
      return isSetCustomerAddress();
    case PINCODE:
      return isSetPincode();
    case CUSTOMER_CITY:
      return isSetCustomerCity();
    case CUSTOMER_STATE:
      return isSetCustomerState();
    case CUSTOMER_PHONE:
      return isSetCustomerPhone();
    case RETURN_ORDERS:
      return isSetReturnOrders();
    }
    throw new IllegalStateException();
  }

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

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

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

    boolean this_present_status = true && this.isSetStatus();
    boolean that_present_status = true && that.isSetStatus();
    if (this_present_status || that_present_status) {
      if (!(this_present_status && that_present_status))
        return false;
      if (!this.status.equals(that.status))
        return false;
    }

    boolean this_present_customer_email = true && this.isSetCustomer_email();
    boolean that_present_customer_email = true && that.isSetCustomer_email();
    if (this_present_customer_email || that_present_customer_email) {
      if (!(this_present_customer_email && that_present_customer_email))
        return false;
      if (!this.customer_email.equals(that.customer_email))
        return false;
    }

    boolean this_present_customer_name = true && this.isSetCustomer_name();
    boolean that_present_customer_name = true && that.isSetCustomer_name();
    if (this_present_customer_name || that_present_customer_name) {
      if (!(this_present_customer_name && that_present_customer_name))
        return false;
      if (!this.customer_name.equals(that.customer_name))
        return false;
    }

    boolean this_present_customer_id = true;
    boolean that_present_customer_id = true;
    if (this_present_customer_id || that_present_customer_id) {
      if (!(this_present_customer_id && that_present_customer_id))
        return false;
      if (this.customer_id != that.customer_id)
        return false;
    }

    boolean this_present_address_id = true;
    boolean that_present_address_id = true;
    if (this_present_address_id || that_present_address_id) {
      if (!(this_present_address_id && that_present_address_id))
        return false;
      if (this.address_id != that.address_id)
        return false;
    }

    boolean this_present_ticketId = true;
    boolean that_present_ticketId = true;
    if (this_present_ticketId || that_present_ticketId) {
      if (!(this_present_ticketId && that_present_ticketId))
        return false;
      if (this.ticketId != that.ticketId)
        return false;
    }

    boolean this_present_createdAt = true;
    boolean that_present_createdAt = true;
    if (this_present_createdAt || that_present_createdAt) {
      if (!(this_present_createdAt && that_present_createdAt))
        return false;
      if (this.createdAt != that.createdAt)
        return false;
    }

    boolean this_present_processedAt = true;
    boolean that_present_processedAt = true;
    if (this_present_processedAt || that_present_processedAt) {
      if (!(this_present_processedAt && that_present_processedAt))
        return false;
      if (this.processedAt != that.processedAt)
        return false;
    }

    boolean this_present_authorizedAt = true;
    boolean that_present_authorizedAt = true;
    if (this_present_authorizedAt || that_present_authorizedAt) {
      if (!(this_present_authorizedAt && that_present_authorizedAt))
        return false;
      if (this.authorizedAt != that.authorizedAt)
        return false;
    }

    boolean this_present_closedAt = true;
    boolean that_present_closedAt = true;
    if (this_present_closedAt || that_present_closedAt) {
      if (!(this_present_closedAt && that_present_closedAt))
        return false;
      if (this.closedAt != that.closedAt)
        return false;
    }

    boolean this_present_customerAddress = true && this.isSetCustomerAddress();
    boolean that_present_customerAddress = true && that.isSetCustomerAddress();
    if (this_present_customerAddress || that_present_customerAddress) {
      if (!(this_present_customerAddress && that_present_customerAddress))
        return false;
      if (!this.customerAddress.equals(that.customerAddress))
        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_customerCity = true && this.isSetCustomerCity();
    boolean that_present_customerCity = true && that.isSetCustomerCity();
    if (this_present_customerCity || that_present_customerCity) {
      if (!(this_present_customerCity && that_present_customerCity))
        return false;
      if (!this.customerCity.equals(that.customerCity))
        return false;
    }

    boolean this_present_customerState = true && this.isSetCustomerState();
    boolean that_present_customerState = true && that.isSetCustomerState();
    if (this_present_customerState || that_present_customerState) {
      if (!(this_present_customerState && that_present_customerState))
        return false;
      if (!this.customerState.equals(that.customerState))
        return false;
    }

    boolean this_present_customerPhone = true && this.isSetCustomerPhone();
    boolean that_present_customerPhone = true && that.isSetCustomerPhone();
    if (this_present_customerPhone || that_present_customerPhone) {
      if (!(this_present_customerPhone && that_present_customerPhone))
        return false;
      if (!this.customerPhone.equals(that.customerPhone))
        return false;
    }

    boolean this_present_returnOrders = true && this.isSetReturnOrders();
    boolean that_present_returnOrders = true && that.isSetReturnOrders();
    if (this_present_returnOrders || that_present_returnOrders) {
      if (!(this_present_returnOrders && that_present_returnOrders))
        return false;
      if (!this.returnOrders.equals(that.returnOrders))
        return false;
    }

    return true;
  }

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

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

    int lastComparison = 0;
    ReturnTransaction typedOther = (ReturnTransaction)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(isSetStatus()).compareTo(typedOther.isSetStatus());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStatus()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCustomer_email()).compareTo(typedOther.isSetCustomer_email());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCustomer_email()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.customer_email, typedOther.customer_email);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCustomer_name()).compareTo(typedOther.isSetCustomer_name());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCustomer_name()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.customer_name, typedOther.customer_name);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCustomer_id()).compareTo(typedOther.isSetCustomer_id());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCustomer_id()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.customer_id, typedOther.customer_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAddress_id()).compareTo(typedOther.isSetAddress_id());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAddress_id()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.address_id, typedOther.address_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTicketId()).compareTo(typedOther.isSetTicketId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTicketId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ticketId, typedOther.ticketId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCreatedAt()).compareTo(typedOther.isSetCreatedAt());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCreatedAt()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.createdAt, typedOther.createdAt);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetProcessedAt()).compareTo(typedOther.isSetProcessedAt());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetProcessedAt()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.processedAt, typedOther.processedAt);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAuthorizedAt()).compareTo(typedOther.isSetAuthorizedAt());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAuthorizedAt()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.authorizedAt, typedOther.authorizedAt);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetClosedAt()).compareTo(typedOther.isSetClosedAt());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetClosedAt()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.closedAt, typedOther.closedAt);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCustomerAddress()).compareTo(typedOther.isSetCustomerAddress());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCustomerAddress()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.customerAddress, typedOther.customerAddress);
      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(isSetCustomerCity()).compareTo(typedOther.isSetCustomerCity());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCustomerCity()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.customerCity, typedOther.customerCity);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCustomerState()).compareTo(typedOther.isSetCustomerState());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCustomerState()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.customerState, typedOther.customerState);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCustomerPhone()).compareTo(typedOther.isSetCustomerPhone());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCustomerPhone()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.customerPhone, typedOther.customerPhone);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetReturnOrders()).compareTo(typedOther.isSetReturnOrders());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetReturnOrders()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.returnOrders, typedOther.returnOrders);
      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.I64) {
            this.id = iprot.readI64();
            setIdIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 2: // STATUS
          if (field.type == org.apache.thrift.protocol.TType.I32) {
            this.status = ReturnTransactionStatus.findByValue(iprot.readI32());
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 3: // CUSTOMER_EMAIL
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.customer_email = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 4: // CUSTOMER_NAME
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.customer_name = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 5: // CUSTOMER_ID
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.customer_id = iprot.readI64();
            setCustomer_idIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 6: // ADDRESS_ID
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.address_id = iprot.readI64();
            setAddress_idIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 7: // TICKET_ID
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.ticketId = iprot.readI64();
            setTicketIdIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 8: // CREATED_AT
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.createdAt = iprot.readI64();
            setCreatedAtIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 9: // PROCESSED_AT
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.processedAt = iprot.readI64();
            setProcessedAtIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 10: // AUTHORIZED_AT
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.authorizedAt = iprot.readI64();
            setAuthorizedAtIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 11: // CLOSED_AT
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.closedAt = iprot.readI64();
            setClosedAtIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 12: // CUSTOMER_ADDRESS
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.customerAddress = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 13: // PINCODE
          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 14: // CUSTOMER_CITY
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.customerCity = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 15: // CUSTOMER_STATE
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.customerState = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 16: // CUSTOMER_PHONE
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.customerPhone = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 17: // RETURN_ORDERS
          if (field.type == org.apache.thrift.protocol.TType.LIST) {
            {
              org.apache.thrift.protocol.TList _list60 = iprot.readListBegin();
              this.returnOrders = new ArrayList<ReturnOrderInfo>(_list60.size);
              for (int _i61 = 0; _i61 < _list60.size; ++_i61)
              {
                ReturnOrderInfo _elem62; // required
                _elem62 = new ReturnOrderInfo();
                _elem62.read(iprot);
                this.returnOrders.add(_elem62);
              }
              iprot.readListEnd();
            }
          } 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(ID_FIELD_DESC);
    oprot.writeI64(this.id);
    oprot.writeFieldEnd();
    if (this.status != null) {
      oprot.writeFieldBegin(STATUS_FIELD_DESC);
      oprot.writeI32(this.status.getValue());
      oprot.writeFieldEnd();
    }
    if (this.customer_email != null) {
      oprot.writeFieldBegin(CUSTOMER_EMAIL_FIELD_DESC);
      oprot.writeString(this.customer_email);
      oprot.writeFieldEnd();
    }
    if (this.customer_name != null) {
      oprot.writeFieldBegin(CUSTOMER_NAME_FIELD_DESC);
      oprot.writeString(this.customer_name);
      oprot.writeFieldEnd();
    }
    oprot.writeFieldBegin(CUSTOMER_ID_FIELD_DESC);
    oprot.writeI64(this.customer_id);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(ADDRESS_ID_FIELD_DESC);
    oprot.writeI64(this.address_id);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(TICKET_ID_FIELD_DESC);
    oprot.writeI64(this.ticketId);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(CREATED_AT_FIELD_DESC);
    oprot.writeI64(this.createdAt);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(PROCESSED_AT_FIELD_DESC);
    oprot.writeI64(this.processedAt);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(AUTHORIZED_AT_FIELD_DESC);
    oprot.writeI64(this.authorizedAt);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(CLOSED_AT_FIELD_DESC);
    oprot.writeI64(this.closedAt);
    oprot.writeFieldEnd();
    if (this.customerAddress != null) {
      oprot.writeFieldBegin(CUSTOMER_ADDRESS_FIELD_DESC);
      oprot.writeString(this.customerAddress);
      oprot.writeFieldEnd();
    }
    if (this.pincode != null) {
      oprot.writeFieldBegin(PINCODE_FIELD_DESC);
      oprot.writeString(this.pincode);
      oprot.writeFieldEnd();
    }
    if (this.customerCity != null) {
      oprot.writeFieldBegin(CUSTOMER_CITY_FIELD_DESC);
      oprot.writeString(this.customerCity);
      oprot.writeFieldEnd();
    }
    if (this.customerState != null) {
      oprot.writeFieldBegin(CUSTOMER_STATE_FIELD_DESC);
      oprot.writeString(this.customerState);
      oprot.writeFieldEnd();
    }
    if (this.customerPhone != null) {
      oprot.writeFieldBegin(CUSTOMER_PHONE_FIELD_DESC);
      oprot.writeString(this.customerPhone);
      oprot.writeFieldEnd();
    }
    if (this.returnOrders != null) {
      oprot.writeFieldBegin(RETURN_ORDERS_FIELD_DESC);
      {
        oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.returnOrders.size()));
        for (ReturnOrderInfo _iter63 : this.returnOrders)
        {
          _iter63.write(oprot);
        }
        oprot.writeListEnd();
      }
      oprot.writeFieldEnd();
    }
    oprot.writeFieldStop();
    oprot.writeStructEnd();
  }

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

    sb.append("id:");
    sb.append(this.id);
    first = false;
    if (!first) sb.append(", ");
    sb.append("status:");
    if (this.status == null) {
      sb.append("null");
    } else {
      sb.append(this.status);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("customer_email:");
    if (this.customer_email == null) {
      sb.append("null");
    } else {
      sb.append(this.customer_email);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("customer_name:");
    if (this.customer_name == null) {
      sb.append("null");
    } else {
      sb.append(this.customer_name);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("customer_id:");
    sb.append(this.customer_id);
    first = false;
    if (!first) sb.append(", ");
    sb.append("address_id:");
    sb.append(this.address_id);
    first = false;
    if (!first) sb.append(", ");
    sb.append("ticketId:");
    sb.append(this.ticketId);
    first = false;
    if (!first) sb.append(", ");
    sb.append("createdAt:");
    sb.append(this.createdAt);
    first = false;
    if (!first) sb.append(", ");
    sb.append("processedAt:");
    sb.append(this.processedAt);
    first = false;
    if (!first) sb.append(", ");
    sb.append("authorizedAt:");
    sb.append(this.authorizedAt);
    first = false;
    if (!first) sb.append(", ");
    sb.append("closedAt:");
    sb.append(this.closedAt);
    first = false;
    if (!first) sb.append(", ");
    sb.append("customerAddress:");
    if (this.customerAddress == null) {
      sb.append("null");
    } else {
      sb.append(this.customerAddress);
    }
    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("customerCity:");
    if (this.customerCity == null) {
      sb.append("null");
    } else {
      sb.append(this.customerCity);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("customerState:");
    if (this.customerState == null) {
      sb.append("null");
    } else {
      sb.append(this.customerState);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("customerPhone:");
    if (this.customerPhone == null) {
      sb.append("null");
    } else {
      sb.append(this.customerPhone);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("returnOrders:");
    if (this.returnOrders == null) {
      sb.append("null");
    } else {
      sb.append(this.returnOrders);
    }
    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);
    }
  }

}