Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
412 ashish 1
/**
2
 * Autogenerated by Thrift
3
 *
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
 */
6
package in.shop2020.logistics;
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.util.Arrays;
19
import org.slf4j.Logger;
20
import org.slf4j.LoggerFactory;
21
 
22
import org.apache.thrift.*;
23
import org.apache.thrift.meta_data.*;
24
import org.apache.thrift.protocol.*;
25
 
26
public class Shipment implements TBase<Shipment._Fields>, java.io.Serializable, Cloneable, Comparable<Shipment> {
27
  private static final TStruct STRUCT_DESC = new TStruct("Shipment");
28
 
29
  private static final TField WAREHOUSE_NAME_FIELD_DESC = new TField("warehouse_name", TType.STRING, (short)1);
30
  private static final TField AWB_FIELD_DESC = new TField("awb", TType.STRING, (short)2);
31
  private static final TField ORIGIN_FIELD_DESC = new TField("origin", TType.STRING, (short)3);
32
  private static final TField DESTINATION_FIELD_DESC = new TField("destination", TType.STRING, (short)4);
33
  private static final TField TIMESTAMP_FIELD_DESC = new TField("timestamp", TType.I64, (short)5);
34
  private static final TField RECEPIENT_NAME_FIELD_DESC = new TField("recepient_name", TType.STRING, (short)6);
35
  private static final TField RECEPIENT_ADDRESS_FIELD_DESC = new TField("recepient_address", TType.STRING, (short)7);
36
  private static final TField RECEPIENT_PINCODE_FIELD_DESC = new TField("recepient_pincode", TType.STRING, (short)8);
37
  private static final TField RECEPIENT_PHONE_FIELD_DESC = new TField("recepient_phone", TType.STRING, (short)9);
38
  private static final TField SHIPMENT_WEIGHT_FIELD_DESC = new TField("shipment_weight", TType.STRING, (short)10);
39
  private static final TField SHIPMENT_CONTENTS_FIELD_DESC = new TField("shipment_contents", TType.STRING, (short)11);
40
 
41
  private String warehouse_name;
42
  private String awb;
43
  private String origin;
44
  private String destination;
45
  private long timestamp;
46
  private String recepient_name;
47
  private String recepient_address;
48
  private String recepient_pincode;
49
  private String recepient_phone;
50
  private String shipment_weight;
51
  private String shipment_contents;
52
 
53
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
54
  public enum _Fields implements TFieldIdEnum {
55
    WAREHOUSE_NAME((short)1, "warehouse_name"),
56
    AWB((short)2, "awb"),
57
    ORIGIN((short)3, "origin"),
58
    DESTINATION((short)4, "destination"),
59
    TIMESTAMP((short)5, "timestamp"),
60
    RECEPIENT_NAME((short)6, "recepient_name"),
61
    RECEPIENT_ADDRESS((short)7, "recepient_address"),
62
    RECEPIENT_PINCODE((short)8, "recepient_pincode"),
63
    RECEPIENT_PHONE((short)9, "recepient_phone"),
64
    SHIPMENT_WEIGHT((short)10, "shipment_weight"),
65
    SHIPMENT_CONTENTS((short)11, "shipment_contents");
66
 
67
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
68
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
69
 
70
    static {
71
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
72
        byId.put((int)field._thriftId, field);
73
        byName.put(field.getFieldName(), field);
74
      }
75
    }
76
 
77
    /**
78
     * Find the _Fields constant that matches fieldId, or null if its not found.
79
     */
80
    public static _Fields findByThriftId(int fieldId) {
81
      return byId.get(fieldId);
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 __TIMESTAMP_ISSET_ID = 0;
120
  private BitSet __isset_bit_vector = new BitSet(1);
121
 
122
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
123
    put(_Fields.WAREHOUSE_NAME, new FieldMetaData("warehouse_name", TFieldRequirementType.DEFAULT, 
124
        new FieldValueMetaData(TType.STRING)));
125
    put(_Fields.AWB, new FieldMetaData("awb", TFieldRequirementType.DEFAULT, 
126
        new FieldValueMetaData(TType.STRING)));
127
    put(_Fields.ORIGIN, new FieldMetaData("origin", TFieldRequirementType.DEFAULT, 
128
        new FieldValueMetaData(TType.STRING)));
129
    put(_Fields.DESTINATION, new FieldMetaData("destination", TFieldRequirementType.DEFAULT, 
130
        new FieldValueMetaData(TType.STRING)));
131
    put(_Fields.TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, 
132
        new FieldValueMetaData(TType.I64)));
133
    put(_Fields.RECEPIENT_NAME, new FieldMetaData("recepient_name", TFieldRequirementType.DEFAULT, 
134
        new FieldValueMetaData(TType.STRING)));
135
    put(_Fields.RECEPIENT_ADDRESS, new FieldMetaData("recepient_address", TFieldRequirementType.DEFAULT, 
136
        new FieldValueMetaData(TType.STRING)));
137
    put(_Fields.RECEPIENT_PINCODE, new FieldMetaData("recepient_pincode", TFieldRequirementType.DEFAULT, 
138
        new FieldValueMetaData(TType.STRING)));
139
    put(_Fields.RECEPIENT_PHONE, new FieldMetaData("recepient_phone", TFieldRequirementType.DEFAULT, 
140
        new FieldValueMetaData(TType.STRING)));
141
    put(_Fields.SHIPMENT_WEIGHT, new FieldMetaData("shipment_weight", TFieldRequirementType.DEFAULT, 
142
        new FieldValueMetaData(TType.STRING)));
143
    put(_Fields.SHIPMENT_CONTENTS, new FieldMetaData("shipment_contents", TFieldRequirementType.DEFAULT, 
144
        new FieldValueMetaData(TType.STRING)));
145
  }});
146
 
147
  static {
148
    FieldMetaData.addStructMetaDataMap(Shipment.class, metaDataMap);
149
  }
150
 
151
  public Shipment() {
152
  }
153
 
154
  public Shipment(
155
    String warehouse_name,
156
    String awb,
157
    String origin,
158
    String destination,
159
    long timestamp,
160
    String recepient_name,
161
    String recepient_address,
162
    String recepient_pincode,
163
    String recepient_phone,
164
    String shipment_weight,
165
    String shipment_contents)
166
  {
167
    this();
168
    this.warehouse_name = warehouse_name;
169
    this.awb = awb;
170
    this.origin = origin;
171
    this.destination = destination;
172
    this.timestamp = timestamp;
173
    setTimestampIsSet(true);
174
    this.recepient_name = recepient_name;
175
    this.recepient_address = recepient_address;
176
    this.recepient_pincode = recepient_pincode;
177
    this.recepient_phone = recepient_phone;
178
    this.shipment_weight = shipment_weight;
179
    this.shipment_contents = shipment_contents;
180
  }
181
 
182
  /**
183
   * Performs a deep copy on <i>other</i>.
184
   */
185
  public Shipment(Shipment other) {
186
    __isset_bit_vector.clear();
187
    __isset_bit_vector.or(other.__isset_bit_vector);
188
    if (other.isSetWarehouse_name()) {
189
      this.warehouse_name = other.warehouse_name;
190
    }
191
    if (other.isSetAwb()) {
192
      this.awb = other.awb;
193
    }
194
    if (other.isSetOrigin()) {
195
      this.origin = other.origin;
196
    }
197
    if (other.isSetDestination()) {
198
      this.destination = other.destination;
199
    }
200
    this.timestamp = other.timestamp;
201
    if (other.isSetRecepient_name()) {
202
      this.recepient_name = other.recepient_name;
203
    }
204
    if (other.isSetRecepient_address()) {
205
      this.recepient_address = other.recepient_address;
206
    }
207
    if (other.isSetRecepient_pincode()) {
208
      this.recepient_pincode = other.recepient_pincode;
209
    }
210
    if (other.isSetRecepient_phone()) {
211
      this.recepient_phone = other.recepient_phone;
212
    }
213
    if (other.isSetShipment_weight()) {
214
      this.shipment_weight = other.shipment_weight;
215
    }
216
    if (other.isSetShipment_contents()) {
217
      this.shipment_contents = other.shipment_contents;
218
    }
219
  }
220
 
221
  public Shipment deepCopy() {
222
    return new Shipment(this);
223
  }
224
 
225
  @Deprecated
226
  public Shipment clone() {
227
    return new Shipment(this);
228
  }
229
 
230
  public String getWarehouse_name() {
231
    return this.warehouse_name;
232
  }
233
 
234
  public Shipment setWarehouse_name(String warehouse_name) {
235
    this.warehouse_name = warehouse_name;
236
    return this;
237
  }
238
 
239
  public void unsetWarehouse_name() {
240
    this.warehouse_name = null;
241
  }
242
 
243
  /** Returns true if field warehouse_name is set (has been asigned a value) and false otherwise */
244
  public boolean isSetWarehouse_name() {
245
    return this.warehouse_name != null;
246
  }
247
 
248
  public void setWarehouse_nameIsSet(boolean value) {
249
    if (!value) {
250
      this.warehouse_name = null;
251
    }
252
  }
253
 
254
  public String getAwb() {
255
    return this.awb;
256
  }
257
 
258
  public Shipment setAwb(String awb) {
259
    this.awb = awb;
260
    return this;
261
  }
262
 
263
  public void unsetAwb() {
264
    this.awb = null;
265
  }
266
 
267
  /** Returns true if field awb is set (has been asigned a value) and false otherwise */
268
  public boolean isSetAwb() {
269
    return this.awb != null;
270
  }
271
 
272
  public void setAwbIsSet(boolean value) {
273
    if (!value) {
274
      this.awb = null;
275
    }
276
  }
277
 
278
  public String getOrigin() {
279
    return this.origin;
280
  }
281
 
282
  public Shipment setOrigin(String origin) {
283
    this.origin = origin;
284
    return this;
285
  }
286
 
287
  public void unsetOrigin() {
288
    this.origin = null;
289
  }
290
 
291
  /** Returns true if field origin is set (has been asigned a value) and false otherwise */
292
  public boolean isSetOrigin() {
293
    return this.origin != null;
294
  }
295
 
296
  public void setOriginIsSet(boolean value) {
297
    if (!value) {
298
      this.origin = null;
299
    }
300
  }
301
 
302
  public String getDestination() {
303
    return this.destination;
304
  }
305
 
306
  public Shipment setDestination(String destination) {
307
    this.destination = destination;
308
    return this;
309
  }
310
 
311
  public void unsetDestination() {
312
    this.destination = null;
313
  }
314
 
315
  /** Returns true if field destination is set (has been asigned a value) and false otherwise */
316
  public boolean isSetDestination() {
317
    return this.destination != null;
318
  }
319
 
320
  public void setDestinationIsSet(boolean value) {
321
    if (!value) {
322
      this.destination = null;
323
    }
324
  }
325
 
326
  public long getTimestamp() {
327
    return this.timestamp;
328
  }
329
 
330
  public Shipment setTimestamp(long timestamp) {
331
    this.timestamp = timestamp;
332
    setTimestampIsSet(true);
333
    return this;
334
  }
335
 
336
  public void unsetTimestamp() {
337
    __isset_bit_vector.clear(__TIMESTAMP_ISSET_ID);
338
  }
339
 
340
  /** Returns true if field timestamp is set (has been asigned a value) and false otherwise */
341
  public boolean isSetTimestamp() {
342
    return __isset_bit_vector.get(__TIMESTAMP_ISSET_ID);
343
  }
344
 
345
  public void setTimestampIsSet(boolean value) {
346
    __isset_bit_vector.set(__TIMESTAMP_ISSET_ID, value);
347
  }
348
 
349
  public String getRecepient_name() {
350
    return this.recepient_name;
351
  }
352
 
353
  public Shipment setRecepient_name(String recepient_name) {
354
    this.recepient_name = recepient_name;
355
    return this;
356
  }
357
 
358
  public void unsetRecepient_name() {
359
    this.recepient_name = null;
360
  }
361
 
362
  /** Returns true if field recepient_name is set (has been asigned a value) and false otherwise */
363
  public boolean isSetRecepient_name() {
364
    return this.recepient_name != null;
365
  }
366
 
367
  public void setRecepient_nameIsSet(boolean value) {
368
    if (!value) {
369
      this.recepient_name = null;
370
    }
371
  }
372
 
373
  public String getRecepient_address() {
374
    return this.recepient_address;
375
  }
376
 
377
  public Shipment setRecepient_address(String recepient_address) {
378
    this.recepient_address = recepient_address;
379
    return this;
380
  }
381
 
382
  public void unsetRecepient_address() {
383
    this.recepient_address = null;
384
  }
385
 
386
  /** Returns true if field recepient_address is set (has been asigned a value) and false otherwise */
387
  public boolean isSetRecepient_address() {
388
    return this.recepient_address != null;
389
  }
390
 
391
  public void setRecepient_addressIsSet(boolean value) {
392
    if (!value) {
393
      this.recepient_address = null;
394
    }
395
  }
396
 
397
  public String getRecepient_pincode() {
398
    return this.recepient_pincode;
399
  }
400
 
401
  public Shipment setRecepient_pincode(String recepient_pincode) {
402
    this.recepient_pincode = recepient_pincode;
403
    return this;
404
  }
405
 
406
  public void unsetRecepient_pincode() {
407
    this.recepient_pincode = null;
408
  }
409
 
410
  /** Returns true if field recepient_pincode is set (has been asigned a value) and false otherwise */
411
  public boolean isSetRecepient_pincode() {
412
    return this.recepient_pincode != null;
413
  }
414
 
415
  public void setRecepient_pincodeIsSet(boolean value) {
416
    if (!value) {
417
      this.recepient_pincode = null;
418
    }
419
  }
420
 
421
  public String getRecepient_phone() {
422
    return this.recepient_phone;
423
  }
424
 
425
  public Shipment setRecepient_phone(String recepient_phone) {
426
    this.recepient_phone = recepient_phone;
427
    return this;
428
  }
429
 
430
  public void unsetRecepient_phone() {
431
    this.recepient_phone = null;
432
  }
433
 
434
  /** Returns true if field recepient_phone is set (has been asigned a value) and false otherwise */
435
  public boolean isSetRecepient_phone() {
436
    return this.recepient_phone != null;
437
  }
438
 
439
  public void setRecepient_phoneIsSet(boolean value) {
440
    if (!value) {
441
      this.recepient_phone = null;
442
    }
443
  }
444
 
445
  public String getShipment_weight() {
446
    return this.shipment_weight;
447
  }
448
 
449
  public Shipment setShipment_weight(String shipment_weight) {
450
    this.shipment_weight = shipment_weight;
451
    return this;
452
  }
453
 
454
  public void unsetShipment_weight() {
455
    this.shipment_weight = null;
456
  }
457
 
458
  /** Returns true if field shipment_weight is set (has been asigned a value) and false otherwise */
459
  public boolean isSetShipment_weight() {
460
    return this.shipment_weight != null;
461
  }
462
 
463
  public void setShipment_weightIsSet(boolean value) {
464
    if (!value) {
465
      this.shipment_weight = null;
466
    }
467
  }
468
 
469
  public String getShipment_contents() {
470
    return this.shipment_contents;
471
  }
472
 
473
  public Shipment setShipment_contents(String shipment_contents) {
474
    this.shipment_contents = shipment_contents;
475
    return this;
476
  }
477
 
478
  public void unsetShipment_contents() {
479
    this.shipment_contents = null;
480
  }
481
 
482
  /** Returns true if field shipment_contents is set (has been asigned a value) and false otherwise */
483
  public boolean isSetShipment_contents() {
484
    return this.shipment_contents != null;
485
  }
486
 
487
  public void setShipment_contentsIsSet(boolean value) {
488
    if (!value) {
489
      this.shipment_contents = null;
490
    }
491
  }
492
 
493
  public void setFieldValue(_Fields field, Object value) {
494
    switch (field) {
495
    case WAREHOUSE_NAME:
496
      if (value == null) {
497
        unsetWarehouse_name();
498
      } else {
499
        setWarehouse_name((String)value);
500
      }
501
      break;
502
 
503
    case AWB:
504
      if (value == null) {
505
        unsetAwb();
506
      } else {
507
        setAwb((String)value);
508
      }
509
      break;
510
 
511
    case ORIGIN:
512
      if (value == null) {
513
        unsetOrigin();
514
      } else {
515
        setOrigin((String)value);
516
      }
517
      break;
518
 
519
    case DESTINATION:
520
      if (value == null) {
521
        unsetDestination();
522
      } else {
523
        setDestination((String)value);
524
      }
525
      break;
526
 
527
    case TIMESTAMP:
528
      if (value == null) {
529
        unsetTimestamp();
530
      } else {
531
        setTimestamp((Long)value);
532
      }
533
      break;
534
 
535
    case RECEPIENT_NAME:
536
      if (value == null) {
537
        unsetRecepient_name();
538
      } else {
539
        setRecepient_name((String)value);
540
      }
541
      break;
542
 
543
    case RECEPIENT_ADDRESS:
544
      if (value == null) {
545
        unsetRecepient_address();
546
      } else {
547
        setRecepient_address((String)value);
548
      }
549
      break;
550
 
551
    case RECEPIENT_PINCODE:
552
      if (value == null) {
553
        unsetRecepient_pincode();
554
      } else {
555
        setRecepient_pincode((String)value);
556
      }
557
      break;
558
 
559
    case RECEPIENT_PHONE:
560
      if (value == null) {
561
        unsetRecepient_phone();
562
      } else {
563
        setRecepient_phone((String)value);
564
      }
565
      break;
566
 
567
    case SHIPMENT_WEIGHT:
568
      if (value == null) {
569
        unsetShipment_weight();
570
      } else {
571
        setShipment_weight((String)value);
572
      }
573
      break;
574
 
575
    case SHIPMENT_CONTENTS:
576
      if (value == null) {
577
        unsetShipment_contents();
578
      } else {
579
        setShipment_contents((String)value);
580
      }
581
      break;
582
 
583
    }
584
  }
585
 
586
  public void setFieldValue(int fieldID, Object value) {
587
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
588
  }
589
 
590
  public Object getFieldValue(_Fields field) {
591
    switch (field) {
592
    case WAREHOUSE_NAME:
593
      return getWarehouse_name();
594
 
595
    case AWB:
596
      return getAwb();
597
 
598
    case ORIGIN:
599
      return getOrigin();
600
 
601
    case DESTINATION:
602
      return getDestination();
603
 
604
    case TIMESTAMP:
605
      return new Long(getTimestamp());
606
 
607
    case RECEPIENT_NAME:
608
      return getRecepient_name();
609
 
610
    case RECEPIENT_ADDRESS:
611
      return getRecepient_address();
612
 
613
    case RECEPIENT_PINCODE:
614
      return getRecepient_pincode();
615
 
616
    case RECEPIENT_PHONE:
617
      return getRecepient_phone();
618
 
619
    case SHIPMENT_WEIGHT:
620
      return getShipment_weight();
621
 
622
    case SHIPMENT_CONTENTS:
623
      return getShipment_contents();
624
 
625
    }
626
    throw new IllegalStateException();
627
  }
628
 
629
  public Object getFieldValue(int fieldId) {
630
    return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
631
  }
632
 
633
  /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
634
  public boolean isSet(_Fields field) {
635
    switch (field) {
636
    case WAREHOUSE_NAME:
637
      return isSetWarehouse_name();
638
    case AWB:
639
      return isSetAwb();
640
    case ORIGIN:
641
      return isSetOrigin();
642
    case DESTINATION:
643
      return isSetDestination();
644
    case TIMESTAMP:
645
      return isSetTimestamp();
646
    case RECEPIENT_NAME:
647
      return isSetRecepient_name();
648
    case RECEPIENT_ADDRESS:
649
      return isSetRecepient_address();
650
    case RECEPIENT_PINCODE:
651
      return isSetRecepient_pincode();
652
    case RECEPIENT_PHONE:
653
      return isSetRecepient_phone();
654
    case SHIPMENT_WEIGHT:
655
      return isSetShipment_weight();
656
    case SHIPMENT_CONTENTS:
657
      return isSetShipment_contents();
658
    }
659
    throw new IllegalStateException();
660
  }
661
 
662
  public boolean isSet(int fieldID) {
663
    return isSet(_Fields.findByThriftIdOrThrow(fieldID));
664
  }
665
 
666
  @Override
667
  public boolean equals(Object that) {
668
    if (that == null)
669
      return false;
670
    if (that instanceof Shipment)
671
      return this.equals((Shipment)that);
672
    return false;
673
  }
674
 
675
  public boolean equals(Shipment that) {
676
    if (that == null)
677
      return false;
678
 
679
    boolean this_present_warehouse_name = true && this.isSetWarehouse_name();
680
    boolean that_present_warehouse_name = true && that.isSetWarehouse_name();
681
    if (this_present_warehouse_name || that_present_warehouse_name) {
682
      if (!(this_present_warehouse_name && that_present_warehouse_name))
683
        return false;
684
      if (!this.warehouse_name.equals(that.warehouse_name))
685
        return false;
686
    }
687
 
688
    boolean this_present_awb = true && this.isSetAwb();
689
    boolean that_present_awb = true && that.isSetAwb();
690
    if (this_present_awb || that_present_awb) {
691
      if (!(this_present_awb && that_present_awb))
692
        return false;
693
      if (!this.awb.equals(that.awb))
694
        return false;
695
    }
696
 
697
    boolean this_present_origin = true && this.isSetOrigin();
698
    boolean that_present_origin = true && that.isSetOrigin();
699
    if (this_present_origin || that_present_origin) {
700
      if (!(this_present_origin && that_present_origin))
701
        return false;
702
      if (!this.origin.equals(that.origin))
703
        return false;
704
    }
705
 
706
    boolean this_present_destination = true && this.isSetDestination();
707
    boolean that_present_destination = true && that.isSetDestination();
708
    if (this_present_destination || that_present_destination) {
709
      if (!(this_present_destination && that_present_destination))
710
        return false;
711
      if (!this.destination.equals(that.destination))
712
        return false;
713
    }
714
 
715
    boolean this_present_timestamp = true;
716
    boolean that_present_timestamp = true;
717
    if (this_present_timestamp || that_present_timestamp) {
718
      if (!(this_present_timestamp && that_present_timestamp))
719
        return false;
720
      if (this.timestamp != that.timestamp)
721
        return false;
722
    }
723
 
724
    boolean this_present_recepient_name = true && this.isSetRecepient_name();
725
    boolean that_present_recepient_name = true && that.isSetRecepient_name();
726
    if (this_present_recepient_name || that_present_recepient_name) {
727
      if (!(this_present_recepient_name && that_present_recepient_name))
728
        return false;
729
      if (!this.recepient_name.equals(that.recepient_name))
730
        return false;
731
    }
732
 
733
    boolean this_present_recepient_address = true && this.isSetRecepient_address();
734
    boolean that_present_recepient_address = true && that.isSetRecepient_address();
735
    if (this_present_recepient_address || that_present_recepient_address) {
736
      if (!(this_present_recepient_address && that_present_recepient_address))
737
        return false;
738
      if (!this.recepient_address.equals(that.recepient_address))
739
        return false;
740
    }
741
 
742
    boolean this_present_recepient_pincode = true && this.isSetRecepient_pincode();
743
    boolean that_present_recepient_pincode = true && that.isSetRecepient_pincode();
744
    if (this_present_recepient_pincode || that_present_recepient_pincode) {
745
      if (!(this_present_recepient_pincode && that_present_recepient_pincode))
746
        return false;
747
      if (!this.recepient_pincode.equals(that.recepient_pincode))
748
        return false;
749
    }
750
 
751
    boolean this_present_recepient_phone = true && this.isSetRecepient_phone();
752
    boolean that_present_recepient_phone = true && that.isSetRecepient_phone();
753
    if (this_present_recepient_phone || that_present_recepient_phone) {
754
      if (!(this_present_recepient_phone && that_present_recepient_phone))
755
        return false;
756
      if (!this.recepient_phone.equals(that.recepient_phone))
757
        return false;
758
    }
759
 
760
    boolean this_present_shipment_weight = true && this.isSetShipment_weight();
761
    boolean that_present_shipment_weight = true && that.isSetShipment_weight();
762
    if (this_present_shipment_weight || that_present_shipment_weight) {
763
      if (!(this_present_shipment_weight && that_present_shipment_weight))
764
        return false;
765
      if (!this.shipment_weight.equals(that.shipment_weight))
766
        return false;
767
    }
768
 
769
    boolean this_present_shipment_contents = true && this.isSetShipment_contents();
770
    boolean that_present_shipment_contents = true && that.isSetShipment_contents();
771
    if (this_present_shipment_contents || that_present_shipment_contents) {
772
      if (!(this_present_shipment_contents && that_present_shipment_contents))
773
        return false;
774
      if (!this.shipment_contents.equals(that.shipment_contents))
775
        return false;
776
    }
777
 
778
    return true;
779
  }
780
 
781
  @Override
782
  public int hashCode() {
783
    return 0;
784
  }
785
 
786
  public int compareTo(Shipment other) {
787
    if (!getClass().equals(other.getClass())) {
788
      return getClass().getName().compareTo(other.getClass().getName());
789
    }
790
 
791
    int lastComparison = 0;
792
    Shipment typedOther = (Shipment)other;
793
 
794
    lastComparison = Boolean.valueOf(isSetWarehouse_name()).compareTo(isSetWarehouse_name());
795
    if (lastComparison != 0) {
796
      return lastComparison;
797
    }
798
    lastComparison = TBaseHelper.compareTo(warehouse_name, typedOther.warehouse_name);
799
    if (lastComparison != 0) {
800
      return lastComparison;
801
    }
802
    lastComparison = Boolean.valueOf(isSetAwb()).compareTo(isSetAwb());
803
    if (lastComparison != 0) {
804
      return lastComparison;
805
    }
806
    lastComparison = TBaseHelper.compareTo(awb, typedOther.awb);
807
    if (lastComparison != 0) {
808
      return lastComparison;
809
    }
810
    lastComparison = Boolean.valueOf(isSetOrigin()).compareTo(isSetOrigin());
811
    if (lastComparison != 0) {
812
      return lastComparison;
813
    }
814
    lastComparison = TBaseHelper.compareTo(origin, typedOther.origin);
815
    if (lastComparison != 0) {
816
      return lastComparison;
817
    }
818
    lastComparison = Boolean.valueOf(isSetDestination()).compareTo(isSetDestination());
819
    if (lastComparison != 0) {
820
      return lastComparison;
821
    }
822
    lastComparison = TBaseHelper.compareTo(destination, typedOther.destination);
823
    if (lastComparison != 0) {
824
      return lastComparison;
825
    }
826
    lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(isSetTimestamp());
827
    if (lastComparison != 0) {
828
      return lastComparison;
829
    }
830
    lastComparison = TBaseHelper.compareTo(timestamp, typedOther.timestamp);
831
    if (lastComparison != 0) {
832
      return lastComparison;
833
    }
834
    lastComparison = Boolean.valueOf(isSetRecepient_name()).compareTo(isSetRecepient_name());
835
    if (lastComparison != 0) {
836
      return lastComparison;
837
    }
838
    lastComparison = TBaseHelper.compareTo(recepient_name, typedOther.recepient_name);
839
    if (lastComparison != 0) {
840
      return lastComparison;
841
    }
842
    lastComparison = Boolean.valueOf(isSetRecepient_address()).compareTo(isSetRecepient_address());
843
    if (lastComparison != 0) {
844
      return lastComparison;
845
    }
846
    lastComparison = TBaseHelper.compareTo(recepient_address, typedOther.recepient_address);
847
    if (lastComparison != 0) {
848
      return lastComparison;
849
    }
850
    lastComparison = Boolean.valueOf(isSetRecepient_pincode()).compareTo(isSetRecepient_pincode());
851
    if (lastComparison != 0) {
852
      return lastComparison;
853
    }
854
    lastComparison = TBaseHelper.compareTo(recepient_pincode, typedOther.recepient_pincode);
855
    if (lastComparison != 0) {
856
      return lastComparison;
857
    }
858
    lastComparison = Boolean.valueOf(isSetRecepient_phone()).compareTo(isSetRecepient_phone());
859
    if (lastComparison != 0) {
860
      return lastComparison;
861
    }
862
    lastComparison = TBaseHelper.compareTo(recepient_phone, typedOther.recepient_phone);
863
    if (lastComparison != 0) {
864
      return lastComparison;
865
    }
866
    lastComparison = Boolean.valueOf(isSetShipment_weight()).compareTo(isSetShipment_weight());
867
    if (lastComparison != 0) {
868
      return lastComparison;
869
    }
870
    lastComparison = TBaseHelper.compareTo(shipment_weight, typedOther.shipment_weight);
871
    if (lastComparison != 0) {
872
      return lastComparison;
873
    }
874
    lastComparison = Boolean.valueOf(isSetShipment_contents()).compareTo(isSetShipment_contents());
875
    if (lastComparison != 0) {
876
      return lastComparison;
877
    }
878
    lastComparison = TBaseHelper.compareTo(shipment_contents, typedOther.shipment_contents);
879
    if (lastComparison != 0) {
880
      return lastComparison;
881
    }
882
    return 0;
883
  }
884
 
885
  public void read(TProtocol iprot) throws TException {
886
    TField field;
887
    iprot.readStructBegin();
888
    while (true)
889
    {
890
      field = iprot.readFieldBegin();
891
      if (field.type == TType.STOP) { 
892
        break;
893
      }
894
      _Fields fieldId = _Fields.findByThriftId(field.id);
895
      if (fieldId == null) {
896
        TProtocolUtil.skip(iprot, field.type);
897
      } else {
898
        switch (fieldId) {
899
          case WAREHOUSE_NAME:
900
            if (field.type == TType.STRING) {
901
              this.warehouse_name = iprot.readString();
902
            } else { 
903
              TProtocolUtil.skip(iprot, field.type);
904
            }
905
            break;
906
          case AWB:
907
            if (field.type == TType.STRING) {
908
              this.awb = iprot.readString();
909
            } else { 
910
              TProtocolUtil.skip(iprot, field.type);
911
            }
912
            break;
913
          case ORIGIN:
914
            if (field.type == TType.STRING) {
915
              this.origin = iprot.readString();
916
            } else { 
917
              TProtocolUtil.skip(iprot, field.type);
918
            }
919
            break;
920
          case DESTINATION:
921
            if (field.type == TType.STRING) {
922
              this.destination = iprot.readString();
923
            } else { 
924
              TProtocolUtil.skip(iprot, field.type);
925
            }
926
            break;
927
          case TIMESTAMP:
928
            if (field.type == TType.I64) {
929
              this.timestamp = iprot.readI64();
930
              setTimestampIsSet(true);
931
            } else { 
932
              TProtocolUtil.skip(iprot, field.type);
933
            }
934
            break;
935
          case RECEPIENT_NAME:
936
            if (field.type == TType.STRING) {
937
              this.recepient_name = iprot.readString();
938
            } else { 
939
              TProtocolUtil.skip(iprot, field.type);
940
            }
941
            break;
942
          case RECEPIENT_ADDRESS:
943
            if (field.type == TType.STRING) {
944
              this.recepient_address = iprot.readString();
945
            } else { 
946
              TProtocolUtil.skip(iprot, field.type);
947
            }
948
            break;
949
          case RECEPIENT_PINCODE:
950
            if (field.type == TType.STRING) {
951
              this.recepient_pincode = iprot.readString();
952
            } else { 
953
              TProtocolUtil.skip(iprot, field.type);
954
            }
955
            break;
956
          case RECEPIENT_PHONE:
957
            if (field.type == TType.STRING) {
958
              this.recepient_phone = iprot.readString();
959
            } else { 
960
              TProtocolUtil.skip(iprot, field.type);
961
            }
962
            break;
963
          case SHIPMENT_WEIGHT:
964
            if (field.type == TType.STRING) {
965
              this.shipment_weight = iprot.readString();
966
            } else { 
967
              TProtocolUtil.skip(iprot, field.type);
968
            }
969
            break;
970
          case SHIPMENT_CONTENTS:
971
            if (field.type == TType.STRING) {
972
              this.shipment_contents = iprot.readString();
973
            } else { 
974
              TProtocolUtil.skip(iprot, field.type);
975
            }
976
            break;
977
        }
978
        iprot.readFieldEnd();
979
      }
980
    }
981
    iprot.readStructEnd();
982
    validate();
983
  }
984
 
985
  public void write(TProtocol oprot) throws TException {
986
    validate();
987
 
988
    oprot.writeStructBegin(STRUCT_DESC);
989
    if (this.warehouse_name != null) {
990
      oprot.writeFieldBegin(WAREHOUSE_NAME_FIELD_DESC);
991
      oprot.writeString(this.warehouse_name);
992
      oprot.writeFieldEnd();
993
    }
994
    if (this.awb != null) {
995
      oprot.writeFieldBegin(AWB_FIELD_DESC);
996
      oprot.writeString(this.awb);
997
      oprot.writeFieldEnd();
998
    }
999
    if (this.origin != null) {
1000
      oprot.writeFieldBegin(ORIGIN_FIELD_DESC);
1001
      oprot.writeString(this.origin);
1002
      oprot.writeFieldEnd();
1003
    }
1004
    if (this.destination != null) {
1005
      oprot.writeFieldBegin(DESTINATION_FIELD_DESC);
1006
      oprot.writeString(this.destination);
1007
      oprot.writeFieldEnd();
1008
    }
1009
    oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC);
1010
    oprot.writeI64(this.timestamp);
1011
    oprot.writeFieldEnd();
1012
    if (this.recepient_name != null) {
1013
      oprot.writeFieldBegin(RECEPIENT_NAME_FIELD_DESC);
1014
      oprot.writeString(this.recepient_name);
1015
      oprot.writeFieldEnd();
1016
    }
1017
    if (this.recepient_address != null) {
1018
      oprot.writeFieldBegin(RECEPIENT_ADDRESS_FIELD_DESC);
1019
      oprot.writeString(this.recepient_address);
1020
      oprot.writeFieldEnd();
1021
    }
1022
    if (this.recepient_pincode != null) {
1023
      oprot.writeFieldBegin(RECEPIENT_PINCODE_FIELD_DESC);
1024
      oprot.writeString(this.recepient_pincode);
1025
      oprot.writeFieldEnd();
1026
    }
1027
    if (this.recepient_phone != null) {
1028
      oprot.writeFieldBegin(RECEPIENT_PHONE_FIELD_DESC);
1029
      oprot.writeString(this.recepient_phone);
1030
      oprot.writeFieldEnd();
1031
    }
1032
    if (this.shipment_weight != null) {
1033
      oprot.writeFieldBegin(SHIPMENT_WEIGHT_FIELD_DESC);
1034
      oprot.writeString(this.shipment_weight);
1035
      oprot.writeFieldEnd();
1036
    }
1037
    if (this.shipment_contents != null) {
1038
      oprot.writeFieldBegin(SHIPMENT_CONTENTS_FIELD_DESC);
1039
      oprot.writeString(this.shipment_contents);
1040
      oprot.writeFieldEnd();
1041
    }
1042
    oprot.writeFieldStop();
1043
    oprot.writeStructEnd();
1044
  }
1045
 
1046
  @Override
1047
  public String toString() {
1048
    StringBuilder sb = new StringBuilder("Shipment(");
1049
    boolean first = true;
1050
 
1051
    sb.append("warehouse_name:");
1052
    if (this.warehouse_name == null) {
1053
      sb.append("null");
1054
    } else {
1055
      sb.append(this.warehouse_name);
1056
    }
1057
    first = false;
1058
    if (!first) sb.append(", ");
1059
    sb.append("awb:");
1060
    if (this.awb == null) {
1061
      sb.append("null");
1062
    } else {
1063
      sb.append(this.awb);
1064
    }
1065
    first = false;
1066
    if (!first) sb.append(", ");
1067
    sb.append("origin:");
1068
    if (this.origin == null) {
1069
      sb.append("null");
1070
    } else {
1071
      sb.append(this.origin);
1072
    }
1073
    first = false;
1074
    if (!first) sb.append(", ");
1075
    sb.append("destination:");
1076
    if (this.destination == null) {
1077
      sb.append("null");
1078
    } else {
1079
      sb.append(this.destination);
1080
    }
1081
    first = false;
1082
    if (!first) sb.append(", ");
1083
    sb.append("timestamp:");
1084
    sb.append(this.timestamp);
1085
    first = false;
1086
    if (!first) sb.append(", ");
1087
    sb.append("recepient_name:");
1088
    if (this.recepient_name == null) {
1089
      sb.append("null");
1090
    } else {
1091
      sb.append(this.recepient_name);
1092
    }
1093
    first = false;
1094
    if (!first) sb.append(", ");
1095
    sb.append("recepient_address:");
1096
    if (this.recepient_address == null) {
1097
      sb.append("null");
1098
    } else {
1099
      sb.append(this.recepient_address);
1100
    }
1101
    first = false;
1102
    if (!first) sb.append(", ");
1103
    sb.append("recepient_pincode:");
1104
    if (this.recepient_pincode == null) {
1105
      sb.append("null");
1106
    } else {
1107
      sb.append(this.recepient_pincode);
1108
    }
1109
    first = false;
1110
    if (!first) sb.append(", ");
1111
    sb.append("recepient_phone:");
1112
    if (this.recepient_phone == null) {
1113
      sb.append("null");
1114
    } else {
1115
      sb.append(this.recepient_phone);
1116
    }
1117
    first = false;
1118
    if (!first) sb.append(", ");
1119
    sb.append("shipment_weight:");
1120
    if (this.shipment_weight == null) {
1121
      sb.append("null");
1122
    } else {
1123
      sb.append(this.shipment_weight);
1124
    }
1125
    first = false;
1126
    if (!first) sb.append(", ");
1127
    sb.append("shipment_contents:");
1128
    if (this.shipment_contents == null) {
1129
      sb.append("null");
1130
    } else {
1131
      sb.append(this.shipment_contents);
1132
    }
1133
    first = false;
1134
    sb.append(")");
1135
    return sb.toString();
1136
  }
1137
 
1138
  public void validate() throws TException {
1139
    // check for required fields
1140
  }
1141
 
1142
}
1143