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 RechargeStatistics implements org.apache.thrift.TBase<RechargeStatistics, RechargeStatistics._Fields>, java.io.Serializable, Cloneable {private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RechargeStatistics");private static final org.apache.thrift.protocol.TField STATUS_COUNTS_FIELD_DESC = new org.apache.thrift.protocol.TField("statusCounts", org.apache.thrift.protocol.TType.MAP, (short)1);private static final org.apache.thrift.protocol.TField OPERATOR_COUNTS_FIELD_DESC = new org.apache.thrift.protocol.TField("operatorCounts", org.apache.thrift.protocol.TType.MAP, (short)2);private static final org.apache.thrift.protocol.TField CURRENT_ORDERS_FIELD_DESC = new org.apache.thrift.protocol.TField("currentOrders", org.apache.thrift.protocol.TType.MAP, (short)3);private static final org.apache.thrift.protocol.TField AMOUNTS_FIELD_DESC = new org.apache.thrift.protocol.TField("amounts", org.apache.thrift.protocol.TType.MAP, (short)4);private Map<RechargeOrderStatus,Long> statusCounts; // requiredprivate Map<String,Long> operatorCounts; // requiredprivate Map<String,List<RechargeOrder>> currentOrders; // requiredprivate Map<String,Long> amounts; // 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 {STATUS_COUNTS((short)1, "statusCounts"),OPERATOR_COUNTS((short)2, "operatorCounts"),CURRENT_ORDERS((short)3, "currentOrders"),AMOUNTS((short)4, "amounts");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: // STATUS_COUNTSreturn STATUS_COUNTS;case 2: // OPERATOR_COUNTSreturn OPERATOR_COUNTS;case 3: // CURRENT_ORDERSreturn CURRENT_ORDERS;case 4: // AMOUNTSreturn AMOUNTS;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 assignmentspublic 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.STATUS_COUNTS, new org.apache.thrift.meta_data.FieldMetaData("statusCounts", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, RechargeOrderStatus.class),new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));tmpMap.put(_Fields.OPERATOR_COUNTS, new org.apache.thrift.meta_data.FieldMetaData("operatorCounts", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING),new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));tmpMap.put(_Fields.CURRENT_ORDERS, new org.apache.thrift.meta_data.FieldMetaData("currentOrders", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING),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, RechargeOrder.class)))));tmpMap.put(_Fields.AMOUNTS, new org.apache.thrift.meta_data.FieldMetaData("amounts", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING),new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));metaDataMap = Collections.unmodifiableMap(tmpMap);org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RechargeStatistics.class, metaDataMap);}public RechargeStatistics() {}public RechargeStatistics(Map<RechargeOrderStatus,Long> statusCounts,Map<String,Long> operatorCounts,Map<String,List<RechargeOrder>> currentOrders,Map<String,Long> amounts){this();this.statusCounts = statusCounts;this.operatorCounts = operatorCounts;this.currentOrders = currentOrders;this.amounts = amounts;}/*** Performs a deep copy on <i>other</i>.*/public RechargeStatistics(RechargeStatistics other) {if (other.isSetStatusCounts()) {Map<RechargeOrderStatus,Long> __this__statusCounts = new HashMap<RechargeOrderStatus,Long>();for (Map.Entry<RechargeOrderStatus, Long> other_element : other.statusCounts.entrySet()) {RechargeOrderStatus other_element_key = other_element.getKey();Long other_element_value = other_element.getValue();RechargeOrderStatus __this__statusCounts_copy_key = other_element_key;Long __this__statusCounts_copy_value = other_element_value;__this__statusCounts.put(__this__statusCounts_copy_key, __this__statusCounts_copy_value);}this.statusCounts = __this__statusCounts;}if (other.isSetOperatorCounts()) {Map<String,Long> __this__operatorCounts = new HashMap<String,Long>();for (Map.Entry<String, Long> other_element : other.operatorCounts.entrySet()) {String other_element_key = other_element.getKey();Long other_element_value = other_element.getValue();String __this__operatorCounts_copy_key = other_element_key;Long __this__operatorCounts_copy_value = other_element_value;__this__operatorCounts.put(__this__operatorCounts_copy_key, __this__operatorCounts_copy_value);}this.operatorCounts = __this__operatorCounts;}if (other.isSetCurrentOrders()) {Map<String,List<RechargeOrder>> __this__currentOrders = new HashMap<String,List<RechargeOrder>>();for (Map.Entry<String, List<RechargeOrder>> other_element : other.currentOrders.entrySet()) {String other_element_key = other_element.getKey();List<RechargeOrder> other_element_value = other_element.getValue();String __this__currentOrders_copy_key = other_element_key;List<RechargeOrder> __this__currentOrders_copy_value = new ArrayList<RechargeOrder>();for (RechargeOrder other_element_value_element : other_element_value) {__this__currentOrders_copy_value.add(new RechargeOrder(other_element_value_element));}__this__currentOrders.put(__this__currentOrders_copy_key, __this__currentOrders_copy_value);}this.currentOrders = __this__currentOrders;}if (other.isSetAmounts()) {Map<String,Long> __this__amounts = new HashMap<String,Long>();for (Map.Entry<String, Long> other_element : other.amounts.entrySet()) {String other_element_key = other_element.getKey();Long other_element_value = other_element.getValue();String __this__amounts_copy_key = other_element_key;Long __this__amounts_copy_value = other_element_value;__this__amounts.put(__this__amounts_copy_key, __this__amounts_copy_value);}this.amounts = __this__amounts;}}public RechargeStatistics deepCopy() {return new RechargeStatistics(this);}@Overridepublic void clear() {this.statusCounts = null;this.operatorCounts = null;this.currentOrders = null;this.amounts = null;}public int getStatusCountsSize() {return (this.statusCounts == null) ? 0 : this.statusCounts.size();}public void putToStatusCounts(RechargeOrderStatus key, long val) {if (this.statusCounts == null) {this.statusCounts = new HashMap<RechargeOrderStatus,Long>();}this.statusCounts.put(key, val);}public Map<RechargeOrderStatus,Long> getStatusCounts() {return this.statusCounts;}public void setStatusCounts(Map<RechargeOrderStatus,Long> statusCounts) {this.statusCounts = statusCounts;}public void unsetStatusCounts() {this.statusCounts = null;}/** Returns true if field statusCounts is set (has been assigned a value) and false otherwise */public boolean isSetStatusCounts() {return this.statusCounts != null;}public void setStatusCountsIsSet(boolean value) {if (!value) {this.statusCounts = null;}}public int getOperatorCountsSize() {return (this.operatorCounts == null) ? 0 : this.operatorCounts.size();}public void putToOperatorCounts(String key, long val) {if (this.operatorCounts == null) {this.operatorCounts = new HashMap<String,Long>();}this.operatorCounts.put(key, val);}public Map<String,Long> getOperatorCounts() {return this.operatorCounts;}public void setOperatorCounts(Map<String,Long> operatorCounts) {this.operatorCounts = operatorCounts;}public void unsetOperatorCounts() {this.operatorCounts = null;}/** Returns true if field operatorCounts is set (has been assigned a value) and false otherwise */public boolean isSetOperatorCounts() {return this.operatorCounts != null;}public void setOperatorCountsIsSet(boolean value) {if (!value) {this.operatorCounts = null;}}public int getCurrentOrdersSize() {return (this.currentOrders == null) ? 0 : this.currentOrders.size();}public void putToCurrentOrders(String key, List<RechargeOrder> val) {if (this.currentOrders == null) {this.currentOrders = new HashMap<String,List<RechargeOrder>>();}this.currentOrders.put(key, val);}public Map<String,List<RechargeOrder>> getCurrentOrders() {return this.currentOrders;}public void setCurrentOrders(Map<String,List<RechargeOrder>> currentOrders) {this.currentOrders = currentOrders;}public void unsetCurrentOrders() {this.currentOrders = null;}/** Returns true if field currentOrders is set (has been assigned a value) and false otherwise */public boolean isSetCurrentOrders() {return this.currentOrders != null;}public void setCurrentOrdersIsSet(boolean value) {if (!value) {this.currentOrders = null;}}public int getAmountsSize() {return (this.amounts == null) ? 0 : this.amounts.size();}public void putToAmounts(String key, long val) {if (this.amounts == null) {this.amounts = new HashMap<String,Long>();}this.amounts.put(key, val);}public Map<String,Long> getAmounts() {return this.amounts;}public void setAmounts(Map<String,Long> amounts) {this.amounts = amounts;}public void unsetAmounts() {this.amounts = null;}/** Returns true if field amounts is set (has been assigned a value) and false otherwise */public boolean isSetAmounts() {return this.amounts != null;}public void setAmountsIsSet(boolean value) {if (!value) {this.amounts = null;}}public void setFieldValue(_Fields field, Object value) {switch (field) {case STATUS_COUNTS:if (value == null) {unsetStatusCounts();} else {setStatusCounts((Map<RechargeOrderStatus,Long>)value);}break;case OPERATOR_COUNTS:if (value == null) {unsetOperatorCounts();} else {setOperatorCounts((Map<String,Long>)value);}break;case CURRENT_ORDERS:if (value == null) {unsetCurrentOrders();} else {setCurrentOrders((Map<String,List<RechargeOrder>>)value);}break;case AMOUNTS:if (value == null) {unsetAmounts();} else {setAmounts((Map<String,Long>)value);}break;}}public Object getFieldValue(_Fields field) {switch (field) {case STATUS_COUNTS:return getStatusCounts();case OPERATOR_COUNTS:return getOperatorCounts();case CURRENT_ORDERS:return getCurrentOrders();case AMOUNTS:return getAmounts();}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 STATUS_COUNTS:return isSetStatusCounts();case OPERATOR_COUNTS:return isSetOperatorCounts();case CURRENT_ORDERS:return isSetCurrentOrders();case AMOUNTS:return isSetAmounts();}throw new IllegalStateException();}@Overridepublic boolean equals(Object that) {if (that == null)return false;if (that instanceof RechargeStatistics)return this.equals((RechargeStatistics)that);return false;}public boolean equals(RechargeStatistics that) {if (that == null)return false;boolean this_present_statusCounts = true && this.isSetStatusCounts();boolean that_present_statusCounts = true && that.isSetStatusCounts();if (this_present_statusCounts || that_present_statusCounts) {if (!(this_present_statusCounts && that_present_statusCounts))return false;if (!this.statusCounts.equals(that.statusCounts))return false;}boolean this_present_operatorCounts = true && this.isSetOperatorCounts();boolean that_present_operatorCounts = true && that.isSetOperatorCounts();if (this_present_operatorCounts || that_present_operatorCounts) {if (!(this_present_operatorCounts && that_present_operatorCounts))return false;if (!this.operatorCounts.equals(that.operatorCounts))return false;}boolean this_present_currentOrders = true && this.isSetCurrentOrders();boolean that_present_currentOrders = true && that.isSetCurrentOrders();if (this_present_currentOrders || that_present_currentOrders) {if (!(this_present_currentOrders && that_present_currentOrders))return false;if (!this.currentOrders.equals(that.currentOrders))return false;}boolean this_present_amounts = true && this.isSetAmounts();boolean that_present_amounts = true && that.isSetAmounts();if (this_present_amounts || that_present_amounts) {if (!(this_present_amounts && that_present_amounts))return false;if (!this.amounts.equals(that.amounts))return false;}return true;}@Overridepublic int hashCode() {return 0;}public int compareTo(RechargeStatistics other) {if (!getClass().equals(other.getClass())) {return getClass().getName().compareTo(other.getClass().getName());}int lastComparison = 0;RechargeStatistics typedOther = (RechargeStatistics)other;lastComparison = Boolean.valueOf(isSetStatusCounts()).compareTo(typedOther.isSetStatusCounts());if (lastComparison != 0) {return lastComparison;}if (isSetStatusCounts()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.statusCounts, typedOther.statusCounts);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetOperatorCounts()).compareTo(typedOther.isSetOperatorCounts());if (lastComparison != 0) {return lastComparison;}if (isSetOperatorCounts()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operatorCounts, typedOther.operatorCounts);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetCurrentOrders()).compareTo(typedOther.isSetCurrentOrders());if (lastComparison != 0) {return lastComparison;}if (isSetCurrentOrders()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.currentOrders, typedOther.currentOrders);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetAmounts()).compareTo(typedOther.isSetAmounts());if (lastComparison != 0) {return lastComparison;}if (isSetAmounts()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amounts, typedOther.amounts);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: // STATUS_COUNTSif (field.type == org.apache.thrift.protocol.TType.MAP) {{org.apache.thrift.protocol.TMap _map8 = iprot.readMapBegin();this.statusCounts = new HashMap<RechargeOrderStatus,Long>(2*_map8.size);for (int _i9 = 0; _i9 < _map8.size; ++_i9){RechargeOrderStatus _key10; // requiredlong _val11; // required_key10 = RechargeOrderStatus.findByValue(iprot.readI32());_val11 = iprot.readI64();this.statusCounts.put(_key10, _val11);}iprot.readMapEnd();}} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 2: // OPERATOR_COUNTSif (field.type == org.apache.thrift.protocol.TType.MAP) {{org.apache.thrift.protocol.TMap _map12 = iprot.readMapBegin();this.operatorCounts = new HashMap<String,Long>(2*_map12.size);for (int _i13 = 0; _i13 < _map12.size; ++_i13){String _key14; // requiredlong _val15; // required_key14 = iprot.readString();_val15 = iprot.readI64();this.operatorCounts.put(_key14, _val15);}iprot.readMapEnd();}} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 3: // CURRENT_ORDERSif (field.type == org.apache.thrift.protocol.TType.MAP) {{org.apache.thrift.protocol.TMap _map16 = iprot.readMapBegin();this.currentOrders = new HashMap<String,List<RechargeOrder>>(2*_map16.size);for (int _i17 = 0; _i17 < _map16.size; ++_i17){String _key18; // requiredList<RechargeOrder> _val19; // required_key18 = iprot.readString();{org.apache.thrift.protocol.TList _list20 = iprot.readListBegin();_val19 = new ArrayList<RechargeOrder>(_list20.size);for (int _i21 = 0; _i21 < _list20.size; ++_i21){RechargeOrder _elem22; // required_elem22 = new RechargeOrder();_elem22.read(iprot);_val19.add(_elem22);}iprot.readListEnd();}this.currentOrders.put(_key18, _val19);}iprot.readMapEnd();}} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 4: // AMOUNTSif (field.type == org.apache.thrift.protocol.TType.MAP) {{org.apache.thrift.protocol.TMap _map23 = iprot.readMapBegin();this.amounts = new HashMap<String,Long>(2*_map23.size);for (int _i24 = 0; _i24 < _map23.size; ++_i24){String _key25; // requiredlong _val26; // required_key25 = iprot.readString();_val26 = iprot.readI64();this.amounts.put(_key25, _val26);}iprot.readMapEnd();}} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;default:org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}iprot.readFieldEnd();}iprot.readStructEnd();validate();}public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {validate();oprot.writeStructBegin(STRUCT_DESC);if (this.statusCounts != null) {oprot.writeFieldBegin(STATUS_COUNTS_FIELD_DESC);{oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.I64, this.statusCounts.size()));for (Map.Entry<RechargeOrderStatus, Long> _iter27 : this.statusCounts.entrySet()){oprot.writeI32(_iter27.getKey().getValue());oprot.writeI64(_iter27.getValue());}oprot.writeMapEnd();}oprot.writeFieldEnd();}if (this.operatorCounts != null) {oprot.writeFieldBegin(OPERATOR_COUNTS_FIELD_DESC);{oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I64, this.operatorCounts.size()));for (Map.Entry<String, Long> _iter28 : this.operatorCounts.entrySet()){oprot.writeString(_iter28.getKey());oprot.writeI64(_iter28.getValue());}oprot.writeMapEnd();}oprot.writeFieldEnd();}if (this.currentOrders != null) {oprot.writeFieldBegin(CURRENT_ORDERS_FIELD_DESC);{oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.LIST, this.currentOrders.size()));for (Map.Entry<String, List<RechargeOrder>> _iter29 : this.currentOrders.entrySet()){oprot.writeString(_iter29.getKey());{oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, _iter29.getValue().size()));for (RechargeOrder _iter30 : _iter29.getValue()){_iter30.write(oprot);}oprot.writeListEnd();}}oprot.writeMapEnd();}oprot.writeFieldEnd();}if (this.amounts != null) {oprot.writeFieldBegin(AMOUNTS_FIELD_DESC);{oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I64, this.amounts.size()));for (Map.Entry<String, Long> _iter31 : this.amounts.entrySet()){oprot.writeString(_iter31.getKey());oprot.writeI64(_iter31.getValue());}oprot.writeMapEnd();}oprot.writeFieldEnd();}oprot.writeFieldStop();oprot.writeStructEnd();}@Overridepublic String toString() {StringBuilder sb = new StringBuilder("RechargeStatistics(");boolean first = true;sb.append("statusCounts:");if (this.statusCounts == null) {sb.append("null");} else {sb.append(this.statusCounts);}first = false;if (!first) sb.append(", ");sb.append("operatorCounts:");if (this.operatorCounts == null) {sb.append("null");} else {sb.append(this.operatorCounts);}first = false;if (!first) sb.append(", ");sb.append("currentOrders:");if (this.currentOrders == null) {sb.append("null");} else {sb.append(this.currentOrders);}first = false;if (!first) sb.append(", ");sb.append("amounts:");if (this.amounts == null) {sb.append("null");} else {sb.append(this.amounts);}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 {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);}}}