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