Subversion Repositories SmartDukaan

Rev

Rev 3106 | Go to most recent revision | Details | Last modification | View Log | RSS feed

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