Subversion Repositories SmartDukaan

Rev

Rev 648 | Rev 3430 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
648 chandransh 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 AwbUpdate implements TBase<AwbUpdate._Fields>, java.io.Serializable, Cloneable, Comparable<AwbUpdate> {
27
  private static final TStruct STRUCT_DESC = new TStruct("AwbUpdate");
28
 
29
  private static final TField AWB_NUMBER_FIELD_DESC = new TField("awbNumber", TType.STRING, (short)1);
30
  private static final TField PROVIDER_NAME_FIELD_DESC = new TField("providerName", TType.STRING, (short)2);
31
  private static final TField LOCATION_FIELD_DESC = new TField("location", TType.STRING, (short)3);
32
  private static final TField ENTRY_DATE_FIELD_DESC = new TField("entryDate", TType.I64, (short)4);
33
  private static final TField DESCRIPTION_FIELD_DESC = new TField("description", TType.STRING, (short)5);
34
 
35
  private String awbNumber;
36
  private String providerName;
37
  private String location;
38
  private long entryDate;
39
  private String description;
40
 
41
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
42
  public enum _Fields implements TFieldIdEnum {
43
    AWB_NUMBER((short)1, "awbNumber"),
44
    PROVIDER_NAME((short)2, "providerName"),
45
    LOCATION((short)3, "location"),
46
    ENTRY_DATE((short)4, "entryDate"),
47
    DESCRIPTION((short)5, "description");
48
 
49
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
50
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
51
 
52
    static {
53
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
54
        byId.put((int)field._thriftId, field);
55
        byName.put(field.getFieldName(), field);
56
      }
57
    }
58
 
59
    /**
60
     * Find the _Fields constant that matches fieldId, or null if its not found.
61
     */
62
    public static _Fields findByThriftId(int fieldId) {
63
      return byId.get(fieldId);
64
    }
65
 
66
    /**
67
     * Find the _Fields constant that matches fieldId, throwing an exception
68
     * if it is not found.
69
     */
70
    public static _Fields findByThriftIdOrThrow(int fieldId) {
71
      _Fields fields = findByThriftId(fieldId);
72
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
73
      return fields;
74
    }
75
 
76
    /**
77
     * Find the _Fields constant that matches name, or null if its not found.
78
     */
79
    public static _Fields findByName(String name) {
80
      return byName.get(name);
81
    }
82
 
83
    private final short _thriftId;
84
    private final String _fieldName;
85
 
86
    _Fields(short thriftId, String fieldName) {
87
      _thriftId = thriftId;
88
      _fieldName = fieldName;
89
    }
90
 
91
    public short getThriftFieldId() {
92
      return _thriftId;
93
    }
94
 
95
    public String getFieldName() {
96
      return _fieldName;
97
    }
98
  }
99
 
100
  // isset id assignments
101
  private static final int __ENTRYDATE_ISSET_ID = 0;
102
  private BitSet __isset_bit_vector = new BitSet(1);
103
 
104
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
105
    put(_Fields.AWB_NUMBER, new FieldMetaData("awbNumber", TFieldRequirementType.DEFAULT, 
106
        new FieldValueMetaData(TType.STRING)));
107
    put(_Fields.PROVIDER_NAME, new FieldMetaData("providerName", TFieldRequirementType.DEFAULT, 
108
        new FieldValueMetaData(TType.STRING)));
109
    put(_Fields.LOCATION, new FieldMetaData("location", TFieldRequirementType.DEFAULT, 
110
        new FieldValueMetaData(TType.STRING)));
111
    put(_Fields.ENTRY_DATE, new FieldMetaData("entryDate", TFieldRequirementType.DEFAULT, 
112
        new FieldValueMetaData(TType.I64)));
113
    put(_Fields.DESCRIPTION, new FieldMetaData("description", TFieldRequirementType.DEFAULT, 
114
        new FieldValueMetaData(TType.STRING)));
115
  }});
116
 
117
  static {
118
    FieldMetaData.addStructMetaDataMap(AwbUpdate.class, metaDataMap);
119
  }
120
 
121
  public AwbUpdate() {
122
  }
123
 
124
  public AwbUpdate(
125
    String awbNumber,
126
    String providerName,
127
    String location,
128
    long entryDate,
129
    String description)
130
  {
131
    this();
132
    this.awbNumber = awbNumber;
133
    this.providerName = providerName;
134
    this.location = location;
135
    this.entryDate = entryDate;
136
    setEntryDateIsSet(true);
137
    this.description = description;
138
  }
139
 
140
  /**
141
   * Performs a deep copy on <i>other</i>.
142
   */
143
  public AwbUpdate(AwbUpdate other) {
144
    __isset_bit_vector.clear();
145
    __isset_bit_vector.or(other.__isset_bit_vector);
146
    if (other.isSetAwbNumber()) {
147
      this.awbNumber = other.awbNumber;
148
    }
149
    if (other.isSetProviderName()) {
150
      this.providerName = other.providerName;
151
    }
152
    if (other.isSetLocation()) {
153
      this.location = other.location;
154
    }
155
    this.entryDate = other.entryDate;
156
    if (other.isSetDescription()) {
157
      this.description = other.description;
158
    }
159
  }
160
 
161
  public AwbUpdate deepCopy() {
162
    return new AwbUpdate(this);
163
  }
164
 
165
  @Deprecated
166
  public AwbUpdate clone() {
167
    return new AwbUpdate(this);
168
  }
169
 
170
  public String getAwbNumber() {
171
    return this.awbNumber;
172
  }
173
 
174
  public AwbUpdate setAwbNumber(String awbNumber) {
175
    this.awbNumber = awbNumber;
176
    return this;
177
  }
178
 
179
  public void unsetAwbNumber() {
180
    this.awbNumber = null;
181
  }
182
 
183
  /** Returns true if field awbNumber is set (has been asigned a value) and false otherwise */
184
  public boolean isSetAwbNumber() {
185
    return this.awbNumber != null;
186
  }
187
 
188
  public void setAwbNumberIsSet(boolean value) {
189
    if (!value) {
190
      this.awbNumber = null;
191
    }
192
  }
193
 
194
  public String getProviderName() {
195
    return this.providerName;
196
  }
197
 
198
  public AwbUpdate setProviderName(String providerName) {
199
    this.providerName = providerName;
200
    return this;
201
  }
202
 
203
  public void unsetProviderName() {
204
    this.providerName = null;
205
  }
206
 
207
  /** Returns true if field providerName is set (has been asigned a value) and false otherwise */
208
  public boolean isSetProviderName() {
209
    return this.providerName != null;
210
  }
211
 
212
  public void setProviderNameIsSet(boolean value) {
213
    if (!value) {
214
      this.providerName = null;
215
    }
216
  }
217
 
218
  public String getLocation() {
219
    return this.location;
220
  }
221
 
222
  public AwbUpdate setLocation(String location) {
223
    this.location = location;
224
    return this;
225
  }
226
 
227
  public void unsetLocation() {
228
    this.location = null;
229
  }
230
 
231
  /** Returns true if field location is set (has been asigned a value) and false otherwise */
232
  public boolean isSetLocation() {
233
    return this.location != null;
234
  }
235
 
236
  public void setLocationIsSet(boolean value) {
237
    if (!value) {
238
      this.location = null;
239
    }
240
  }
241
 
242
  public long getEntryDate() {
243
    return this.entryDate;
244
  }
245
 
246
  public AwbUpdate setEntryDate(long entryDate) {
247
    this.entryDate = entryDate;
248
    setEntryDateIsSet(true);
249
    return this;
250
  }
251
 
252
  public void unsetEntryDate() {
253
    __isset_bit_vector.clear(__ENTRYDATE_ISSET_ID);
254
  }
255
 
256
  /** Returns true if field entryDate is set (has been asigned a value) and false otherwise */
257
  public boolean isSetEntryDate() {
258
    return __isset_bit_vector.get(__ENTRYDATE_ISSET_ID);
259
  }
260
 
261
  public void setEntryDateIsSet(boolean value) {
262
    __isset_bit_vector.set(__ENTRYDATE_ISSET_ID, value);
263
  }
264
 
265
  public String getDescription() {
266
    return this.description;
267
  }
268
 
269
  public AwbUpdate setDescription(String description) {
270
    this.description = description;
271
    return this;
272
  }
273
 
274
  public void unsetDescription() {
275
    this.description = null;
276
  }
277
 
278
  /** Returns true if field description is set (has been asigned a value) and false otherwise */
279
  public boolean isSetDescription() {
280
    return this.description != null;
281
  }
282
 
283
  public void setDescriptionIsSet(boolean value) {
284
    if (!value) {
285
      this.description = null;
286
    }
287
  }
288
 
289
  public void setFieldValue(_Fields field, Object value) {
290
    switch (field) {
291
    case AWB_NUMBER:
292
      if (value == null) {
293
        unsetAwbNumber();
294
      } else {
295
        setAwbNumber((String)value);
296
      }
297
      break;
298
 
299
    case PROVIDER_NAME:
300
      if (value == null) {
301
        unsetProviderName();
302
      } else {
303
        setProviderName((String)value);
304
      }
305
      break;
306
 
307
    case LOCATION:
308
      if (value == null) {
309
        unsetLocation();
310
      } else {
311
        setLocation((String)value);
312
      }
313
      break;
314
 
315
    case ENTRY_DATE:
316
      if (value == null) {
317
        unsetEntryDate();
318
      } else {
319
        setEntryDate((Long)value);
320
      }
321
      break;
322
 
323
    case DESCRIPTION:
324
      if (value == null) {
325
        unsetDescription();
326
      } else {
327
        setDescription((String)value);
328
      }
329
      break;
330
 
331
    }
332
  }
333
 
334
  public void setFieldValue(int fieldID, Object value) {
335
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
336
  }
337
 
338
  public Object getFieldValue(_Fields field) {
339
    switch (field) {
340
    case AWB_NUMBER:
341
      return getAwbNumber();
342
 
343
    case PROVIDER_NAME:
344
      return getProviderName();
345
 
346
    case LOCATION:
347
      return getLocation();
348
 
349
    case ENTRY_DATE:
350
      return new Long(getEntryDate());
351
 
352
    case DESCRIPTION:
353
      return getDescription();
354
 
355
    }
356
    throw new IllegalStateException();
357
  }
358
 
359
  public Object getFieldValue(int fieldId) {
360
    return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
361
  }
362
 
363
  /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
364
  public boolean isSet(_Fields field) {
365
    switch (field) {
366
    case AWB_NUMBER:
367
      return isSetAwbNumber();
368
    case PROVIDER_NAME:
369
      return isSetProviderName();
370
    case LOCATION:
371
      return isSetLocation();
372
    case ENTRY_DATE:
373
      return isSetEntryDate();
374
    case DESCRIPTION:
375
      return isSetDescription();
376
    }
377
    throw new IllegalStateException();
378
  }
379
 
380
  public boolean isSet(int fieldID) {
381
    return isSet(_Fields.findByThriftIdOrThrow(fieldID));
382
  }
383
 
384
  @Override
385
  public boolean equals(Object that) {
386
    if (that == null)
387
      return false;
388
    if (that instanceof AwbUpdate)
389
      return this.equals((AwbUpdate)that);
390
    return false;
391
  }
392
 
393
  public boolean equals(AwbUpdate that) {
394
    if (that == null)
395
      return false;
396
 
397
    boolean this_present_awbNumber = true && this.isSetAwbNumber();
398
    boolean that_present_awbNumber = true && that.isSetAwbNumber();
399
    if (this_present_awbNumber || that_present_awbNumber) {
400
      if (!(this_present_awbNumber && that_present_awbNumber))
401
        return false;
402
      if (!this.awbNumber.equals(that.awbNumber))
403
        return false;
404
    }
405
 
406
    boolean this_present_providerName = true && this.isSetProviderName();
407
    boolean that_present_providerName = true && that.isSetProviderName();
408
    if (this_present_providerName || that_present_providerName) {
409
      if (!(this_present_providerName && that_present_providerName))
410
        return false;
411
      if (!this.providerName.equals(that.providerName))
412
        return false;
413
    }
414
 
415
    boolean this_present_location = true && this.isSetLocation();
416
    boolean that_present_location = true && that.isSetLocation();
417
    if (this_present_location || that_present_location) {
418
      if (!(this_present_location && that_present_location))
419
        return false;
420
      if (!this.location.equals(that.location))
421
        return false;
422
    }
423
 
424
    boolean this_present_entryDate = true;
425
    boolean that_present_entryDate = true;
426
    if (this_present_entryDate || that_present_entryDate) {
427
      if (!(this_present_entryDate && that_present_entryDate))
428
        return false;
429
      if (this.entryDate != that.entryDate)
430
        return false;
431
    }
432
 
433
    boolean this_present_description = true && this.isSetDescription();
434
    boolean that_present_description = true && that.isSetDescription();
435
    if (this_present_description || that_present_description) {
436
      if (!(this_present_description && that_present_description))
437
        return false;
438
      if (!this.description.equals(that.description))
439
        return false;
440
    }
441
 
442
    return true;
443
  }
444
 
445
  @Override
446
  public int hashCode() {
447
    return 0;
448
  }
449
 
450
  public int compareTo(AwbUpdate other) {
451
    if (!getClass().equals(other.getClass())) {
452
      return getClass().getName().compareTo(other.getClass().getName());
453
    }
454
 
455
    int lastComparison = 0;
456
    AwbUpdate typedOther = (AwbUpdate)other;
457
 
458
    lastComparison = Boolean.valueOf(isSetAwbNumber()).compareTo(isSetAwbNumber());
459
    if (lastComparison != 0) {
460
      return lastComparison;
461
    }
462
    lastComparison = TBaseHelper.compareTo(awbNumber, typedOther.awbNumber);
463
    if (lastComparison != 0) {
464
      return lastComparison;
465
    }
466
    lastComparison = Boolean.valueOf(isSetProviderName()).compareTo(isSetProviderName());
467
    if (lastComparison != 0) {
468
      return lastComparison;
469
    }
470
    lastComparison = TBaseHelper.compareTo(providerName, typedOther.providerName);
471
    if (lastComparison != 0) {
472
      return lastComparison;
473
    }
474
    lastComparison = Boolean.valueOf(isSetLocation()).compareTo(isSetLocation());
475
    if (lastComparison != 0) {
476
      return lastComparison;
477
    }
478
    lastComparison = TBaseHelper.compareTo(location, typedOther.location);
479
    if (lastComparison != 0) {
480
      return lastComparison;
481
    }
482
    lastComparison = Boolean.valueOf(isSetEntryDate()).compareTo(isSetEntryDate());
483
    if (lastComparison != 0) {
484
      return lastComparison;
485
    }
486
    lastComparison = TBaseHelper.compareTo(entryDate, typedOther.entryDate);
487
    if (lastComparison != 0) {
488
      return lastComparison;
489
    }
490
    lastComparison = Boolean.valueOf(isSetDescription()).compareTo(isSetDescription());
491
    if (lastComparison != 0) {
492
      return lastComparison;
493
    }
494
    lastComparison = TBaseHelper.compareTo(description, typedOther.description);
495
    if (lastComparison != 0) {
496
      return lastComparison;
497
    }
498
    return 0;
499
  }
500
 
501
  public void read(TProtocol iprot) throws TException {
502
    TField field;
503
    iprot.readStructBegin();
504
    while (true)
505
    {
506
      field = iprot.readFieldBegin();
507
      if (field.type == TType.STOP) { 
508
        break;
509
      }
510
      _Fields fieldId = _Fields.findByThriftId(field.id);
511
      if (fieldId == null) {
512
        TProtocolUtil.skip(iprot, field.type);
513
      } else {
514
        switch (fieldId) {
515
          case AWB_NUMBER:
516
            if (field.type == TType.STRING) {
517
              this.awbNumber = iprot.readString();
518
            } else { 
519
              TProtocolUtil.skip(iprot, field.type);
520
            }
521
            break;
522
          case PROVIDER_NAME:
523
            if (field.type == TType.STRING) {
524
              this.providerName = iprot.readString();
525
            } else { 
526
              TProtocolUtil.skip(iprot, field.type);
527
            }
528
            break;
529
          case LOCATION:
530
            if (field.type == TType.STRING) {
531
              this.location = iprot.readString();
532
            } else { 
533
              TProtocolUtil.skip(iprot, field.type);
534
            }
535
            break;
536
          case ENTRY_DATE:
537
            if (field.type == TType.I64) {
538
              this.entryDate = iprot.readI64();
539
              setEntryDateIsSet(true);
540
            } else { 
541
              TProtocolUtil.skip(iprot, field.type);
542
            }
543
            break;
544
          case DESCRIPTION:
545
            if (field.type == TType.STRING) {
546
              this.description = iprot.readString();
547
            } else { 
548
              TProtocolUtil.skip(iprot, field.type);
549
            }
550
            break;
551
        }
552
        iprot.readFieldEnd();
553
      }
554
    }
555
    iprot.readStructEnd();
556
    validate();
557
  }
558
 
559
  public void write(TProtocol oprot) throws TException {
560
    validate();
561
 
562
    oprot.writeStructBegin(STRUCT_DESC);
563
    if (this.awbNumber != null) {
564
      oprot.writeFieldBegin(AWB_NUMBER_FIELD_DESC);
565
      oprot.writeString(this.awbNumber);
566
      oprot.writeFieldEnd();
567
    }
568
    if (this.providerName != null) {
569
      oprot.writeFieldBegin(PROVIDER_NAME_FIELD_DESC);
570
      oprot.writeString(this.providerName);
571
      oprot.writeFieldEnd();
572
    }
573
    if (this.location != null) {
574
      oprot.writeFieldBegin(LOCATION_FIELD_DESC);
575
      oprot.writeString(this.location);
576
      oprot.writeFieldEnd();
577
    }
578
    oprot.writeFieldBegin(ENTRY_DATE_FIELD_DESC);
579
    oprot.writeI64(this.entryDate);
580
    oprot.writeFieldEnd();
581
    if (this.description != null) {
582
      oprot.writeFieldBegin(DESCRIPTION_FIELD_DESC);
583
      oprot.writeString(this.description);
584
      oprot.writeFieldEnd();
585
    }
586
    oprot.writeFieldStop();
587
    oprot.writeStructEnd();
588
  }
589
 
590
  @Override
591
  public String toString() {
592
    StringBuilder sb = new StringBuilder("AwbUpdate(");
593
    boolean first = true;
594
 
595
    sb.append("awbNumber:");
596
    if (this.awbNumber == null) {
597
      sb.append("null");
598
    } else {
599
      sb.append(this.awbNumber);
600
    }
601
    first = false;
602
    if (!first) sb.append(", ");
603
    sb.append("providerName:");
604
    if (this.providerName == null) {
605
      sb.append("null");
606
    } else {
607
      sb.append(this.providerName);
608
    }
609
    first = false;
610
    if (!first) sb.append(", ");
611
    sb.append("location:");
612
    if (this.location == null) {
613
      sb.append("null");
614
    } else {
615
      sb.append(this.location);
616
    }
617
    first = false;
618
    if (!first) sb.append(", ");
619
    sb.append("entryDate:");
620
    sb.append(this.entryDate);
621
    first = false;
622
    if (!first) sb.append(", ");
623
    sb.append("description:");
624
    if (this.description == null) {
625
      sb.append("null");
626
    } else {
627
      sb.append(this.description);
628
    }
629
    first = false;
630
    sb.append(")");
631
    return sb.toString();
632
  }
633
 
634
  public void validate() throws TException {
635
    // check for required fields
636
  }
637
 
638
}
639