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.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 PaginatedLoanHistory implements org.apache.thrift.TBase<PaginatedLoanHistory, PaginatedLoanHistory._Fields>, java.io.Serializable, Cloneable {private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("PaginatedLoanHistory");private static final org.apache.thrift.protocol.TField HAS_MORE_FIELD_DESC = new org.apache.thrift.protocol.TField("hasMore", org.apache.thrift.protocol.TType.BOOL, (short)1);private static final org.apache.thrift.protocol.TField TOTAL_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("totalCount", org.apache.thrift.protocol.TType.I64, (short)2);private static final org.apache.thrift.protocol.TField LOAN_HISTORY_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("loanHistoryList", org.apache.thrift.protocol.TType.LIST, (short)3);private boolean hasMore; // requiredprivate long totalCount; // requiredprivate List<LoanHistory> loanHistoryList; // 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 {HAS_MORE((short)1, "hasMore"),TOTAL_COUNT((short)2, "totalCount"),LOAN_HISTORY_LIST((short)3, "loanHistoryList");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: // HAS_MOREreturn HAS_MORE;case 2: // TOTAL_COUNTreturn TOTAL_COUNT;case 3: // LOAN_HISTORY_LISTreturn LOAN_HISTORY_LIST;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 assignmentsprivate static final int __HASMORE_ISSET_ID = 0;private static final int __TOTALCOUNT_ISSET_ID = 1;private BitSet __isset_bit_vector = new BitSet(2);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.HAS_MORE, new org.apache.thrift.meta_data.FieldMetaData("hasMore", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));tmpMap.put(_Fields.TOTAL_COUNT, new org.apache.thrift.meta_data.FieldMetaData("totalCount", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));tmpMap.put(_Fields.LOAN_HISTORY_LIST, new org.apache.thrift.meta_data.FieldMetaData("loanHistoryList", 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, LoanHistory.class))));metaDataMap = Collections.unmodifiableMap(tmpMap);org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PaginatedLoanHistory.class, metaDataMap);}public PaginatedLoanHistory() {}public PaginatedLoanHistory(boolean hasMore,long totalCount,List<LoanHistory> loanHistoryList){this();this.hasMore = hasMore;setHasMoreIsSet(true);this.totalCount = totalCount;setTotalCountIsSet(true);this.loanHistoryList = loanHistoryList;}/*** Performs a deep copy on <i>other</i>.*/public PaginatedLoanHistory(PaginatedLoanHistory other) {__isset_bit_vector.clear();__isset_bit_vector.or(other.__isset_bit_vector);this.hasMore = other.hasMore;this.totalCount = other.totalCount;if (other.isSetLoanHistoryList()) {List<LoanHistory> __this__loanHistoryList = new ArrayList<LoanHistory>();for (LoanHistory other_element : other.loanHistoryList) {__this__loanHistoryList.add(new LoanHistory(other_element));}this.loanHistoryList = __this__loanHistoryList;}}public PaginatedLoanHistory deepCopy() {return new PaginatedLoanHistory(this);}@Overridepublic void clear() {setHasMoreIsSet(false);this.hasMore = false;setTotalCountIsSet(false);this.totalCount = 0;this.loanHistoryList = null;}public boolean isHasMore() {return this.hasMore;}public void setHasMore(boolean hasMore) {this.hasMore = hasMore;setHasMoreIsSet(true);}public void unsetHasMore() {__isset_bit_vector.clear(__HASMORE_ISSET_ID);}/** Returns true if field hasMore is set (has been assigned a value) and false otherwise */public boolean isSetHasMore() {return __isset_bit_vector.get(__HASMORE_ISSET_ID);}public void setHasMoreIsSet(boolean value) {__isset_bit_vector.set(__HASMORE_ISSET_ID, value);}public long getTotalCount() {return this.totalCount;}public void setTotalCount(long totalCount) {this.totalCount = totalCount;setTotalCountIsSet(true);}public void unsetTotalCount() {__isset_bit_vector.clear(__TOTALCOUNT_ISSET_ID);}/** Returns true if field totalCount is set (has been assigned a value) and false otherwise */public boolean isSetTotalCount() {return __isset_bit_vector.get(__TOTALCOUNT_ISSET_ID);}public void setTotalCountIsSet(boolean value) {__isset_bit_vector.set(__TOTALCOUNT_ISSET_ID, value);}public int getLoanHistoryListSize() {return (this.loanHistoryList == null) ? 0 : this.loanHistoryList.size();}public java.util.Iterator<LoanHistory> getLoanHistoryListIterator() {return (this.loanHistoryList == null) ? null : this.loanHistoryList.iterator();}public void addToLoanHistoryList(LoanHistory elem) {if (this.loanHistoryList == null) {this.loanHistoryList = new ArrayList<LoanHistory>();}this.loanHistoryList.add(elem);}public List<LoanHistory> getLoanHistoryList() {return this.loanHistoryList;}public void setLoanHistoryList(List<LoanHistory> loanHistoryList) {this.loanHistoryList = loanHistoryList;}public void unsetLoanHistoryList() {this.loanHistoryList = null;}/** Returns true if field loanHistoryList is set (has been assigned a value) and false otherwise */public boolean isSetLoanHistoryList() {return this.loanHistoryList != null;}public void setLoanHistoryListIsSet(boolean value) {if (!value) {this.loanHistoryList = null;}}public void setFieldValue(_Fields field, Object value) {switch (field) {case HAS_MORE:if (value == null) {unsetHasMore();} else {setHasMore((Boolean)value);}break;case TOTAL_COUNT:if (value == null) {unsetTotalCount();} else {setTotalCount((Long)value);}break;case LOAN_HISTORY_LIST:if (value == null) {unsetLoanHistoryList();} else {setLoanHistoryList((List<LoanHistory>)value);}break;}}public Object getFieldValue(_Fields field) {switch (field) {case HAS_MORE:return Boolean.valueOf(isHasMore());case TOTAL_COUNT:return Long.valueOf(getTotalCount());case LOAN_HISTORY_LIST:return getLoanHistoryList();}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 HAS_MORE:return isSetHasMore();case TOTAL_COUNT:return isSetTotalCount();case LOAN_HISTORY_LIST:return isSetLoanHistoryList();}throw new IllegalStateException();}@Overridepublic boolean equals(Object that) {if (that == null)return false;if (that instanceof PaginatedLoanHistory)return this.equals((PaginatedLoanHistory)that);return false;}public boolean equals(PaginatedLoanHistory that) {if (that == null)return false;boolean this_present_hasMore = true;boolean that_present_hasMore = true;if (this_present_hasMore || that_present_hasMore) {if (!(this_present_hasMore && that_present_hasMore))return false;if (this.hasMore != that.hasMore)return false;}boolean this_present_totalCount = true;boolean that_present_totalCount = true;if (this_present_totalCount || that_present_totalCount) {if (!(this_present_totalCount && that_present_totalCount))return false;if (this.totalCount != that.totalCount)return false;}boolean this_present_loanHistoryList = true && this.isSetLoanHistoryList();boolean that_present_loanHistoryList = true && that.isSetLoanHistoryList();if (this_present_loanHistoryList || that_present_loanHistoryList) {if (!(this_present_loanHistoryList && that_present_loanHistoryList))return false;if (!this.loanHistoryList.equals(that.loanHistoryList))return false;}return true;}@Overridepublic int hashCode() {return 0;}public int compareTo(PaginatedLoanHistory other) {if (!getClass().equals(other.getClass())) {return getClass().getName().compareTo(other.getClass().getName());}int lastComparison = 0;PaginatedLoanHistory typedOther = (PaginatedLoanHistory)other;lastComparison = Boolean.valueOf(isSetHasMore()).compareTo(typedOther.isSetHasMore());if (lastComparison != 0) {return lastComparison;}if (isSetHasMore()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hasMore, typedOther.hasMore);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetTotalCount()).compareTo(typedOther.isSetTotalCount());if (lastComparison != 0) {return lastComparison;}if (isSetTotalCount()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.totalCount, typedOther.totalCount);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetLoanHistoryList()).compareTo(typedOther.isSetLoanHistoryList());if (lastComparison != 0) {return lastComparison;}if (isSetLoanHistoryList()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.loanHistoryList, typedOther.loanHistoryList);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: // HAS_MOREif (field.type == org.apache.thrift.protocol.TType.BOOL) {this.hasMore = iprot.readBool();setHasMoreIsSet(true);} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 2: // TOTAL_COUNTif (field.type == org.apache.thrift.protocol.TType.I64) {this.totalCount = iprot.readI64();setTotalCountIsSet(true);} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 3: // LOAN_HISTORY_LISTif (field.type == org.apache.thrift.protocol.TType.LIST) {{org.apache.thrift.protocol.TList _list68 = iprot.readListBegin();this.loanHistoryList = new ArrayList<LoanHistory>(_list68.size);for (int _i69 = 0; _i69 < _list68.size; ++_i69){LoanHistory _elem70; // required_elem70 = new LoanHistory();_elem70.read(iprot);this.loanHistoryList.add(_elem70);}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(HAS_MORE_FIELD_DESC);oprot.writeBool(this.hasMore);oprot.writeFieldEnd();oprot.writeFieldBegin(TOTAL_COUNT_FIELD_DESC);oprot.writeI64(this.totalCount);oprot.writeFieldEnd();if (this.loanHistoryList != null) {oprot.writeFieldBegin(LOAN_HISTORY_LIST_FIELD_DESC);{oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.loanHistoryList.size()));for (LoanHistory _iter71 : this.loanHistoryList){_iter71.write(oprot);}oprot.writeListEnd();}oprot.writeFieldEnd();}oprot.writeFieldStop();oprot.writeStructEnd();}@Overridepublic String toString() {StringBuilder sb = new StringBuilder("PaginatedLoanHistory(");boolean first = true;sb.append("hasMore:");sb.append(this.hasMore);first = false;if (!first) sb.append(", ");sb.append("totalCount:");sb.append(this.totalCount);first = false;if (!first) sb.append(", ");sb.append("loanHistoryList:");if (this.loanHistoryList == null) {sb.append("null");} else {sb.append(this.loanHistoryList);}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);}}}