Subversion Repositories SmartDukaan

Rev

Blame | 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.purchase;

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

  private static final org.apache.thrift.protocol.TField PURCHASE_RETURN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("purchaseReturnId", org.apache.thrift.protocol.TType.I64, (short)1);
  private static final org.apache.thrift.protocol.TField SETTLEMENT_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("settlementType", org.apache.thrift.protocol.TType.I32, (short)2);
  private static final org.apache.thrift.protocol.TField SETTLEMENT_AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("settlementAmount", org.apache.thrift.protocol.TType.I64, (short)3);
  private static final org.apache.thrift.protocol.TField SETTLEMENT_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("settlementDate", org.apache.thrift.protocol.TType.I64, (short)4);
  private static final org.apache.thrift.protocol.TField SETTLEMENT_BY_FIELD_DESC = new org.apache.thrift.protocol.TField("settlementBy", org.apache.thrift.protocol.TType.STRING, (short)5);
  private static final org.apache.thrift.protocol.TField DOCUMENT_NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("documentNumber", org.apache.thrift.protocol.TType.STRING, (short)6);

  private long purchaseReturnId; // required
  private SettlementType settlementType; // required
  private long settlementAmount; // required
  private long settlementDate; // required
  private String settlementBy; // required
  private String documentNumber; // 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 {
    PURCHASE_RETURN_ID((short)1, "purchaseReturnId"),
    /**
     * 
     * @see SettlementType
     */
    SETTLEMENT_TYPE((short)2, "settlementType"),
    SETTLEMENT_AMOUNT((short)3, "settlementAmount"),
    SETTLEMENT_DATE((short)4, "settlementDate"),
    SETTLEMENT_BY((short)5, "settlementBy"),
    DOCUMENT_NUMBER((short)6, "documentNumber");

    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: // PURCHASE_RETURN_ID
          return PURCHASE_RETURN_ID;
        case 2: // SETTLEMENT_TYPE
          return SETTLEMENT_TYPE;
        case 3: // SETTLEMENT_AMOUNT
          return SETTLEMENT_AMOUNT;
        case 4: // SETTLEMENT_DATE
          return SETTLEMENT_DATE;
        case 5: // SETTLEMENT_BY
          return SETTLEMENT_BY;
        case 6: // DOCUMENT_NUMBER
          return DOCUMENT_NUMBER;
        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 __PURCHASERETURNID_ISSET_ID = 0;
  private static final int __SETTLEMENTAMOUNT_ISSET_ID = 1;
  private static final int __SETTLEMENTDATE_ISSET_ID = 2;
  private BitSet __isset_bit_vector = new BitSet(3);

  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.PURCHASE_RETURN_ID, new org.apache.thrift.meta_data.FieldMetaData("purchaseReturnId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.SETTLEMENT_TYPE, new org.apache.thrift.meta_data.FieldMetaData("settlementType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, SettlementType.class)));
    tmpMap.put(_Fields.SETTLEMENT_AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("settlementAmount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.SETTLEMENT_DATE, new org.apache.thrift.meta_data.FieldMetaData("settlementDate", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.SETTLEMENT_BY, new org.apache.thrift.meta_data.FieldMetaData("settlementBy", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.DOCUMENT_NUMBER, new org.apache.thrift.meta_data.FieldMetaData("documentNumber", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PurchaseReturnSettlement.class, metaDataMap);
  }

  public PurchaseReturnSettlement() {
  }

  public PurchaseReturnSettlement(
    long purchaseReturnId,
    SettlementType settlementType,
    long settlementAmount,
    long settlementDate,
    String settlementBy,
    String documentNumber)
  {
    this();
    this.purchaseReturnId = purchaseReturnId;
    setPurchaseReturnIdIsSet(true);
    this.settlementType = settlementType;
    this.settlementAmount = settlementAmount;
    setSettlementAmountIsSet(true);
    this.settlementDate = settlementDate;
    setSettlementDateIsSet(true);
    this.settlementBy = settlementBy;
    this.documentNumber = documentNumber;
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public PurchaseReturnSettlement(PurchaseReturnSettlement other) {
    __isset_bit_vector.clear();
    __isset_bit_vector.or(other.__isset_bit_vector);
    this.purchaseReturnId = other.purchaseReturnId;
    if (other.isSetSettlementType()) {
      this.settlementType = other.settlementType;
    }
    this.settlementAmount = other.settlementAmount;
    this.settlementDate = other.settlementDate;
    if (other.isSetSettlementBy()) {
      this.settlementBy = other.settlementBy;
    }
    if (other.isSetDocumentNumber()) {
      this.documentNumber = other.documentNumber;
    }
  }

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

  @Override
  public void clear() {
    setPurchaseReturnIdIsSet(false);
    this.purchaseReturnId = 0;
    this.settlementType = null;
    setSettlementAmountIsSet(false);
    this.settlementAmount = 0;
    setSettlementDateIsSet(false);
    this.settlementDate = 0;
    this.settlementBy = null;
    this.documentNumber = null;
  }

  public long getPurchaseReturnId() {
    return this.purchaseReturnId;
  }

  public void setPurchaseReturnId(long purchaseReturnId) {
    this.purchaseReturnId = purchaseReturnId;
    setPurchaseReturnIdIsSet(true);
  }

  public void unsetPurchaseReturnId() {
    __isset_bit_vector.clear(__PURCHASERETURNID_ISSET_ID);
  }

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

  public void setPurchaseReturnIdIsSet(boolean value) {
    __isset_bit_vector.set(__PURCHASERETURNID_ISSET_ID, value);
  }

  /**
   * 
   * @see SettlementType
   */
  public SettlementType getSettlementType() {
    return this.settlementType;
  }

  /**
   * 
   * @see SettlementType
   */
  public void setSettlementType(SettlementType settlementType) {
    this.settlementType = settlementType;
  }

  public void unsetSettlementType() {
    this.settlementType = null;
  }

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

  public void setSettlementTypeIsSet(boolean value) {
    if (!value) {
      this.settlementType = null;
    }
  }

  public long getSettlementAmount() {
    return this.settlementAmount;
  }

  public void setSettlementAmount(long settlementAmount) {
    this.settlementAmount = settlementAmount;
    setSettlementAmountIsSet(true);
  }

  public void unsetSettlementAmount() {
    __isset_bit_vector.clear(__SETTLEMENTAMOUNT_ISSET_ID);
  }

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

  public void setSettlementAmountIsSet(boolean value) {
    __isset_bit_vector.set(__SETTLEMENTAMOUNT_ISSET_ID, value);
  }

  public long getSettlementDate() {
    return this.settlementDate;
  }

  public void setSettlementDate(long settlementDate) {
    this.settlementDate = settlementDate;
    setSettlementDateIsSet(true);
  }

  public void unsetSettlementDate() {
    __isset_bit_vector.clear(__SETTLEMENTDATE_ISSET_ID);
  }

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

  public void setSettlementDateIsSet(boolean value) {
    __isset_bit_vector.set(__SETTLEMENTDATE_ISSET_ID, value);
  }

  public String getSettlementBy() {
    return this.settlementBy;
  }

  public void setSettlementBy(String settlementBy) {
    this.settlementBy = settlementBy;
  }

  public void unsetSettlementBy() {
    this.settlementBy = null;
  }

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

  public void setSettlementByIsSet(boolean value) {
    if (!value) {
      this.settlementBy = null;
    }
  }

  public String getDocumentNumber() {
    return this.documentNumber;
  }

  public void setDocumentNumber(String documentNumber) {
    this.documentNumber = documentNumber;
  }

  public void unsetDocumentNumber() {
    this.documentNumber = null;
  }

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

  public void setDocumentNumberIsSet(boolean value) {
    if (!value) {
      this.documentNumber = null;
    }
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case PURCHASE_RETURN_ID:
      if (value == null) {
        unsetPurchaseReturnId();
      } else {
        setPurchaseReturnId((Long)value);
      }
      break;

    case SETTLEMENT_TYPE:
      if (value == null) {
        unsetSettlementType();
      } else {
        setSettlementType((SettlementType)value);
      }
      break;

    case SETTLEMENT_AMOUNT:
      if (value == null) {
        unsetSettlementAmount();
      } else {
        setSettlementAmount((Long)value);
      }
      break;

    case SETTLEMENT_DATE:
      if (value == null) {
        unsetSettlementDate();
      } else {
        setSettlementDate((Long)value);
      }
      break;

    case SETTLEMENT_BY:
      if (value == null) {
        unsetSettlementBy();
      } else {
        setSettlementBy((String)value);
      }
      break;

    case DOCUMENT_NUMBER:
      if (value == null) {
        unsetDocumentNumber();
      } else {
        setDocumentNumber((String)value);
      }
      break;

    }
  }

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

    case SETTLEMENT_TYPE:
      return getSettlementType();

    case SETTLEMENT_AMOUNT:
      return Long.valueOf(getSettlementAmount());

    case SETTLEMENT_DATE:
      return Long.valueOf(getSettlementDate());

    case SETTLEMENT_BY:
      return getSettlementBy();

    case DOCUMENT_NUMBER:
      return getDocumentNumber();

    }
    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 PURCHASE_RETURN_ID:
      return isSetPurchaseReturnId();
    case SETTLEMENT_TYPE:
      return isSetSettlementType();
    case SETTLEMENT_AMOUNT:
      return isSetSettlementAmount();
    case SETTLEMENT_DATE:
      return isSetSettlementDate();
    case SETTLEMENT_BY:
      return isSetSettlementBy();
    case DOCUMENT_NUMBER:
      return isSetDocumentNumber();
    }
    throw new IllegalStateException();
  }

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

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

    boolean this_present_purchaseReturnId = true;
    boolean that_present_purchaseReturnId = true;
    if (this_present_purchaseReturnId || that_present_purchaseReturnId) {
      if (!(this_present_purchaseReturnId && that_present_purchaseReturnId))
        return false;
      if (this.purchaseReturnId != that.purchaseReturnId)
        return false;
    }

    boolean this_present_settlementType = true && this.isSetSettlementType();
    boolean that_present_settlementType = true && that.isSetSettlementType();
    if (this_present_settlementType || that_present_settlementType) {
      if (!(this_present_settlementType && that_present_settlementType))
        return false;
      if (!this.settlementType.equals(that.settlementType))
        return false;
    }

    boolean this_present_settlementAmount = true;
    boolean that_present_settlementAmount = true;
    if (this_present_settlementAmount || that_present_settlementAmount) {
      if (!(this_present_settlementAmount && that_present_settlementAmount))
        return false;
      if (this.settlementAmount != that.settlementAmount)
        return false;
    }

    boolean this_present_settlementDate = true;
    boolean that_present_settlementDate = true;
    if (this_present_settlementDate || that_present_settlementDate) {
      if (!(this_present_settlementDate && that_present_settlementDate))
        return false;
      if (this.settlementDate != that.settlementDate)
        return false;
    }

    boolean this_present_settlementBy = true && this.isSetSettlementBy();
    boolean that_present_settlementBy = true && that.isSetSettlementBy();
    if (this_present_settlementBy || that_present_settlementBy) {
      if (!(this_present_settlementBy && that_present_settlementBy))
        return false;
      if (!this.settlementBy.equals(that.settlementBy))
        return false;
    }

    boolean this_present_documentNumber = true && this.isSetDocumentNumber();
    boolean that_present_documentNumber = true && that.isSetDocumentNumber();
    if (this_present_documentNumber || that_present_documentNumber) {
      if (!(this_present_documentNumber && that_present_documentNumber))
        return false;
      if (!this.documentNumber.equals(that.documentNumber))
        return false;
    }

    return true;
  }

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

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

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

    lastComparison = Boolean.valueOf(isSetPurchaseReturnId()).compareTo(typedOther.isSetPurchaseReturnId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPurchaseReturnId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.purchaseReturnId, typedOther.purchaseReturnId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSettlementType()).compareTo(typedOther.isSetSettlementType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSettlementType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.settlementType, typedOther.settlementType);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSettlementAmount()).compareTo(typedOther.isSetSettlementAmount());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSettlementAmount()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.settlementAmount, typedOther.settlementAmount);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSettlementDate()).compareTo(typedOther.isSetSettlementDate());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSettlementDate()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.settlementDate, typedOther.settlementDate);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSettlementBy()).compareTo(typedOther.isSetSettlementBy());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSettlementBy()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.settlementBy, typedOther.settlementBy);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDocumentNumber()).compareTo(typedOther.isSetDocumentNumber());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDocumentNumber()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.documentNumber, typedOther.documentNumber);
      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: // PURCHASE_RETURN_ID
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.purchaseReturnId = iprot.readI64();
            setPurchaseReturnIdIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 2: // SETTLEMENT_TYPE
          if (field.type == org.apache.thrift.protocol.TType.I32) {
            this.settlementType = SettlementType.findByValue(iprot.readI32());
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 3: // SETTLEMENT_AMOUNT
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.settlementAmount = iprot.readI64();
            setSettlementAmountIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 4: // SETTLEMENT_DATE
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.settlementDate = iprot.readI64();
            setSettlementDateIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 5: // SETTLEMENT_BY
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.settlementBy = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 6: // DOCUMENT_NUMBER
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.documentNumber = iprot.readString();
          } 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(PURCHASE_RETURN_ID_FIELD_DESC);
    oprot.writeI64(this.purchaseReturnId);
    oprot.writeFieldEnd();
    if (this.settlementType != null) {
      oprot.writeFieldBegin(SETTLEMENT_TYPE_FIELD_DESC);
      oprot.writeI32(this.settlementType.getValue());
      oprot.writeFieldEnd();
    }
    oprot.writeFieldBegin(SETTLEMENT_AMOUNT_FIELD_DESC);
    oprot.writeI64(this.settlementAmount);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(SETTLEMENT_DATE_FIELD_DESC);
    oprot.writeI64(this.settlementDate);
    oprot.writeFieldEnd();
    if (this.settlementBy != null) {
      oprot.writeFieldBegin(SETTLEMENT_BY_FIELD_DESC);
      oprot.writeString(this.settlementBy);
      oprot.writeFieldEnd();
    }
    if (this.documentNumber != null) {
      oprot.writeFieldBegin(DOCUMENT_NUMBER_FIELD_DESC);
      oprot.writeString(this.documentNumber);
      oprot.writeFieldEnd();
    }
    oprot.writeFieldStop();
    oprot.writeStructEnd();
  }

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

    sb.append("purchaseReturnId:");
    sb.append(this.purchaseReturnId);
    first = false;
    if (!first) sb.append(", ");
    sb.append("settlementType:");
    if (this.settlementType == null) {
      sb.append("null");
    } else {
      sb.append(this.settlementType);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("settlementAmount:");
    sb.append(this.settlementAmount);
    first = false;
    if (!first) sb.append(", ");
    sb.append("settlementDate:");
    sb.append(this.settlementDate);
    first = false;
    if (!first) sb.append(", ");
    sb.append("settlementBy:");
    if (this.settlementBy == null) {
      sb.append("null");
    } else {
      sb.append(this.settlementBy);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("documentNumber:");
    if (this.documentNumber == null) {
      sb.append("null");
    } else {
      sb.append(this.documentNumber);
    }
    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);
    }
  }

}