| 4496 |
mandeep.dh |
1 |
/**
|
|
|
2 |
* Autogenerated by Thrift Compiler (0.7.0)
|
|
|
3 |
*
|
|
|
4 |
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
|
|
5 |
*/
|
|
|
6 |
package in.shop2020.purchase;
|
|
|
7 |
|
|
|
8 |
import java.util.List;
|
|
|
9 |
import java.util.ArrayList;
|
|
|
10 |
import java.util.Map;
|
|
|
11 |
import java.util.HashMap;
|
|
|
12 |
import java.util.EnumMap;
|
|
|
13 |
import java.util.Set;
|
|
|
14 |
import java.util.HashSet;
|
|
|
15 |
import java.util.EnumSet;
|
|
|
16 |
import java.util.Collections;
|
|
|
17 |
import java.util.BitSet;
|
|
|
18 |
import java.nio.ByteBuffer;
|
|
|
19 |
import java.util.Arrays;
|
|
|
20 |
import org.slf4j.Logger;
|
|
|
21 |
import org.slf4j.LoggerFactory;
|
|
|
22 |
|
|
|
23 |
public class Purchase implements org.apache.thrift.TBase<Purchase, Purchase._Fields>, java.io.Serializable, Cloneable {
|
|
|
24 |
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Purchase");
|
|
|
25 |
|
|
|
26 |
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);
|
|
|
27 |
private static final org.apache.thrift.protocol.TField PO_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("poId", org.apache.thrift.protocol.TType.I64, (short)2);
|
|
|
28 |
private static final org.apache.thrift.protocol.TField INVOICE_NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("invoiceNumber", org.apache.thrift.protocol.TType.STRING, (short)3);
|
|
|
29 |
private static final org.apache.thrift.protocol.TField RECEIVED_ON_FIELD_DESC = new org.apache.thrift.protocol.TField("receivedOn", org.apache.thrift.protocol.TType.I64, (short)4);
|
|
|
30 |
private static final org.apache.thrift.protocol.TField FREIGHT_CHARGES_FIELD_DESC = new org.apache.thrift.protocol.TField("freightCharges", org.apache.thrift.protocol.TType.DOUBLE, (short)5);
|
|
|
31 |
|
|
|
32 |
private long id; // required
|
|
|
33 |
private long poId; // required
|
|
|
34 |
private String invoiceNumber; // required
|
|
|
35 |
private long receivedOn; // required
|
|
|
36 |
private double freightCharges; // required
|
|
|
37 |
|
|
|
38 |
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
|
|
|
39 |
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
|
|
|
40 |
ID((short)1, "id"),
|
|
|
41 |
PO_ID((short)2, "poId"),
|
|
|
42 |
INVOICE_NUMBER((short)3, "invoiceNumber"),
|
|
|
43 |
RECEIVED_ON((short)4, "receivedOn"),
|
|
|
44 |
FREIGHT_CHARGES((short)5, "freightCharges");
|
|
|
45 |
|
|
|
46 |
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
|
|
|
47 |
|
|
|
48 |
static {
|
|
|
49 |
for (_Fields field : EnumSet.allOf(_Fields.class)) {
|
|
|
50 |
byName.put(field.getFieldName(), field);
|
|
|
51 |
}
|
|
|
52 |
}
|
|
|
53 |
|
|
|
54 |
/**
|
|
|
55 |
* Find the _Fields constant that matches fieldId, or null if its not found.
|
|
|
56 |
*/
|
|
|
57 |
public static _Fields findByThriftId(int fieldId) {
|
|
|
58 |
switch(fieldId) {
|
|
|
59 |
case 1: // ID
|
|
|
60 |
return ID;
|
|
|
61 |
case 2: // PO_ID
|
|
|
62 |
return PO_ID;
|
|
|
63 |
case 3: // INVOICE_NUMBER
|
|
|
64 |
return INVOICE_NUMBER;
|
|
|
65 |
case 4: // RECEIVED_ON
|
|
|
66 |
return RECEIVED_ON;
|
|
|
67 |
case 5: // FREIGHT_CHARGES
|
|
|
68 |
return FREIGHT_CHARGES;
|
|
|
69 |
default:
|
|
|
70 |
return null;
|
|
|
71 |
}
|
|
|
72 |
}
|
|
|
73 |
|
|
|
74 |
/**
|
|
|
75 |
* Find the _Fields constant that matches fieldId, throwing an exception
|
|
|
76 |
* if it is not found.
|
|
|
77 |
*/
|
|
|
78 |
public static _Fields findByThriftIdOrThrow(int fieldId) {
|
|
|
79 |
_Fields fields = findByThriftId(fieldId);
|
|
|
80 |
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
|
|
|
81 |
return fields;
|
|
|
82 |
}
|
|
|
83 |
|
|
|
84 |
/**
|
|
|
85 |
* Find the _Fields constant that matches name, or null if its not found.
|
|
|
86 |
*/
|
|
|
87 |
public static _Fields findByName(String name) {
|
|
|
88 |
return byName.get(name);
|
|
|
89 |
}
|
|
|
90 |
|
|
|
91 |
private final short _thriftId;
|
|
|
92 |
private final String _fieldName;
|
|
|
93 |
|
|
|
94 |
_Fields(short thriftId, String fieldName) {
|
|
|
95 |
_thriftId = thriftId;
|
|
|
96 |
_fieldName = fieldName;
|
|
|
97 |
}
|
|
|
98 |
|
|
|
99 |
public short getThriftFieldId() {
|
|
|
100 |
return _thriftId;
|
|
|
101 |
}
|
|
|
102 |
|
|
|
103 |
public String getFieldName() {
|
|
|
104 |
return _fieldName;
|
|
|
105 |
}
|
|
|
106 |
}
|
|
|
107 |
|
|
|
108 |
// isset id assignments
|
|
|
109 |
private static final int __ID_ISSET_ID = 0;
|
|
|
110 |
private static final int __POID_ISSET_ID = 1;
|
|
|
111 |
private static final int __RECEIVEDON_ISSET_ID = 2;
|
|
|
112 |
private static final int __FREIGHTCHARGES_ISSET_ID = 3;
|
|
|
113 |
private BitSet __isset_bit_vector = new BitSet(4);
|
|
|
114 |
|
|
|
115 |
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
|
|
|
116 |
static {
|
|
|
117 |
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
|
|
|
118 |
tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
|
|
119 |
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
|
|
|
120 |
tmpMap.put(_Fields.PO_ID, new org.apache.thrift.meta_data.FieldMetaData("poId", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
|
|
121 |
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
|
|
|
122 |
tmpMap.put(_Fields.INVOICE_NUMBER, new org.apache.thrift.meta_data.FieldMetaData("invoiceNumber", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
|
|
123 |
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
|
|
|
124 |
tmpMap.put(_Fields.RECEIVED_ON, new org.apache.thrift.meta_data.FieldMetaData("receivedOn", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
|
|
125 |
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
|
|
|
126 |
tmpMap.put(_Fields.FREIGHT_CHARGES, new org.apache.thrift.meta_data.FieldMetaData("freightCharges", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
|
|
127 |
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
|
|
|
128 |
metaDataMap = Collections.unmodifiableMap(tmpMap);
|
|
|
129 |
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Purchase.class, metaDataMap);
|
|
|
130 |
}
|
|
|
131 |
|
|
|
132 |
public Purchase() {
|
|
|
133 |
}
|
|
|
134 |
|
|
|
135 |
public Purchase(
|
|
|
136 |
long id,
|
|
|
137 |
long poId,
|
|
|
138 |
String invoiceNumber,
|
|
|
139 |
long receivedOn,
|
|
|
140 |
double freightCharges)
|
|
|
141 |
{
|
|
|
142 |
this();
|
|
|
143 |
this.id = id;
|
|
|
144 |
setIdIsSet(true);
|
|
|
145 |
this.poId = poId;
|
|
|
146 |
setPoIdIsSet(true);
|
|
|
147 |
this.invoiceNumber = invoiceNumber;
|
|
|
148 |
this.receivedOn = receivedOn;
|
|
|
149 |
setReceivedOnIsSet(true);
|
|
|
150 |
this.freightCharges = freightCharges;
|
|
|
151 |
setFreightChargesIsSet(true);
|
|
|
152 |
}
|
|
|
153 |
|
|
|
154 |
/**
|
|
|
155 |
* Performs a deep copy on <i>other</i>.
|
|
|
156 |
*/
|
|
|
157 |
public Purchase(Purchase other) {
|
|
|
158 |
__isset_bit_vector.clear();
|
|
|
159 |
__isset_bit_vector.or(other.__isset_bit_vector);
|
|
|
160 |
this.id = other.id;
|
|
|
161 |
this.poId = other.poId;
|
|
|
162 |
if (other.isSetInvoiceNumber()) {
|
|
|
163 |
this.invoiceNumber = other.invoiceNumber;
|
|
|
164 |
}
|
|
|
165 |
this.receivedOn = other.receivedOn;
|
|
|
166 |
this.freightCharges = other.freightCharges;
|
|
|
167 |
}
|
|
|
168 |
|
|
|
169 |
public Purchase deepCopy() {
|
|
|
170 |
return new Purchase(this);
|
|
|
171 |
}
|
|
|
172 |
|
|
|
173 |
@Override
|
|
|
174 |
public void clear() {
|
|
|
175 |
setIdIsSet(false);
|
|
|
176 |
this.id = 0;
|
|
|
177 |
setPoIdIsSet(false);
|
|
|
178 |
this.poId = 0;
|
|
|
179 |
this.invoiceNumber = null;
|
|
|
180 |
setReceivedOnIsSet(false);
|
|
|
181 |
this.receivedOn = 0;
|
|
|
182 |
setFreightChargesIsSet(false);
|
|
|
183 |
this.freightCharges = 0.0;
|
|
|
184 |
}
|
|
|
185 |
|
|
|
186 |
public long getId() {
|
|
|
187 |
return this.id;
|
|
|
188 |
}
|
|
|
189 |
|
|
|
190 |
public void setId(long id) {
|
|
|
191 |
this.id = id;
|
|
|
192 |
setIdIsSet(true);
|
|
|
193 |
}
|
|
|
194 |
|
|
|
195 |
public void unsetId() {
|
|
|
196 |
__isset_bit_vector.clear(__ID_ISSET_ID);
|
|
|
197 |
}
|
|
|
198 |
|
|
|
199 |
/** Returns true if field id is set (has been assigned a value) and false otherwise */
|
|
|
200 |
public boolean isSetId() {
|
|
|
201 |
return __isset_bit_vector.get(__ID_ISSET_ID);
|
|
|
202 |
}
|
|
|
203 |
|
|
|
204 |
public void setIdIsSet(boolean value) {
|
|
|
205 |
__isset_bit_vector.set(__ID_ISSET_ID, value);
|
|
|
206 |
}
|
|
|
207 |
|
|
|
208 |
public long getPoId() {
|
|
|
209 |
return this.poId;
|
|
|
210 |
}
|
|
|
211 |
|
|
|
212 |
public void setPoId(long poId) {
|
|
|
213 |
this.poId = poId;
|
|
|
214 |
setPoIdIsSet(true);
|
|
|
215 |
}
|
|
|
216 |
|
|
|
217 |
public void unsetPoId() {
|
|
|
218 |
__isset_bit_vector.clear(__POID_ISSET_ID);
|
|
|
219 |
}
|
|
|
220 |
|
|
|
221 |
/** Returns true if field poId is set (has been assigned a value) and false otherwise */
|
|
|
222 |
public boolean isSetPoId() {
|
|
|
223 |
return __isset_bit_vector.get(__POID_ISSET_ID);
|
|
|
224 |
}
|
|
|
225 |
|
|
|
226 |
public void setPoIdIsSet(boolean value) {
|
|
|
227 |
__isset_bit_vector.set(__POID_ISSET_ID, value);
|
|
|
228 |
}
|
|
|
229 |
|
|
|
230 |
public String getInvoiceNumber() {
|
|
|
231 |
return this.invoiceNumber;
|
|
|
232 |
}
|
|
|
233 |
|
|
|
234 |
public void setInvoiceNumber(String invoiceNumber) {
|
|
|
235 |
this.invoiceNumber = invoiceNumber;
|
|
|
236 |
}
|
|
|
237 |
|
|
|
238 |
public void unsetInvoiceNumber() {
|
|
|
239 |
this.invoiceNumber = null;
|
|
|
240 |
}
|
|
|
241 |
|
|
|
242 |
/** Returns true if field invoiceNumber is set (has been assigned a value) and false otherwise */
|
|
|
243 |
public boolean isSetInvoiceNumber() {
|
|
|
244 |
return this.invoiceNumber != null;
|
|
|
245 |
}
|
|
|
246 |
|
|
|
247 |
public void setInvoiceNumberIsSet(boolean value) {
|
|
|
248 |
if (!value) {
|
|
|
249 |
this.invoiceNumber = null;
|
|
|
250 |
}
|
|
|
251 |
}
|
|
|
252 |
|
|
|
253 |
public long getReceivedOn() {
|
|
|
254 |
return this.receivedOn;
|
|
|
255 |
}
|
|
|
256 |
|
|
|
257 |
public void setReceivedOn(long receivedOn) {
|
|
|
258 |
this.receivedOn = receivedOn;
|
|
|
259 |
setReceivedOnIsSet(true);
|
|
|
260 |
}
|
|
|
261 |
|
|
|
262 |
public void unsetReceivedOn() {
|
|
|
263 |
__isset_bit_vector.clear(__RECEIVEDON_ISSET_ID);
|
|
|
264 |
}
|
|
|
265 |
|
|
|
266 |
/** Returns true if field receivedOn is set (has been assigned a value) and false otherwise */
|
|
|
267 |
public boolean isSetReceivedOn() {
|
|
|
268 |
return __isset_bit_vector.get(__RECEIVEDON_ISSET_ID);
|
|
|
269 |
}
|
|
|
270 |
|
|
|
271 |
public void setReceivedOnIsSet(boolean value) {
|
|
|
272 |
__isset_bit_vector.set(__RECEIVEDON_ISSET_ID, value);
|
|
|
273 |
}
|
|
|
274 |
|
|
|
275 |
public double getFreightCharges() {
|
|
|
276 |
return this.freightCharges;
|
|
|
277 |
}
|
|
|
278 |
|
|
|
279 |
public void setFreightCharges(double freightCharges) {
|
|
|
280 |
this.freightCharges = freightCharges;
|
|
|
281 |
setFreightChargesIsSet(true);
|
|
|
282 |
}
|
|
|
283 |
|
|
|
284 |
public void unsetFreightCharges() {
|
|
|
285 |
__isset_bit_vector.clear(__FREIGHTCHARGES_ISSET_ID);
|
|
|
286 |
}
|
|
|
287 |
|
|
|
288 |
/** Returns true if field freightCharges is set (has been assigned a value) and false otherwise */
|
|
|
289 |
public boolean isSetFreightCharges() {
|
|
|
290 |
return __isset_bit_vector.get(__FREIGHTCHARGES_ISSET_ID);
|
|
|
291 |
}
|
|
|
292 |
|
|
|
293 |
public void setFreightChargesIsSet(boolean value) {
|
|
|
294 |
__isset_bit_vector.set(__FREIGHTCHARGES_ISSET_ID, value);
|
|
|
295 |
}
|
|
|
296 |
|
|
|
297 |
public void setFieldValue(_Fields field, Object value) {
|
|
|
298 |
switch (field) {
|
|
|
299 |
case ID:
|
|
|
300 |
if (value == null) {
|
|
|
301 |
unsetId();
|
|
|
302 |
} else {
|
|
|
303 |
setId((Long)value);
|
|
|
304 |
}
|
|
|
305 |
break;
|
|
|
306 |
|
|
|
307 |
case PO_ID:
|
|
|
308 |
if (value == null) {
|
|
|
309 |
unsetPoId();
|
|
|
310 |
} else {
|
|
|
311 |
setPoId((Long)value);
|
|
|
312 |
}
|
|
|
313 |
break;
|
|
|
314 |
|
|
|
315 |
case INVOICE_NUMBER:
|
|
|
316 |
if (value == null) {
|
|
|
317 |
unsetInvoiceNumber();
|
|
|
318 |
} else {
|
|
|
319 |
setInvoiceNumber((String)value);
|
|
|
320 |
}
|
|
|
321 |
break;
|
|
|
322 |
|
|
|
323 |
case RECEIVED_ON:
|
|
|
324 |
if (value == null) {
|
|
|
325 |
unsetReceivedOn();
|
|
|
326 |
} else {
|
|
|
327 |
setReceivedOn((Long)value);
|
|
|
328 |
}
|
|
|
329 |
break;
|
|
|
330 |
|
|
|
331 |
case FREIGHT_CHARGES:
|
|
|
332 |
if (value == null) {
|
|
|
333 |
unsetFreightCharges();
|
|
|
334 |
} else {
|
|
|
335 |
setFreightCharges((Double)value);
|
|
|
336 |
}
|
|
|
337 |
break;
|
|
|
338 |
|
|
|
339 |
}
|
|
|
340 |
}
|
|
|
341 |
|
|
|
342 |
public Object getFieldValue(_Fields field) {
|
|
|
343 |
switch (field) {
|
|
|
344 |
case ID:
|
|
|
345 |
return Long.valueOf(getId());
|
|
|
346 |
|
|
|
347 |
case PO_ID:
|
|
|
348 |
return Long.valueOf(getPoId());
|
|
|
349 |
|
|
|
350 |
case INVOICE_NUMBER:
|
|
|
351 |
return getInvoiceNumber();
|
|
|
352 |
|
|
|
353 |
case RECEIVED_ON:
|
|
|
354 |
return Long.valueOf(getReceivedOn());
|
|
|
355 |
|
|
|
356 |
case FREIGHT_CHARGES:
|
|
|
357 |
return Double.valueOf(getFreightCharges());
|
|
|
358 |
|
|
|
359 |
}
|
|
|
360 |
throw new IllegalStateException();
|
|
|
361 |
}
|
|
|
362 |
|
|
|
363 |
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
|
|
|
364 |
public boolean isSet(_Fields field) {
|
|
|
365 |
if (field == null) {
|
|
|
366 |
throw new IllegalArgumentException();
|
|
|
367 |
}
|
|
|
368 |
|
|
|
369 |
switch (field) {
|
|
|
370 |
case ID:
|
|
|
371 |
return isSetId();
|
|
|
372 |
case PO_ID:
|
|
|
373 |
return isSetPoId();
|
|
|
374 |
case INVOICE_NUMBER:
|
|
|
375 |
return isSetInvoiceNumber();
|
|
|
376 |
case RECEIVED_ON:
|
|
|
377 |
return isSetReceivedOn();
|
|
|
378 |
case FREIGHT_CHARGES:
|
|
|
379 |
return isSetFreightCharges();
|
|
|
380 |
}
|
|
|
381 |
throw new IllegalStateException();
|
|
|
382 |
}
|
|
|
383 |
|
|
|
384 |
@Override
|
|
|
385 |
public boolean equals(Object that) {
|
|
|
386 |
if (that == null)
|
|
|
387 |
return false;
|
|
|
388 |
if (that instanceof Purchase)
|
|
|
389 |
return this.equals((Purchase)that);
|
|
|
390 |
return false;
|
|
|
391 |
}
|
|
|
392 |
|
|
|
393 |
public boolean equals(Purchase that) {
|
|
|
394 |
if (that == null)
|
|
|
395 |
return false;
|
|
|
396 |
|
|
|
397 |
boolean this_present_id = true;
|
|
|
398 |
boolean that_present_id = true;
|
|
|
399 |
if (this_present_id || that_present_id) {
|
|
|
400 |
if (!(this_present_id && that_present_id))
|
|
|
401 |
return false;
|
|
|
402 |
if (this.id != that.id)
|
|
|
403 |
return false;
|
|
|
404 |
}
|
|
|
405 |
|
|
|
406 |
boolean this_present_poId = true;
|
|
|
407 |
boolean that_present_poId = true;
|
|
|
408 |
if (this_present_poId || that_present_poId) {
|
|
|
409 |
if (!(this_present_poId && that_present_poId))
|
|
|
410 |
return false;
|
|
|
411 |
if (this.poId != that.poId)
|
|
|
412 |
return false;
|
|
|
413 |
}
|
|
|
414 |
|
|
|
415 |
boolean this_present_invoiceNumber = true && this.isSetInvoiceNumber();
|
|
|
416 |
boolean that_present_invoiceNumber = true && that.isSetInvoiceNumber();
|
|
|
417 |
if (this_present_invoiceNumber || that_present_invoiceNumber) {
|
|
|
418 |
if (!(this_present_invoiceNumber && that_present_invoiceNumber))
|
|
|
419 |
return false;
|
|
|
420 |
if (!this.invoiceNumber.equals(that.invoiceNumber))
|
|
|
421 |
return false;
|
|
|
422 |
}
|
|
|
423 |
|
|
|
424 |
boolean this_present_receivedOn = true;
|
|
|
425 |
boolean that_present_receivedOn = true;
|
|
|
426 |
if (this_present_receivedOn || that_present_receivedOn) {
|
|
|
427 |
if (!(this_present_receivedOn && that_present_receivedOn))
|
|
|
428 |
return false;
|
|
|
429 |
if (this.receivedOn != that.receivedOn)
|
|
|
430 |
return false;
|
|
|
431 |
}
|
|
|
432 |
|
|
|
433 |
boolean this_present_freightCharges = true;
|
|
|
434 |
boolean that_present_freightCharges = true;
|
|
|
435 |
if (this_present_freightCharges || that_present_freightCharges) {
|
|
|
436 |
if (!(this_present_freightCharges && that_present_freightCharges))
|
|
|
437 |
return false;
|
|
|
438 |
if (this.freightCharges != that.freightCharges)
|
|
|
439 |
return false;
|
|
|
440 |
}
|
|
|
441 |
|
|
|
442 |
return true;
|
|
|
443 |
}
|
|
|
444 |
|
|
|
445 |
@Override
|
|
|
446 |
public int hashCode() {
|
|
|
447 |
return 0;
|
|
|
448 |
}
|
|
|
449 |
|
|
|
450 |
public int compareTo(Purchase other) {
|
|
|
451 |
if (!getClass().equals(other.getClass())) {
|
|
|
452 |
return getClass().getName().compareTo(other.getClass().getName());
|
|
|
453 |
}
|
|
|
454 |
|
|
|
455 |
int lastComparison = 0;
|
|
|
456 |
Purchase typedOther = (Purchase)other;
|
|
|
457 |
|
|
|
458 |
lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
|
|
|
459 |
if (lastComparison != 0) {
|
|
|
460 |
return lastComparison;
|
|
|
461 |
}
|
|
|
462 |
if (isSetId()) {
|
|
|
463 |
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
|
|
|
464 |
if (lastComparison != 0) {
|
|
|
465 |
return lastComparison;
|
|
|
466 |
}
|
|
|
467 |
}
|
|
|
468 |
lastComparison = Boolean.valueOf(isSetPoId()).compareTo(typedOther.isSetPoId());
|
|
|
469 |
if (lastComparison != 0) {
|
|
|
470 |
return lastComparison;
|
|
|
471 |
}
|
|
|
472 |
if (isSetPoId()) {
|
|
|
473 |
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.poId, typedOther.poId);
|
|
|
474 |
if (lastComparison != 0) {
|
|
|
475 |
return lastComparison;
|
|
|
476 |
}
|
|
|
477 |
}
|
|
|
478 |
lastComparison = Boolean.valueOf(isSetInvoiceNumber()).compareTo(typedOther.isSetInvoiceNumber());
|
|
|
479 |
if (lastComparison != 0) {
|
|
|
480 |
return lastComparison;
|
|
|
481 |
}
|
|
|
482 |
if (isSetInvoiceNumber()) {
|
|
|
483 |
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.invoiceNumber, typedOther.invoiceNumber);
|
|
|
484 |
if (lastComparison != 0) {
|
|
|
485 |
return lastComparison;
|
|
|
486 |
}
|
|
|
487 |
}
|
|
|
488 |
lastComparison = Boolean.valueOf(isSetReceivedOn()).compareTo(typedOther.isSetReceivedOn());
|
|
|
489 |
if (lastComparison != 0) {
|
|
|
490 |
return lastComparison;
|
|
|
491 |
}
|
|
|
492 |
if (isSetReceivedOn()) {
|
|
|
493 |
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.receivedOn, typedOther.receivedOn);
|
|
|
494 |
if (lastComparison != 0) {
|
|
|
495 |
return lastComparison;
|
|
|
496 |
}
|
|
|
497 |
}
|
|
|
498 |
lastComparison = Boolean.valueOf(isSetFreightCharges()).compareTo(typedOther.isSetFreightCharges());
|
|
|
499 |
if (lastComparison != 0) {
|
|
|
500 |
return lastComparison;
|
|
|
501 |
}
|
|
|
502 |
if (isSetFreightCharges()) {
|
|
|
503 |
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.freightCharges, typedOther.freightCharges);
|
|
|
504 |
if (lastComparison != 0) {
|
|
|
505 |
return lastComparison;
|
|
|
506 |
}
|
|
|
507 |
}
|
|
|
508 |
return 0;
|
|
|
509 |
}
|
|
|
510 |
|
|
|
511 |
public _Fields fieldForId(int fieldId) {
|
|
|
512 |
return _Fields.findByThriftId(fieldId);
|
|
|
513 |
}
|
|
|
514 |
|
|
|
515 |
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
|
|
|
516 |
org.apache.thrift.protocol.TField field;
|
|
|
517 |
iprot.readStructBegin();
|
|
|
518 |
while (true)
|
|
|
519 |
{
|
|
|
520 |
field = iprot.readFieldBegin();
|
|
|
521 |
if (field.type == org.apache.thrift.protocol.TType.STOP) {
|
|
|
522 |
break;
|
|
|
523 |
}
|
|
|
524 |
switch (field.id) {
|
|
|
525 |
case 1: // ID
|
|
|
526 |
if (field.type == org.apache.thrift.protocol.TType.I64) {
|
|
|
527 |
this.id = iprot.readI64();
|
|
|
528 |
setIdIsSet(true);
|
|
|
529 |
} else {
|
|
|
530 |
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
|
|
531 |
}
|
|
|
532 |
break;
|
|
|
533 |
case 2: // PO_ID
|
|
|
534 |
if (field.type == org.apache.thrift.protocol.TType.I64) {
|
|
|
535 |
this.poId = iprot.readI64();
|
|
|
536 |
setPoIdIsSet(true);
|
|
|
537 |
} else {
|
|
|
538 |
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
|
|
539 |
}
|
|
|
540 |
break;
|
|
|
541 |
case 3: // INVOICE_NUMBER
|
|
|
542 |
if (field.type == org.apache.thrift.protocol.TType.STRING) {
|
|
|
543 |
this.invoiceNumber = iprot.readString();
|
|
|
544 |
} else {
|
|
|
545 |
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
|
|
546 |
}
|
|
|
547 |
break;
|
|
|
548 |
case 4: // RECEIVED_ON
|
|
|
549 |
if (field.type == org.apache.thrift.protocol.TType.I64) {
|
|
|
550 |
this.receivedOn = iprot.readI64();
|
|
|
551 |
setReceivedOnIsSet(true);
|
|
|
552 |
} else {
|
|
|
553 |
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
|
|
554 |
}
|
|
|
555 |
break;
|
|
|
556 |
case 5: // FREIGHT_CHARGES
|
|
|
557 |
if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
|
|
|
558 |
this.freightCharges = iprot.readDouble();
|
|
|
559 |
setFreightChargesIsSet(true);
|
|
|
560 |
} else {
|
|
|
561 |
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
|
|
562 |
}
|
|
|
563 |
break;
|
|
|
564 |
default:
|
|
|
565 |
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
|
|
566 |
}
|
|
|
567 |
iprot.readFieldEnd();
|
|
|
568 |
}
|
|
|
569 |
iprot.readStructEnd();
|
|
|
570 |
validate();
|
|
|
571 |
}
|
|
|
572 |
|
|
|
573 |
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
|
|
|
574 |
validate();
|
|
|
575 |
|
|
|
576 |
oprot.writeStructBegin(STRUCT_DESC);
|
|
|
577 |
oprot.writeFieldBegin(ID_FIELD_DESC);
|
|
|
578 |
oprot.writeI64(this.id);
|
|
|
579 |
oprot.writeFieldEnd();
|
|
|
580 |
oprot.writeFieldBegin(PO_ID_FIELD_DESC);
|
|
|
581 |
oprot.writeI64(this.poId);
|
|
|
582 |
oprot.writeFieldEnd();
|
|
|
583 |
if (this.invoiceNumber != null) {
|
|
|
584 |
oprot.writeFieldBegin(INVOICE_NUMBER_FIELD_DESC);
|
|
|
585 |
oprot.writeString(this.invoiceNumber);
|
|
|
586 |
oprot.writeFieldEnd();
|
|
|
587 |
}
|
|
|
588 |
oprot.writeFieldBegin(RECEIVED_ON_FIELD_DESC);
|
|
|
589 |
oprot.writeI64(this.receivedOn);
|
|
|
590 |
oprot.writeFieldEnd();
|
|
|
591 |
oprot.writeFieldBegin(FREIGHT_CHARGES_FIELD_DESC);
|
|
|
592 |
oprot.writeDouble(this.freightCharges);
|
|
|
593 |
oprot.writeFieldEnd();
|
|
|
594 |
oprot.writeFieldStop();
|
|
|
595 |
oprot.writeStructEnd();
|
|
|
596 |
}
|
|
|
597 |
|
|
|
598 |
@Override
|
|
|
599 |
public String toString() {
|
|
|
600 |
StringBuilder sb = new StringBuilder("Purchase(");
|
|
|
601 |
boolean first = true;
|
|
|
602 |
|
|
|
603 |
sb.append("id:");
|
|
|
604 |
sb.append(this.id);
|
|
|
605 |
first = false;
|
|
|
606 |
if (!first) sb.append(", ");
|
|
|
607 |
sb.append("poId:");
|
|
|
608 |
sb.append(this.poId);
|
|
|
609 |
first = false;
|
|
|
610 |
if (!first) sb.append(", ");
|
|
|
611 |
sb.append("invoiceNumber:");
|
|
|
612 |
if (this.invoiceNumber == null) {
|
|
|
613 |
sb.append("null");
|
|
|
614 |
} else {
|
|
|
615 |
sb.append(this.invoiceNumber);
|
|
|
616 |
}
|
|
|
617 |
first = false;
|
|
|
618 |
if (!first) sb.append(", ");
|
|
|
619 |
sb.append("receivedOn:");
|
|
|
620 |
sb.append(this.receivedOn);
|
|
|
621 |
first = false;
|
|
|
622 |
if (!first) sb.append(", ");
|
|
|
623 |
sb.append("freightCharges:");
|
|
|
624 |
sb.append(this.freightCharges);
|
|
|
625 |
first = false;
|
|
|
626 |
sb.append(")");
|
|
|
627 |
return sb.toString();
|
|
|
628 |
}
|
|
|
629 |
|
|
|
630 |
public void validate() throws org.apache.thrift.TException {
|
|
|
631 |
// check for required fields
|
|
|
632 |
}
|
|
|
633 |
|
|
|
634 |
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
|
|
|
635 |
try {
|
|
|
636 |
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
|
|
|
637 |
} catch (org.apache.thrift.TException te) {
|
|
|
638 |
throw new java.io.IOException(te);
|
|
|
639 |
}
|
|
|
640 |
}
|
|
|
641 |
|
|
|
642 |
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
|
|
|
643 |
try {
|
|
|
644 |
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
|
|
|
645 |
__isset_bit_vector = new BitSet(1);
|
|
|
646 |
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
|
|
|
647 |
} catch (org.apache.thrift.TException te) {
|
|
|
648 |
throw new java.io.IOException(te);
|
|
|
649 |
}
|
|
|
650 |
}
|
|
|
651 |
|
|
|
652 |
}
|
|
|
653 |
|