Subversion Repositories SmartDukaan

Rev

Rev 7613 | Details | Compare with Previous | Last modification | View Log | RSS feed

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