| 12800 |
manish.sha |
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.warehouse;
|
|
|
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 InvAgeConsiderItems implements org.apache.thrift.TBase<InvAgeConsiderItems, InvAgeConsiderItems._Fields>, java.io.Serializable, Cloneable {
|
|
|
24 |
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("InvAgeConsiderItems");
|
|
|
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 ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("itemId", org.apache.thrift.protocol.TType.I64, (short)2);
|
|
|
28 |
private static final org.apache.thrift.protocol.TField CURRENT_QUANTITY_FIELD_DESC = new org.apache.thrift.protocol.TField("currentQuantity", org.apache.thrift.protocol.TType.I64, (short)3);
|
|
|
29 |
private static final org.apache.thrift.protocol.TField PURCHASE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("purchaseId", org.apache.thrift.protocol.TType.I64, (short)4);
|
|
|
30 |
private static final org.apache.thrift.protocol.TField AGE_FIELD_DESC = new org.apache.thrift.protocol.TField("age", org.apache.thrift.protocol.TType.DOUBLE, (short)5);
|
|
|
31 |
private static final org.apache.thrift.protocol.TField CATEGORY_FIELD_DESC = new org.apache.thrift.protocol.TField("category", org.apache.thrift.protocol.TType.STRING, (short)6);
|
|
|
32 |
private static final org.apache.thrift.protocol.TField COST_FIELD_DESC = new org.apache.thrift.protocol.TField("cost", org.apache.thrift.protocol.TType.I64, (short)7);
|
|
|
33 |
|
|
|
34 |
private long id; // required
|
|
|
35 |
private long itemId; // required
|
|
|
36 |
private long currentQuantity; // required
|
|
|
37 |
private long purchaseId; // required
|
|
|
38 |
private double age; // required
|
|
|
39 |
private String category; // required
|
|
|
40 |
private long cost; // required
|
|
|
41 |
|
|
|
42 |
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
|
|
|
43 |
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
|
|
|
44 |
ID((short)1, "id"),
|
|
|
45 |
ITEM_ID((short)2, "itemId"),
|
|
|
46 |
CURRENT_QUANTITY((short)3, "currentQuantity"),
|
|
|
47 |
PURCHASE_ID((short)4, "purchaseId"),
|
|
|
48 |
AGE((short)5, "age"),
|
|
|
49 |
CATEGORY((short)6, "category"),
|
|
|
50 |
COST((short)7, "cost");
|
|
|
51 |
|
|
|
52 |
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
|
|
|
53 |
|
|
|
54 |
static {
|
|
|
55 |
for (_Fields field : EnumSet.allOf(_Fields.class)) {
|
|
|
56 |
byName.put(field.getFieldName(), field);
|
|
|
57 |
}
|
|
|
58 |
}
|
|
|
59 |
|
|
|
60 |
/**
|
|
|
61 |
* Find the _Fields constant that matches fieldId, or null if its not found.
|
|
|
62 |
*/
|
|
|
63 |
public static _Fields findByThriftId(int fieldId) {
|
|
|
64 |
switch(fieldId) {
|
|
|
65 |
case 1: // ID
|
|
|
66 |
return ID;
|
|
|
67 |
case 2: // ITEM_ID
|
|
|
68 |
return ITEM_ID;
|
|
|
69 |
case 3: // CURRENT_QUANTITY
|
|
|
70 |
return CURRENT_QUANTITY;
|
|
|
71 |
case 4: // PURCHASE_ID
|
|
|
72 |
return PURCHASE_ID;
|
|
|
73 |
case 5: // AGE
|
|
|
74 |
return AGE;
|
|
|
75 |
case 6: // CATEGORY
|
|
|
76 |
return CATEGORY;
|
|
|
77 |
case 7: // COST
|
|
|
78 |
return COST;
|
|
|
79 |
default:
|
|
|
80 |
return null;
|
|
|
81 |
}
|
|
|
82 |
}
|
|
|
83 |
|
|
|
84 |
/**
|
|
|
85 |
* Find the _Fields constant that matches fieldId, throwing an exception
|
|
|
86 |
* if it is not found.
|
|
|
87 |
*/
|
|
|
88 |
public static _Fields findByThriftIdOrThrow(int fieldId) {
|
|
|
89 |
_Fields fields = findByThriftId(fieldId);
|
|
|
90 |
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
|
|
|
91 |
return fields;
|
|
|
92 |
}
|
|
|
93 |
|
|
|
94 |
/**
|
|
|
95 |
* Find the _Fields constant that matches name, or null if its not found.
|
|
|
96 |
*/
|
|
|
97 |
public static _Fields findByName(String name) {
|
|
|
98 |
return byName.get(name);
|
|
|
99 |
}
|
|
|
100 |
|
|
|
101 |
private final short _thriftId;
|
|
|
102 |
private final String _fieldName;
|
|
|
103 |
|
|
|
104 |
_Fields(short thriftId, String fieldName) {
|
|
|
105 |
_thriftId = thriftId;
|
|
|
106 |
_fieldName = fieldName;
|
|
|
107 |
}
|
|
|
108 |
|
|
|
109 |
public short getThriftFieldId() {
|
|
|
110 |
return _thriftId;
|
|
|
111 |
}
|
|
|
112 |
|
|
|
113 |
public String getFieldName() {
|
|
|
114 |
return _fieldName;
|
|
|
115 |
}
|
|
|
116 |
}
|
|
|
117 |
|
|
|
118 |
// isset id assignments
|
|
|
119 |
private static final int __ID_ISSET_ID = 0;
|
|
|
120 |
private static final int __ITEMID_ISSET_ID = 1;
|
|
|
121 |
private static final int __CURRENTQUANTITY_ISSET_ID = 2;
|
|
|
122 |
private static final int __PURCHASEID_ISSET_ID = 3;
|
|
|
123 |
private static final int __AGE_ISSET_ID = 4;
|
|
|
124 |
private static final int __COST_ISSET_ID = 5;
|
|
|
125 |
private BitSet __isset_bit_vector = new BitSet(6);
|
|
|
126 |
|
|
|
127 |
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
|
|
|
128 |
static {
|
|
|
129 |
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
|
|
|
130 |
tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
|
|
131 |
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
|
|
|
132 |
tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("itemId", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
|
|
133 |
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
|
|
|
134 |
tmpMap.put(_Fields.CURRENT_QUANTITY, new org.apache.thrift.meta_data.FieldMetaData("currentQuantity", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
|
|
135 |
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
|
|
|
136 |
tmpMap.put(_Fields.PURCHASE_ID, new org.apache.thrift.meta_data.FieldMetaData("purchaseId", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
|
|
137 |
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
|
|
|
138 |
tmpMap.put(_Fields.AGE, new org.apache.thrift.meta_data.FieldMetaData("age", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
|
|
139 |
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
|
|
|
140 |
tmpMap.put(_Fields.CATEGORY, new org.apache.thrift.meta_data.FieldMetaData("category", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
|
|
141 |
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
|
|
|
142 |
tmpMap.put(_Fields.COST, new org.apache.thrift.meta_data.FieldMetaData("cost", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
|
|
143 |
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
|
|
|
144 |
metaDataMap = Collections.unmodifiableMap(tmpMap);
|
|
|
145 |
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(InvAgeConsiderItems.class, metaDataMap);
|
|
|
146 |
}
|
|
|
147 |
|
|
|
148 |
public InvAgeConsiderItems() {
|
|
|
149 |
}
|
|
|
150 |
|
|
|
151 |
public InvAgeConsiderItems(
|
|
|
152 |
long id,
|
|
|
153 |
long itemId,
|
|
|
154 |
long currentQuantity,
|
|
|
155 |
long purchaseId,
|
|
|
156 |
double age,
|
|
|
157 |
String category,
|
|
|
158 |
long cost)
|
|
|
159 |
{
|
|
|
160 |
this();
|
|
|
161 |
this.id = id;
|
|
|
162 |
setIdIsSet(true);
|
|
|
163 |
this.itemId = itemId;
|
|
|
164 |
setItemIdIsSet(true);
|
|
|
165 |
this.currentQuantity = currentQuantity;
|
|
|
166 |
setCurrentQuantityIsSet(true);
|
|
|
167 |
this.purchaseId = purchaseId;
|
|
|
168 |
setPurchaseIdIsSet(true);
|
|
|
169 |
this.age = age;
|
|
|
170 |
setAgeIsSet(true);
|
|
|
171 |
this.category = category;
|
|
|
172 |
this.cost = cost;
|
|
|
173 |
setCostIsSet(true);
|
|
|
174 |
}
|
|
|
175 |
|
|
|
176 |
/**
|
|
|
177 |
* Performs a deep copy on <i>other</i>.
|
|
|
178 |
*/
|
|
|
179 |
public InvAgeConsiderItems(InvAgeConsiderItems other) {
|
|
|
180 |
__isset_bit_vector.clear();
|
|
|
181 |
__isset_bit_vector.or(other.__isset_bit_vector);
|
|
|
182 |
this.id = other.id;
|
|
|
183 |
this.itemId = other.itemId;
|
|
|
184 |
this.currentQuantity = other.currentQuantity;
|
|
|
185 |
this.purchaseId = other.purchaseId;
|
|
|
186 |
this.age = other.age;
|
|
|
187 |
if (other.isSetCategory()) {
|
|
|
188 |
this.category = other.category;
|
|
|
189 |
}
|
|
|
190 |
this.cost = other.cost;
|
|
|
191 |
}
|
|
|
192 |
|
|
|
193 |
public InvAgeConsiderItems deepCopy() {
|
|
|
194 |
return new InvAgeConsiderItems(this);
|
|
|
195 |
}
|
|
|
196 |
|
|
|
197 |
@Override
|
|
|
198 |
public void clear() {
|
|
|
199 |
setIdIsSet(false);
|
|
|
200 |
this.id = 0;
|
|
|
201 |
setItemIdIsSet(false);
|
|
|
202 |
this.itemId = 0;
|
|
|
203 |
setCurrentQuantityIsSet(false);
|
|
|
204 |
this.currentQuantity = 0;
|
|
|
205 |
setPurchaseIdIsSet(false);
|
|
|
206 |
this.purchaseId = 0;
|
|
|
207 |
setAgeIsSet(false);
|
|
|
208 |
this.age = 0.0;
|
|
|
209 |
this.category = null;
|
|
|
210 |
setCostIsSet(false);
|
|
|
211 |
this.cost = 0;
|
|
|
212 |
}
|
|
|
213 |
|
|
|
214 |
public long getId() {
|
|
|
215 |
return this.id;
|
|
|
216 |
}
|
|
|
217 |
|
|
|
218 |
public void setId(long id) {
|
|
|
219 |
this.id = id;
|
|
|
220 |
setIdIsSet(true);
|
|
|
221 |
}
|
|
|
222 |
|
|
|
223 |
public void unsetId() {
|
|
|
224 |
__isset_bit_vector.clear(__ID_ISSET_ID);
|
|
|
225 |
}
|
|
|
226 |
|
|
|
227 |
/** Returns true if field id is set (has been assigned a value) and false otherwise */
|
|
|
228 |
public boolean isSetId() {
|
|
|
229 |
return __isset_bit_vector.get(__ID_ISSET_ID);
|
|
|
230 |
}
|
|
|
231 |
|
|
|
232 |
public void setIdIsSet(boolean value) {
|
|
|
233 |
__isset_bit_vector.set(__ID_ISSET_ID, value);
|
|
|
234 |
}
|
|
|
235 |
|
|
|
236 |
public long getItemId() {
|
|
|
237 |
return this.itemId;
|
|
|
238 |
}
|
|
|
239 |
|
|
|
240 |
public void setItemId(long itemId) {
|
|
|
241 |
this.itemId = itemId;
|
|
|
242 |
setItemIdIsSet(true);
|
|
|
243 |
}
|
|
|
244 |
|
|
|
245 |
public void unsetItemId() {
|
|
|
246 |
__isset_bit_vector.clear(__ITEMID_ISSET_ID);
|
|
|
247 |
}
|
|
|
248 |
|
|
|
249 |
/** Returns true if field itemId is set (has been assigned a value) and false otherwise */
|
|
|
250 |
public boolean isSetItemId() {
|
|
|
251 |
return __isset_bit_vector.get(__ITEMID_ISSET_ID);
|
|
|
252 |
}
|
|
|
253 |
|
|
|
254 |
public void setItemIdIsSet(boolean value) {
|
|
|
255 |
__isset_bit_vector.set(__ITEMID_ISSET_ID, value);
|
|
|
256 |
}
|
|
|
257 |
|
|
|
258 |
public long getCurrentQuantity() {
|
|
|
259 |
return this.currentQuantity;
|
|
|
260 |
}
|
|
|
261 |
|
|
|
262 |
public void setCurrentQuantity(long currentQuantity) {
|
|
|
263 |
this.currentQuantity = currentQuantity;
|
|
|
264 |
setCurrentQuantityIsSet(true);
|
|
|
265 |
}
|
|
|
266 |
|
|
|
267 |
public void unsetCurrentQuantity() {
|
|
|
268 |
__isset_bit_vector.clear(__CURRENTQUANTITY_ISSET_ID);
|
|
|
269 |
}
|
|
|
270 |
|
|
|
271 |
/** Returns true if field currentQuantity is set (has been assigned a value) and false otherwise */
|
|
|
272 |
public boolean isSetCurrentQuantity() {
|
|
|
273 |
return __isset_bit_vector.get(__CURRENTQUANTITY_ISSET_ID);
|
|
|
274 |
}
|
|
|
275 |
|
|
|
276 |
public void setCurrentQuantityIsSet(boolean value) {
|
|
|
277 |
__isset_bit_vector.set(__CURRENTQUANTITY_ISSET_ID, value);
|
|
|
278 |
}
|
|
|
279 |
|
|
|
280 |
public long getPurchaseId() {
|
|
|
281 |
return this.purchaseId;
|
|
|
282 |
}
|
|
|
283 |
|
|
|
284 |
public void setPurchaseId(long purchaseId) {
|
|
|
285 |
this.purchaseId = purchaseId;
|
|
|
286 |
setPurchaseIdIsSet(true);
|
|
|
287 |
}
|
|
|
288 |
|
|
|
289 |
public void unsetPurchaseId() {
|
|
|
290 |
__isset_bit_vector.clear(__PURCHASEID_ISSET_ID);
|
|
|
291 |
}
|
|
|
292 |
|
|
|
293 |
/** Returns true if field purchaseId is set (has been assigned a value) and false otherwise */
|
|
|
294 |
public boolean isSetPurchaseId() {
|
|
|
295 |
return __isset_bit_vector.get(__PURCHASEID_ISSET_ID);
|
|
|
296 |
}
|
|
|
297 |
|
|
|
298 |
public void setPurchaseIdIsSet(boolean value) {
|
|
|
299 |
__isset_bit_vector.set(__PURCHASEID_ISSET_ID, value);
|
|
|
300 |
}
|
|
|
301 |
|
|
|
302 |
public double getAge() {
|
|
|
303 |
return this.age;
|
|
|
304 |
}
|
|
|
305 |
|
|
|
306 |
public void setAge(double age) {
|
|
|
307 |
this.age = age;
|
|
|
308 |
setAgeIsSet(true);
|
|
|
309 |
}
|
|
|
310 |
|
|
|
311 |
public void unsetAge() {
|
|
|
312 |
__isset_bit_vector.clear(__AGE_ISSET_ID);
|
|
|
313 |
}
|
|
|
314 |
|
|
|
315 |
/** Returns true if field age is set (has been assigned a value) and false otherwise */
|
|
|
316 |
public boolean isSetAge() {
|
|
|
317 |
return __isset_bit_vector.get(__AGE_ISSET_ID);
|
|
|
318 |
}
|
|
|
319 |
|
|
|
320 |
public void setAgeIsSet(boolean value) {
|
|
|
321 |
__isset_bit_vector.set(__AGE_ISSET_ID, value);
|
|
|
322 |
}
|
|
|
323 |
|
|
|
324 |
public String getCategory() {
|
|
|
325 |
return this.category;
|
|
|
326 |
}
|
|
|
327 |
|
|
|
328 |
public void setCategory(String category) {
|
|
|
329 |
this.category = category;
|
|
|
330 |
}
|
|
|
331 |
|
|
|
332 |
public void unsetCategory() {
|
|
|
333 |
this.category = null;
|
|
|
334 |
}
|
|
|
335 |
|
|
|
336 |
/** Returns true if field category is set (has been assigned a value) and false otherwise */
|
|
|
337 |
public boolean isSetCategory() {
|
|
|
338 |
return this.category != null;
|
|
|
339 |
}
|
|
|
340 |
|
|
|
341 |
public void setCategoryIsSet(boolean value) {
|
|
|
342 |
if (!value) {
|
|
|
343 |
this.category = null;
|
|
|
344 |
}
|
|
|
345 |
}
|
|
|
346 |
|
|
|
347 |
public long getCost() {
|
|
|
348 |
return this.cost;
|
|
|
349 |
}
|
|
|
350 |
|
|
|
351 |
public void setCost(long cost) {
|
|
|
352 |
this.cost = cost;
|
|
|
353 |
setCostIsSet(true);
|
|
|
354 |
}
|
|
|
355 |
|
|
|
356 |
public void unsetCost() {
|
|
|
357 |
__isset_bit_vector.clear(__COST_ISSET_ID);
|
|
|
358 |
}
|
|
|
359 |
|
|
|
360 |
/** Returns true if field cost is set (has been assigned a value) and false otherwise */
|
|
|
361 |
public boolean isSetCost() {
|
|
|
362 |
return __isset_bit_vector.get(__COST_ISSET_ID);
|
|
|
363 |
}
|
|
|
364 |
|
|
|
365 |
public void setCostIsSet(boolean value) {
|
|
|
366 |
__isset_bit_vector.set(__COST_ISSET_ID, value);
|
|
|
367 |
}
|
|
|
368 |
|
|
|
369 |
public void setFieldValue(_Fields field, Object value) {
|
|
|
370 |
switch (field) {
|
|
|
371 |
case ID:
|
|
|
372 |
if (value == null) {
|
|
|
373 |
unsetId();
|
|
|
374 |
} else {
|
|
|
375 |
setId((Long)value);
|
|
|
376 |
}
|
|
|
377 |
break;
|
|
|
378 |
|
|
|
379 |
case ITEM_ID:
|
|
|
380 |
if (value == null) {
|
|
|
381 |
unsetItemId();
|
|
|
382 |
} else {
|
|
|
383 |
setItemId((Long)value);
|
|
|
384 |
}
|
|
|
385 |
break;
|
|
|
386 |
|
|
|
387 |
case CURRENT_QUANTITY:
|
|
|
388 |
if (value == null) {
|
|
|
389 |
unsetCurrentQuantity();
|
|
|
390 |
} else {
|
|
|
391 |
setCurrentQuantity((Long)value);
|
|
|
392 |
}
|
|
|
393 |
break;
|
|
|
394 |
|
|
|
395 |
case PURCHASE_ID:
|
|
|
396 |
if (value == null) {
|
|
|
397 |
unsetPurchaseId();
|
|
|
398 |
} else {
|
|
|
399 |
setPurchaseId((Long)value);
|
|
|
400 |
}
|
|
|
401 |
break;
|
|
|
402 |
|
|
|
403 |
case AGE:
|
|
|
404 |
if (value == null) {
|
|
|
405 |
unsetAge();
|
|
|
406 |
} else {
|
|
|
407 |
setAge((Double)value);
|
|
|
408 |
}
|
|
|
409 |
break;
|
|
|
410 |
|
|
|
411 |
case CATEGORY:
|
|
|
412 |
if (value == null) {
|
|
|
413 |
unsetCategory();
|
|
|
414 |
} else {
|
|
|
415 |
setCategory((String)value);
|
|
|
416 |
}
|
|
|
417 |
break;
|
|
|
418 |
|
|
|
419 |
case COST:
|
|
|
420 |
if (value == null) {
|
|
|
421 |
unsetCost();
|
|
|
422 |
} else {
|
|
|
423 |
setCost((Long)value);
|
|
|
424 |
}
|
|
|
425 |
break;
|
|
|
426 |
|
|
|
427 |
}
|
|
|
428 |
}
|
|
|
429 |
|
|
|
430 |
public Object getFieldValue(_Fields field) {
|
|
|
431 |
switch (field) {
|
|
|
432 |
case ID:
|
|
|
433 |
return Long.valueOf(getId());
|
|
|
434 |
|
|
|
435 |
case ITEM_ID:
|
|
|
436 |
return Long.valueOf(getItemId());
|
|
|
437 |
|
|
|
438 |
case CURRENT_QUANTITY:
|
|
|
439 |
return Long.valueOf(getCurrentQuantity());
|
|
|
440 |
|
|
|
441 |
case PURCHASE_ID:
|
|
|
442 |
return Long.valueOf(getPurchaseId());
|
|
|
443 |
|
|
|
444 |
case AGE:
|
|
|
445 |
return Double.valueOf(getAge());
|
|
|
446 |
|
|
|
447 |
case CATEGORY:
|
|
|
448 |
return getCategory();
|
|
|
449 |
|
|
|
450 |
case COST:
|
|
|
451 |
return Long.valueOf(getCost());
|
|
|
452 |
|
|
|
453 |
}
|
|
|
454 |
throw new IllegalStateException();
|
|
|
455 |
}
|
|
|
456 |
|
|
|
457 |
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
|
|
|
458 |
public boolean isSet(_Fields field) {
|
|
|
459 |
if (field == null) {
|
|
|
460 |
throw new IllegalArgumentException();
|
|
|
461 |
}
|
|
|
462 |
|
|
|
463 |
switch (field) {
|
|
|
464 |
case ID:
|
|
|
465 |
return isSetId();
|
|
|
466 |
case ITEM_ID:
|
|
|
467 |
return isSetItemId();
|
|
|
468 |
case CURRENT_QUANTITY:
|
|
|
469 |
return isSetCurrentQuantity();
|
|
|
470 |
case PURCHASE_ID:
|
|
|
471 |
return isSetPurchaseId();
|
|
|
472 |
case AGE:
|
|
|
473 |
return isSetAge();
|
|
|
474 |
case CATEGORY:
|
|
|
475 |
return isSetCategory();
|
|
|
476 |
case COST:
|
|
|
477 |
return isSetCost();
|
|
|
478 |
}
|
|
|
479 |
throw new IllegalStateException();
|
|
|
480 |
}
|
|
|
481 |
|
|
|
482 |
@Override
|
|
|
483 |
public boolean equals(Object that) {
|
|
|
484 |
if (that == null)
|
|
|
485 |
return false;
|
|
|
486 |
if (that instanceof InvAgeConsiderItems)
|
|
|
487 |
return this.equals((InvAgeConsiderItems)that);
|
|
|
488 |
return false;
|
|
|
489 |
}
|
|
|
490 |
|
|
|
491 |
public boolean equals(InvAgeConsiderItems that) {
|
|
|
492 |
if (that == null)
|
|
|
493 |
return false;
|
|
|
494 |
|
|
|
495 |
boolean this_present_id = true;
|
|
|
496 |
boolean that_present_id = true;
|
|
|
497 |
if (this_present_id || that_present_id) {
|
|
|
498 |
if (!(this_present_id && that_present_id))
|
|
|
499 |
return false;
|
|
|
500 |
if (this.id != that.id)
|
|
|
501 |
return false;
|
|
|
502 |
}
|
|
|
503 |
|
|
|
504 |
boolean this_present_itemId = true;
|
|
|
505 |
boolean that_present_itemId = true;
|
|
|
506 |
if (this_present_itemId || that_present_itemId) {
|
|
|
507 |
if (!(this_present_itemId && that_present_itemId))
|
|
|
508 |
return false;
|
|
|
509 |
if (this.itemId != that.itemId)
|
|
|
510 |
return false;
|
|
|
511 |
}
|
|
|
512 |
|
|
|
513 |
boolean this_present_currentQuantity = true;
|
|
|
514 |
boolean that_present_currentQuantity = true;
|
|
|
515 |
if (this_present_currentQuantity || that_present_currentQuantity) {
|
|
|
516 |
if (!(this_present_currentQuantity && that_present_currentQuantity))
|
|
|
517 |
return false;
|
|
|
518 |
if (this.currentQuantity != that.currentQuantity)
|
|
|
519 |
return false;
|
|
|
520 |
}
|
|
|
521 |
|
|
|
522 |
boolean this_present_purchaseId = true;
|
|
|
523 |
boolean that_present_purchaseId = true;
|
|
|
524 |
if (this_present_purchaseId || that_present_purchaseId) {
|
|
|
525 |
if (!(this_present_purchaseId && that_present_purchaseId))
|
|
|
526 |
return false;
|
|
|
527 |
if (this.purchaseId != that.purchaseId)
|
|
|
528 |
return false;
|
|
|
529 |
}
|
|
|
530 |
|
|
|
531 |
boolean this_present_age = true;
|
|
|
532 |
boolean that_present_age = true;
|
|
|
533 |
if (this_present_age || that_present_age) {
|
|
|
534 |
if (!(this_present_age && that_present_age))
|
|
|
535 |
return false;
|
|
|
536 |
if (this.age != that.age)
|
|
|
537 |
return false;
|
|
|
538 |
}
|
|
|
539 |
|
|
|
540 |
boolean this_present_category = true && this.isSetCategory();
|
|
|
541 |
boolean that_present_category = true && that.isSetCategory();
|
|
|
542 |
if (this_present_category || that_present_category) {
|
|
|
543 |
if (!(this_present_category && that_present_category))
|
|
|
544 |
return false;
|
|
|
545 |
if (!this.category.equals(that.category))
|
|
|
546 |
return false;
|
|
|
547 |
}
|
|
|
548 |
|
|
|
549 |
boolean this_present_cost = true;
|
|
|
550 |
boolean that_present_cost = true;
|
|
|
551 |
if (this_present_cost || that_present_cost) {
|
|
|
552 |
if (!(this_present_cost && that_present_cost))
|
|
|
553 |
return false;
|
|
|
554 |
if (this.cost != that.cost)
|
|
|
555 |
return false;
|
|
|
556 |
}
|
|
|
557 |
|
|
|
558 |
return true;
|
|
|
559 |
}
|
|
|
560 |
|
|
|
561 |
@Override
|
|
|
562 |
public int hashCode() {
|
|
|
563 |
return 0;
|
|
|
564 |
}
|
|
|
565 |
|
|
|
566 |
public int compareTo(InvAgeConsiderItems other) {
|
|
|
567 |
if (!getClass().equals(other.getClass())) {
|
|
|
568 |
return getClass().getName().compareTo(other.getClass().getName());
|
|
|
569 |
}
|
|
|
570 |
|
|
|
571 |
int lastComparison = 0;
|
|
|
572 |
InvAgeConsiderItems typedOther = (InvAgeConsiderItems)other;
|
|
|
573 |
|
|
|
574 |
lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
|
|
|
575 |
if (lastComparison != 0) {
|
|
|
576 |
return lastComparison;
|
|
|
577 |
}
|
|
|
578 |
if (isSetId()) {
|
|
|
579 |
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
|
|
|
580 |
if (lastComparison != 0) {
|
|
|
581 |
return lastComparison;
|
|
|
582 |
}
|
|
|
583 |
}
|
|
|
584 |
lastComparison = Boolean.valueOf(isSetItemId()).compareTo(typedOther.isSetItemId());
|
|
|
585 |
if (lastComparison != 0) {
|
|
|
586 |
return lastComparison;
|
|
|
587 |
}
|
|
|
588 |
if (isSetItemId()) {
|
|
|
589 |
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemId, typedOther.itemId);
|
|
|
590 |
if (lastComparison != 0) {
|
|
|
591 |
return lastComparison;
|
|
|
592 |
}
|
|
|
593 |
}
|
|
|
594 |
lastComparison = Boolean.valueOf(isSetCurrentQuantity()).compareTo(typedOther.isSetCurrentQuantity());
|
|
|
595 |
if (lastComparison != 0) {
|
|
|
596 |
return lastComparison;
|
|
|
597 |
}
|
|
|
598 |
if (isSetCurrentQuantity()) {
|
|
|
599 |
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.currentQuantity, typedOther.currentQuantity);
|
|
|
600 |
if (lastComparison != 0) {
|
|
|
601 |
return lastComparison;
|
|
|
602 |
}
|
|
|
603 |
}
|
|
|
604 |
lastComparison = Boolean.valueOf(isSetPurchaseId()).compareTo(typedOther.isSetPurchaseId());
|
|
|
605 |
if (lastComparison != 0) {
|
|
|
606 |
return lastComparison;
|
|
|
607 |
}
|
|
|
608 |
if (isSetPurchaseId()) {
|
|
|
609 |
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.purchaseId, typedOther.purchaseId);
|
|
|
610 |
if (lastComparison != 0) {
|
|
|
611 |
return lastComparison;
|
|
|
612 |
}
|
|
|
613 |
}
|
|
|
614 |
lastComparison = Boolean.valueOf(isSetAge()).compareTo(typedOther.isSetAge());
|
|
|
615 |
if (lastComparison != 0) {
|
|
|
616 |
return lastComparison;
|
|
|
617 |
}
|
|
|
618 |
if (isSetAge()) {
|
|
|
619 |
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.age, typedOther.age);
|
|
|
620 |
if (lastComparison != 0) {
|
|
|
621 |
return lastComparison;
|
|
|
622 |
}
|
|
|
623 |
}
|
|
|
624 |
lastComparison = Boolean.valueOf(isSetCategory()).compareTo(typedOther.isSetCategory());
|
|
|
625 |
if (lastComparison != 0) {
|
|
|
626 |
return lastComparison;
|
|
|
627 |
}
|
|
|
628 |
if (isSetCategory()) {
|
|
|
629 |
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.category, typedOther.category);
|
|
|
630 |
if (lastComparison != 0) {
|
|
|
631 |
return lastComparison;
|
|
|
632 |
}
|
|
|
633 |
}
|
|
|
634 |
lastComparison = Boolean.valueOf(isSetCost()).compareTo(typedOther.isSetCost());
|
|
|
635 |
if (lastComparison != 0) {
|
|
|
636 |
return lastComparison;
|
|
|
637 |
}
|
|
|
638 |
if (isSetCost()) {
|
|
|
639 |
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cost, typedOther.cost);
|
|
|
640 |
if (lastComparison != 0) {
|
|
|
641 |
return lastComparison;
|
|
|
642 |
}
|
|
|
643 |
}
|
|
|
644 |
return 0;
|
|
|
645 |
}
|
|
|
646 |
|
|
|
647 |
public _Fields fieldForId(int fieldId) {
|
|
|
648 |
return _Fields.findByThriftId(fieldId);
|
|
|
649 |
}
|
|
|
650 |
|
|
|
651 |
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
|
|
|
652 |
org.apache.thrift.protocol.TField field;
|
|
|
653 |
iprot.readStructBegin();
|
|
|
654 |
while (true)
|
|
|
655 |
{
|
|
|
656 |
field = iprot.readFieldBegin();
|
|
|
657 |
if (field.type == org.apache.thrift.protocol.TType.STOP) {
|
|
|
658 |
break;
|
|
|
659 |
}
|
|
|
660 |
switch (field.id) {
|
|
|
661 |
case 1: // ID
|
|
|
662 |
if (field.type == org.apache.thrift.protocol.TType.I64) {
|
|
|
663 |
this.id = iprot.readI64();
|
|
|
664 |
setIdIsSet(true);
|
|
|
665 |
} else {
|
|
|
666 |
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
|
|
667 |
}
|
|
|
668 |
break;
|
|
|
669 |
case 2: // ITEM_ID
|
|
|
670 |
if (field.type == org.apache.thrift.protocol.TType.I64) {
|
|
|
671 |
this.itemId = iprot.readI64();
|
|
|
672 |
setItemIdIsSet(true);
|
|
|
673 |
} else {
|
|
|
674 |
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
|
|
675 |
}
|
|
|
676 |
break;
|
|
|
677 |
case 3: // CURRENT_QUANTITY
|
|
|
678 |
if (field.type == org.apache.thrift.protocol.TType.I64) {
|
|
|
679 |
this.currentQuantity = iprot.readI64();
|
|
|
680 |
setCurrentQuantityIsSet(true);
|
|
|
681 |
} else {
|
|
|
682 |
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
|
|
683 |
}
|
|
|
684 |
break;
|
|
|
685 |
case 4: // PURCHASE_ID
|
|
|
686 |
if (field.type == org.apache.thrift.protocol.TType.I64) {
|
|
|
687 |
this.purchaseId = iprot.readI64();
|
|
|
688 |
setPurchaseIdIsSet(true);
|
|
|
689 |
} else {
|
|
|
690 |
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
|
|
691 |
}
|
|
|
692 |
break;
|
|
|
693 |
case 5: // AGE
|
|
|
694 |
if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
|
|
|
695 |
this.age = iprot.readDouble();
|
|
|
696 |
setAgeIsSet(true);
|
|
|
697 |
} else {
|
|
|
698 |
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
|
|
699 |
}
|
|
|
700 |
break;
|
|
|
701 |
case 6: // CATEGORY
|
|
|
702 |
if (field.type == org.apache.thrift.protocol.TType.STRING) {
|
|
|
703 |
this.category = iprot.readString();
|
|
|
704 |
} else {
|
|
|
705 |
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
|
|
706 |
}
|
|
|
707 |
break;
|
|
|
708 |
case 7: // COST
|
|
|
709 |
if (field.type == org.apache.thrift.protocol.TType.I64) {
|
|
|
710 |
this.cost = iprot.readI64();
|
|
|
711 |
setCostIsSet(true);
|
|
|
712 |
} else {
|
|
|
713 |
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
|
|
714 |
}
|
|
|
715 |
break;
|
|
|
716 |
default:
|
|
|
717 |
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
|
|
718 |
}
|
|
|
719 |
iprot.readFieldEnd();
|
|
|
720 |
}
|
|
|
721 |
iprot.readStructEnd();
|
|
|
722 |
validate();
|
|
|
723 |
}
|
|
|
724 |
|
|
|
725 |
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
|
|
|
726 |
validate();
|
|
|
727 |
|
|
|
728 |
oprot.writeStructBegin(STRUCT_DESC);
|
|
|
729 |
oprot.writeFieldBegin(ID_FIELD_DESC);
|
|
|
730 |
oprot.writeI64(this.id);
|
|
|
731 |
oprot.writeFieldEnd();
|
|
|
732 |
oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
|
|
|
733 |
oprot.writeI64(this.itemId);
|
|
|
734 |
oprot.writeFieldEnd();
|
|
|
735 |
oprot.writeFieldBegin(CURRENT_QUANTITY_FIELD_DESC);
|
|
|
736 |
oprot.writeI64(this.currentQuantity);
|
|
|
737 |
oprot.writeFieldEnd();
|
|
|
738 |
oprot.writeFieldBegin(PURCHASE_ID_FIELD_DESC);
|
|
|
739 |
oprot.writeI64(this.purchaseId);
|
|
|
740 |
oprot.writeFieldEnd();
|
|
|
741 |
oprot.writeFieldBegin(AGE_FIELD_DESC);
|
|
|
742 |
oprot.writeDouble(this.age);
|
|
|
743 |
oprot.writeFieldEnd();
|
|
|
744 |
if (this.category != null) {
|
|
|
745 |
oprot.writeFieldBegin(CATEGORY_FIELD_DESC);
|
|
|
746 |
oprot.writeString(this.category);
|
|
|
747 |
oprot.writeFieldEnd();
|
|
|
748 |
}
|
|
|
749 |
oprot.writeFieldBegin(COST_FIELD_DESC);
|
|
|
750 |
oprot.writeI64(this.cost);
|
|
|
751 |
oprot.writeFieldEnd();
|
|
|
752 |
oprot.writeFieldStop();
|
|
|
753 |
oprot.writeStructEnd();
|
|
|
754 |
}
|
|
|
755 |
|
|
|
756 |
@Override
|
|
|
757 |
public String toString() {
|
|
|
758 |
StringBuilder sb = new StringBuilder("InvAgeConsiderItems(");
|
|
|
759 |
boolean first = true;
|
|
|
760 |
|
|
|
761 |
sb.append("id:");
|
|
|
762 |
sb.append(this.id);
|
|
|
763 |
first = false;
|
|
|
764 |
if (!first) sb.append(", ");
|
|
|
765 |
sb.append("itemId:");
|
|
|
766 |
sb.append(this.itemId);
|
|
|
767 |
first = false;
|
|
|
768 |
if (!first) sb.append(", ");
|
|
|
769 |
sb.append("currentQuantity:");
|
|
|
770 |
sb.append(this.currentQuantity);
|
|
|
771 |
first = false;
|
|
|
772 |
if (!first) sb.append(", ");
|
|
|
773 |
sb.append("purchaseId:");
|
|
|
774 |
sb.append(this.purchaseId);
|
|
|
775 |
first = false;
|
|
|
776 |
if (!first) sb.append(", ");
|
|
|
777 |
sb.append("age:");
|
|
|
778 |
sb.append(this.age);
|
|
|
779 |
first = false;
|
|
|
780 |
if (!first) sb.append(", ");
|
|
|
781 |
sb.append("category:");
|
|
|
782 |
if (this.category == null) {
|
|
|
783 |
sb.append("null");
|
|
|
784 |
} else {
|
|
|
785 |
sb.append(this.category);
|
|
|
786 |
}
|
|
|
787 |
first = false;
|
|
|
788 |
if (!first) sb.append(", ");
|
|
|
789 |
sb.append("cost:");
|
|
|
790 |
sb.append(this.cost);
|
|
|
791 |
first = false;
|
|
|
792 |
sb.append(")");
|
|
|
793 |
return sb.toString();
|
|
|
794 |
}
|
|
|
795 |
|
|
|
796 |
public void validate() throws org.apache.thrift.TException {
|
|
|
797 |
// check for required fields
|
|
|
798 |
}
|
|
|
799 |
|
|
|
800 |
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
|
|
|
801 |
try {
|
|
|
802 |
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
|
|
|
803 |
} catch (org.apache.thrift.TException te) {
|
|
|
804 |
throw new java.io.IOException(te);
|
|
|
805 |
}
|
|
|
806 |
}
|
|
|
807 |
|
|
|
808 |
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
|
|
|
809 |
try {
|
|
|
810 |
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
|
|
|
811 |
__isset_bit_vector = new BitSet(1);
|
|
|
812 |
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
|
|
|
813 |
} catch (org.apache.thrift.TException te) {
|
|
|
814 |
throw new java.io.IOException(te);
|
|
|
815 |
}
|
|
|
816 |
}
|
|
|
817 |
|
|
|
818 |
}
|
|
|
819 |
|