Subversion Repositories SmartDukaan

Rev

Rev 3028 | Rev 3168 | Go to most recent revision | Details | Compare with Previous | 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);
3106 mandeep.dh 33
  private static final TField DESCRIPTION_FIELD_DESC = new TField("description", TType.STRING, (short)5);
34
  private static final TField PRIORITY_FIELD_DESC = new TField("priority", TType.I32, (short)6);
35
  private static final TField CATEGORY_FIELD_DESC = new TField("category", TType.I32, (short)7);
36
  private static final TField STATUS_FIELD_DESC = new TField("status", TType.I32, (short)8);
37
  private static final TField ASSIGNEE_ID_FIELD_DESC = new TField("assigneeId", TType.I64, (short)9);
38
  private static final TField CREATOR_ID_FIELD_DESC = new TField("creatorId", TType.I64, (short)10);
39
  private static final TField ORDER_ID_FIELD_DESC = new TField("orderId", TType.I64, (short)11);
40
  private static final TField AIRWAY_BILL_NO_FIELD_DESC = new TField("airwayBillNo", TType.STRING, (short)12);
41
  private static final TField PRODUCT_NAME_FIELD_DESC = new TField("productName", TType.STRING, (short)13);
3028 mandeep.dh 42
 
43
  private long id;
44
  private long customerId;
45
  private long openDate;
46
  private long closeDate;
3106 mandeep.dh 47
  private String description;
48
  private TicketPriority priority;
49
  private TicketCategory category;
50
  private TicketStatus status;
51
  private long assigneeId;
3028 mandeep.dh 52
  private long creatorId;
53
  private long orderId;
54
  private String airwayBillNo;
55
  private String productName;
56
 
57
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
58
  public enum _Fields implements TFieldIdEnum {
59
    ID((short)1, "id"),
60
    CUSTOMER_ID((short)2, "customerId"),
61
    OPEN_DATE((short)3, "openDate"),
62
    CLOSE_DATE((short)4, "closeDate"),
3106 mandeep.dh 63
    DESCRIPTION((short)5, "description"),
64
    /**
65
     * 
66
     * @see TicketPriority
67
     */
68
    PRIORITY((short)6, "priority"),
69
    /**
70
     * 
71
     * @see TicketCategory
72
     */
73
    CATEGORY((short)7, "category"),
74
    /**
75
     * 
76
     * @see TicketStatus
77
     */
78
    STATUS((short)8, "status"),
79
    ASSIGNEE_ID((short)9, "assigneeId"),
80
    CREATOR_ID((short)10, "creatorId"),
81
    ORDER_ID((short)11, "orderId"),
82
    AIRWAY_BILL_NO((short)12, "airwayBillNo"),
83
    PRODUCT_NAME((short)13, "productName");
3028 mandeep.dh 84
 
85
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
86
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
87
 
88
    static {
89
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
90
        byId.put((int)field._thriftId, field);
91
        byName.put(field.getFieldName(), field);
92
      }
93
    }
94
 
95
    /**
96
     * Find the _Fields constant that matches fieldId, or null if its not found.
97
     */
98
    public static _Fields findByThriftId(int fieldId) {
99
      return byId.get(fieldId);
100
    }
101
 
102
    /**
103
     * Find the _Fields constant that matches fieldId, throwing an exception
104
     * if it is not found.
105
     */
106
    public static _Fields findByThriftIdOrThrow(int fieldId) {
107
      _Fields fields = findByThriftId(fieldId);
108
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
109
      return fields;
110
    }
111
 
112
    /**
113
     * Find the _Fields constant that matches name, or null if its not found.
114
     */
115
    public static _Fields findByName(String name) {
116
      return byName.get(name);
117
    }
118
 
119
    private final short _thriftId;
120
    private final String _fieldName;
121
 
122
    _Fields(short thriftId, String fieldName) {
123
      _thriftId = thriftId;
124
      _fieldName = fieldName;
125
    }
126
 
127
    public short getThriftFieldId() {
128
      return _thriftId;
129
    }
130
 
131
    public String getFieldName() {
132
      return _fieldName;
133
    }
134
  }
135
 
136
  // isset id assignments
137
  private static final int __ID_ISSET_ID = 0;
138
  private static final int __CUSTOMERID_ISSET_ID = 1;
139
  private static final int __OPENDATE_ISSET_ID = 2;
140
  private static final int __CLOSEDATE_ISSET_ID = 3;
3106 mandeep.dh 141
  private static final int __ASSIGNEEID_ISSET_ID = 4;
142
  private static final int __CREATORID_ISSET_ID = 5;
3028 mandeep.dh 143
  private static final int __ORDERID_ISSET_ID = 6;
144
  private BitSet __isset_bit_vector = new BitSet(7);
145
 
146
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
147
    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
148
        new FieldValueMetaData(TType.I64)));
149
    put(_Fields.CUSTOMER_ID, new FieldMetaData("customerId", TFieldRequirementType.DEFAULT, 
150
        new FieldValueMetaData(TType.I64)));
151
    put(_Fields.OPEN_DATE, new FieldMetaData("openDate", TFieldRequirementType.DEFAULT, 
152
        new FieldValueMetaData(TType.I64)));
153
    put(_Fields.CLOSE_DATE, new FieldMetaData("closeDate", TFieldRequirementType.DEFAULT, 
154
        new FieldValueMetaData(TType.I64)));
3106 mandeep.dh 155
    put(_Fields.DESCRIPTION, new FieldMetaData("description", TFieldRequirementType.DEFAULT, 
3028 mandeep.dh 156
        new FieldValueMetaData(TType.STRING)));
3106 mandeep.dh 157
    put(_Fields.PRIORITY, new FieldMetaData("priority", TFieldRequirementType.DEFAULT, 
158
        new EnumMetaData(TType.ENUM, TicketPriority.class)));
159
    put(_Fields.CATEGORY, new FieldMetaData("category", TFieldRequirementType.DEFAULT, 
160
        new EnumMetaData(TType.ENUM, TicketCategory.class)));
161
    put(_Fields.STATUS, new FieldMetaData("status", TFieldRequirementType.DEFAULT, 
162
        new EnumMetaData(TType.ENUM, TicketStatus.class)));
163
    put(_Fields.ASSIGNEE_ID, new FieldMetaData("assigneeId", TFieldRequirementType.DEFAULT, 
164
        new FieldValueMetaData(TType.I64)));
3028 mandeep.dh 165
    put(_Fields.CREATOR_ID, new FieldMetaData("creatorId", TFieldRequirementType.DEFAULT, 
166
        new FieldValueMetaData(TType.I64)));
167
    put(_Fields.ORDER_ID, new FieldMetaData("orderId", TFieldRequirementType.DEFAULT, 
168
        new FieldValueMetaData(TType.I64)));
169
    put(_Fields.AIRWAY_BILL_NO, new FieldMetaData("airwayBillNo", TFieldRequirementType.DEFAULT, 
170
        new FieldValueMetaData(TType.STRING)));
171
    put(_Fields.PRODUCT_NAME, new FieldMetaData("productName", TFieldRequirementType.DEFAULT, 
172
        new FieldValueMetaData(TType.STRING)));
173
  }});
174
 
175
  static {
176
    FieldMetaData.addStructMetaDataMap(Ticket.class, metaDataMap);
177
  }
178
 
179
  public Ticket() {
180
  }
181
 
182
  public Ticket(
183
    long id,
184
    long customerId,
185
    long openDate,
186
    long closeDate,
3106 mandeep.dh 187
    String description,
188
    TicketPriority priority,
189
    TicketCategory category,
190
    TicketStatus status,
191
    long assigneeId,
3028 mandeep.dh 192
    long creatorId,
193
    long orderId,
194
    String airwayBillNo,
195
    String productName)
196
  {
197
    this();
198
    this.id = id;
199
    setIdIsSet(true);
200
    this.customerId = customerId;
201
    setCustomerIdIsSet(true);
202
    this.openDate = openDate;
203
    setOpenDateIsSet(true);
204
    this.closeDate = closeDate;
205
    setCloseDateIsSet(true);
3106 mandeep.dh 206
    this.description = description;
207
    this.priority = priority;
208
    this.category = category;
209
    this.status = status;
210
    this.assigneeId = assigneeId;
211
    setAssigneeIdIsSet(true);
3028 mandeep.dh 212
    this.creatorId = creatorId;
213
    setCreatorIdIsSet(true);
214
    this.orderId = orderId;
215
    setOrderIdIsSet(true);
216
    this.airwayBillNo = airwayBillNo;
217
    this.productName = productName;
218
  }
219
 
220
  /**
221
   * Performs a deep copy on <i>other</i>.
222
   */
223
  public Ticket(Ticket other) {
224
    __isset_bit_vector.clear();
225
    __isset_bit_vector.or(other.__isset_bit_vector);
226
    this.id = other.id;
227
    this.customerId = other.customerId;
228
    this.openDate = other.openDate;
229
    this.closeDate = other.closeDate;
3106 mandeep.dh 230
    if (other.isSetDescription()) {
231
      this.description = other.description;
3028 mandeep.dh 232
    }
3106 mandeep.dh 233
    if (other.isSetPriority()) {
234
      this.priority = other.priority;
235
    }
236
    if (other.isSetCategory()) {
237
      this.category = other.category;
238
    }
239
    if (other.isSetStatus()) {
240
      this.status = other.status;
241
    }
242
    this.assigneeId = other.assigneeId;
3028 mandeep.dh 243
    this.creatorId = other.creatorId;
244
    this.orderId = other.orderId;
245
    if (other.isSetAirwayBillNo()) {
246
      this.airwayBillNo = other.airwayBillNo;
247
    }
248
    if (other.isSetProductName()) {
249
      this.productName = other.productName;
250
    }
251
  }
252
 
253
  public Ticket deepCopy() {
254
    return new Ticket(this);
255
  }
256
 
257
  @Deprecated
258
  public Ticket clone() {
259
    return new Ticket(this);
260
  }
261
 
262
  public long getId() {
263
    return this.id;
264
  }
265
 
266
  public Ticket setId(long id) {
267
    this.id = id;
268
    setIdIsSet(true);
269
    return this;
270
  }
271
 
272
  public void unsetId() {
273
    __isset_bit_vector.clear(__ID_ISSET_ID);
274
  }
275
 
276
  /** Returns true if field id is set (has been asigned a value) and false otherwise */
277
  public boolean isSetId() {
278
    return __isset_bit_vector.get(__ID_ISSET_ID);
279
  }
280
 
281
  public void setIdIsSet(boolean value) {
282
    __isset_bit_vector.set(__ID_ISSET_ID, value);
283
  }
284
 
285
  public long getCustomerId() {
286
    return this.customerId;
287
  }
288
 
289
  public Ticket setCustomerId(long customerId) {
290
    this.customerId = customerId;
291
    setCustomerIdIsSet(true);
292
    return this;
293
  }
294
 
295
  public void unsetCustomerId() {
296
    __isset_bit_vector.clear(__CUSTOMERID_ISSET_ID);
297
  }
298
 
299
  /** Returns true if field customerId is set (has been asigned a value) and false otherwise */
300
  public boolean isSetCustomerId() {
301
    return __isset_bit_vector.get(__CUSTOMERID_ISSET_ID);
302
  }
303
 
304
  public void setCustomerIdIsSet(boolean value) {
305
    __isset_bit_vector.set(__CUSTOMERID_ISSET_ID, value);
306
  }
307
 
308
  public long getOpenDate() {
309
    return this.openDate;
310
  }
311
 
312
  public Ticket setOpenDate(long openDate) {
313
    this.openDate = openDate;
314
    setOpenDateIsSet(true);
315
    return this;
316
  }
317
 
318
  public void unsetOpenDate() {
319
    __isset_bit_vector.clear(__OPENDATE_ISSET_ID);
320
  }
321
 
322
  /** Returns true if field openDate is set (has been asigned a value) and false otherwise */
323
  public boolean isSetOpenDate() {
324
    return __isset_bit_vector.get(__OPENDATE_ISSET_ID);
325
  }
326
 
327
  public void setOpenDateIsSet(boolean value) {
328
    __isset_bit_vector.set(__OPENDATE_ISSET_ID, value);
329
  }
330
 
331
  public long getCloseDate() {
332
    return this.closeDate;
333
  }
334
 
335
  public Ticket setCloseDate(long closeDate) {
336
    this.closeDate = closeDate;
337
    setCloseDateIsSet(true);
338
    return this;
339
  }
340
 
341
  public void unsetCloseDate() {
342
    __isset_bit_vector.clear(__CLOSEDATE_ISSET_ID);
343
  }
344
 
345
  /** Returns true if field closeDate is set (has been asigned a value) and false otherwise */
346
  public boolean isSetCloseDate() {
347
    return __isset_bit_vector.get(__CLOSEDATE_ISSET_ID);
348
  }
349
 
350
  public void setCloseDateIsSet(boolean value) {
351
    __isset_bit_vector.set(__CLOSEDATE_ISSET_ID, value);
352
  }
353
 
3106 mandeep.dh 354
  public String getDescription() {
355
    return this.description;
3028 mandeep.dh 356
  }
357
 
3106 mandeep.dh 358
  public Ticket setDescription(String description) {
359
    this.description = description;
3028 mandeep.dh 360
    return this;
361
  }
362
 
3106 mandeep.dh 363
  public void unsetDescription() {
364
    this.description = null;
3028 mandeep.dh 365
  }
366
 
3106 mandeep.dh 367
  /** Returns true if field description is set (has been asigned a value) and false otherwise */
368
  public boolean isSetDescription() {
369
    return this.description != null;
3028 mandeep.dh 370
  }
371
 
3106 mandeep.dh 372
  public void setDescriptionIsSet(boolean value) {
3028 mandeep.dh 373
    if (!value) {
3106 mandeep.dh 374
      this.description = null;
3028 mandeep.dh 375
    }
376
  }
377
 
3106 mandeep.dh 378
  /**
379
   * 
380
   * @see TicketPriority
381
   */
382
  public TicketPriority getPriority() {
383
    return this.priority;
384
  }
385
 
386
  /**
387
   * 
388
   * @see TicketPriority
389
   */
390
  public Ticket setPriority(TicketPriority priority) {
391
    this.priority = priority;
392
    return this;
393
  }
394
 
395
  public void unsetPriority() {
396
    this.priority = null;
397
  }
398
 
399
  /** Returns true if field priority is set (has been asigned a value) and false otherwise */
400
  public boolean isSetPriority() {
401
    return this.priority != null;
402
  }
403
 
404
  public void setPriorityIsSet(boolean value) {
405
    if (!value) {
406
      this.priority = null;
407
    }
408
  }
409
 
410
  /**
411
   * 
412
   * @see TicketCategory
413
   */
414
  public TicketCategory getCategory() {
415
    return this.category;
416
  }
417
 
418
  /**
419
   * 
420
   * @see TicketCategory
421
   */
422
  public Ticket setCategory(TicketCategory category) {
423
    this.category = category;
424
    return this;
425
  }
426
 
427
  public void unsetCategory() {
428
    this.category = null;
429
  }
430
 
431
  /** Returns true if field category is set (has been asigned a value) and false otherwise */
432
  public boolean isSetCategory() {
433
    return this.category != null;
434
  }
435
 
436
  public void setCategoryIsSet(boolean value) {
437
    if (!value) {
438
      this.category = null;
439
    }
440
  }
441
 
442
  /**
443
   * 
444
   * @see TicketStatus
445
   */
446
  public TicketStatus getStatus() {
447
    return this.status;
448
  }
449
 
450
  /**
451
   * 
452
   * @see TicketStatus
453
   */
454
  public Ticket setStatus(TicketStatus status) {
455
    this.status = status;
456
    return this;
457
  }
458
 
459
  public void unsetStatus() {
460
    this.status = null;
461
  }
462
 
463
  /** Returns true if field status is set (has been asigned a value) and false otherwise */
464
  public boolean isSetStatus() {
465
    return this.status != null;
466
  }
467
 
468
  public void setStatusIsSet(boolean value) {
469
    if (!value) {
470
      this.status = null;
471
    }
472
  }
473
 
474
  public long getAssigneeId() {
475
    return this.assigneeId;
476
  }
477
 
478
  public Ticket setAssigneeId(long assigneeId) {
479
    this.assigneeId = assigneeId;
480
    setAssigneeIdIsSet(true);
481
    return this;
482
  }
483
 
484
  public void unsetAssigneeId() {
485
    __isset_bit_vector.clear(__ASSIGNEEID_ISSET_ID);
486
  }
487
 
488
  /** Returns true if field assigneeId is set (has been asigned a value) and false otherwise */
489
  public boolean isSetAssigneeId() {
490
    return __isset_bit_vector.get(__ASSIGNEEID_ISSET_ID);
491
  }
492
 
493
  public void setAssigneeIdIsSet(boolean value) {
494
    __isset_bit_vector.set(__ASSIGNEEID_ISSET_ID, value);
495
  }
496
 
3028 mandeep.dh 497
  public long getCreatorId() {
498
    return this.creatorId;
499
  }
500
 
501
  public Ticket setCreatorId(long creatorId) {
502
    this.creatorId = creatorId;
503
    setCreatorIdIsSet(true);
504
    return this;
505
  }
506
 
507
  public void unsetCreatorId() {
508
    __isset_bit_vector.clear(__CREATORID_ISSET_ID);
509
  }
510
 
511
  /** Returns true if field creatorId is set (has been asigned a value) and false otherwise */
512
  public boolean isSetCreatorId() {
513
    return __isset_bit_vector.get(__CREATORID_ISSET_ID);
514
  }
515
 
516
  public void setCreatorIdIsSet(boolean value) {
517
    __isset_bit_vector.set(__CREATORID_ISSET_ID, value);
518
  }
519
 
520
  public long getOrderId() {
521
    return this.orderId;
522
  }
523
 
524
  public Ticket setOrderId(long orderId) {
525
    this.orderId = orderId;
526
    setOrderIdIsSet(true);
527
    return this;
528
  }
529
 
530
  public void unsetOrderId() {
531
    __isset_bit_vector.clear(__ORDERID_ISSET_ID);
532
  }
533
 
534
  /** Returns true if field orderId is set (has been asigned a value) and false otherwise */
535
  public boolean isSetOrderId() {
536
    return __isset_bit_vector.get(__ORDERID_ISSET_ID);
537
  }
538
 
539
  public void setOrderIdIsSet(boolean value) {
540
    __isset_bit_vector.set(__ORDERID_ISSET_ID, value);
541
  }
542
 
543
  public String getAirwayBillNo() {
544
    return this.airwayBillNo;
545
  }
546
 
547
  public Ticket setAirwayBillNo(String airwayBillNo) {
548
    this.airwayBillNo = airwayBillNo;
549
    return this;
550
  }
551
 
552
  public void unsetAirwayBillNo() {
553
    this.airwayBillNo = null;
554
  }
555
 
556
  /** Returns true if field airwayBillNo is set (has been asigned a value) and false otherwise */
557
  public boolean isSetAirwayBillNo() {
558
    return this.airwayBillNo != null;
559
  }
560
 
561
  public void setAirwayBillNoIsSet(boolean value) {
562
    if (!value) {
563
      this.airwayBillNo = null;
564
    }
565
  }
566
 
567
  public String getProductName() {
568
    return this.productName;
569
  }
570
 
571
  public Ticket setProductName(String productName) {
572
    this.productName = productName;
573
    return this;
574
  }
575
 
576
  public void unsetProductName() {
577
    this.productName = null;
578
  }
579
 
580
  /** Returns true if field productName is set (has been asigned a value) and false otherwise */
581
  public boolean isSetProductName() {
582
    return this.productName != null;
583
  }
584
 
585
  public void setProductNameIsSet(boolean value) {
586
    if (!value) {
587
      this.productName = null;
588
    }
589
  }
590
 
591
  public void setFieldValue(_Fields field, Object value) {
592
    switch (field) {
593
    case ID:
594
      if (value == null) {
595
        unsetId();
596
      } else {
597
        setId((Long)value);
598
      }
599
      break;
600
 
601
    case CUSTOMER_ID:
602
      if (value == null) {
603
        unsetCustomerId();
604
      } else {
605
        setCustomerId((Long)value);
606
      }
607
      break;
608
 
609
    case OPEN_DATE:
610
      if (value == null) {
611
        unsetOpenDate();
612
      } else {
613
        setOpenDate((Long)value);
614
      }
615
      break;
616
 
617
    case CLOSE_DATE:
618
      if (value == null) {
619
        unsetCloseDate();
620
      } else {
621
        setCloseDate((Long)value);
622
      }
623
      break;
624
 
3106 mandeep.dh 625
    case DESCRIPTION:
3028 mandeep.dh 626
      if (value == null) {
3106 mandeep.dh 627
        unsetDescription();
3028 mandeep.dh 628
      } else {
3106 mandeep.dh 629
        setDescription((String)value);
3028 mandeep.dh 630
      }
631
      break;
632
 
3106 mandeep.dh 633
    case PRIORITY:
3028 mandeep.dh 634
      if (value == null) {
3106 mandeep.dh 635
        unsetPriority();
3028 mandeep.dh 636
      } else {
3106 mandeep.dh 637
        setPriority((TicketPriority)value);
3028 mandeep.dh 638
      }
639
      break;
640
 
3106 mandeep.dh 641
    case CATEGORY:
3028 mandeep.dh 642
      if (value == null) {
3106 mandeep.dh 643
        unsetCategory();
3028 mandeep.dh 644
      } else {
3106 mandeep.dh 645
        setCategory((TicketCategory)value);
3028 mandeep.dh 646
      }
647
      break;
648
 
3106 mandeep.dh 649
    case STATUS:
650
      if (value == null) {
651
        unsetStatus();
652
      } else {
653
        setStatus((TicketStatus)value);
654
      }
655
      break;
656
 
657
    case ASSIGNEE_ID:
658
      if (value == null) {
659
        unsetAssigneeId();
660
      } else {
661
        setAssigneeId((Long)value);
662
      }
663
      break;
664
 
665
    case CREATOR_ID:
666
      if (value == null) {
667
        unsetCreatorId();
668
      } else {
669
        setCreatorId((Long)value);
670
      }
671
      break;
672
 
3028 mandeep.dh 673
    case ORDER_ID:
674
      if (value == null) {
675
        unsetOrderId();
676
      } else {
677
        setOrderId((Long)value);
678
      }
679
      break;
680
 
681
    case AIRWAY_BILL_NO:
682
      if (value == null) {
683
        unsetAirwayBillNo();
684
      } else {
685
        setAirwayBillNo((String)value);
686
      }
687
      break;
688
 
689
    case PRODUCT_NAME:
690
      if (value == null) {
691
        unsetProductName();
692
      } else {
693
        setProductName((String)value);
694
      }
695
      break;
696
 
697
    }
698
  }
699
 
700
  public void setFieldValue(int fieldID, Object value) {
701
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
702
  }
703
 
704
  public Object getFieldValue(_Fields field) {
705
    switch (field) {
706
    case ID:
707
      return new Long(getId());
708
 
709
    case CUSTOMER_ID:
710
      return new Long(getCustomerId());
711
 
712
    case OPEN_DATE:
713
      return new Long(getOpenDate());
714
 
715
    case CLOSE_DATE:
716
      return new Long(getCloseDate());
717
 
3106 mandeep.dh 718
    case DESCRIPTION:
719
      return getDescription();
3028 mandeep.dh 720
 
3106 mandeep.dh 721
    case PRIORITY:
722
      return getPriority();
723
 
724
    case CATEGORY:
725
      return getCategory();
726
 
727
    case STATUS:
728
      return getStatus();
729
 
730
    case ASSIGNEE_ID:
731
      return new Long(getAssigneeId());
732
 
3028 mandeep.dh 733
    case CREATOR_ID:
734
      return new Long(getCreatorId());
735
 
736
    case ORDER_ID:
737
      return new Long(getOrderId());
738
 
739
    case AIRWAY_BILL_NO:
740
      return getAirwayBillNo();
741
 
742
    case PRODUCT_NAME:
743
      return getProductName();
744
 
745
    }
746
    throw new IllegalStateException();
747
  }
748
 
749
  public Object getFieldValue(int fieldId) {
750
    return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
751
  }
752
 
753
  /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
754
  public boolean isSet(_Fields field) {
755
    switch (field) {
756
    case ID:
757
      return isSetId();
758
    case CUSTOMER_ID:
759
      return isSetCustomerId();
760
    case OPEN_DATE:
761
      return isSetOpenDate();
762
    case CLOSE_DATE:
763
      return isSetCloseDate();
3106 mandeep.dh 764
    case DESCRIPTION:
765
      return isSetDescription();
766
    case PRIORITY:
767
      return isSetPriority();
768
    case CATEGORY:
769
      return isSetCategory();
770
    case STATUS:
771
      return isSetStatus();
772
    case ASSIGNEE_ID:
773
      return isSetAssigneeId();
3028 mandeep.dh 774
    case CREATOR_ID:
775
      return isSetCreatorId();
776
    case ORDER_ID:
777
      return isSetOrderId();
778
    case AIRWAY_BILL_NO:
779
      return isSetAirwayBillNo();
780
    case PRODUCT_NAME:
781
      return isSetProductName();
782
    }
783
    throw new IllegalStateException();
784
  }
785
 
786
  public boolean isSet(int fieldID) {
787
    return isSet(_Fields.findByThriftIdOrThrow(fieldID));
788
  }
789
 
790
  @Override
791
  public boolean equals(Object that) {
792
    if (that == null)
793
      return false;
794
    if (that instanceof Ticket)
795
      return this.equals((Ticket)that);
796
    return false;
797
  }
798
 
799
  public boolean equals(Ticket that) {
800
    if (that == null)
801
      return false;
802
 
803
    boolean this_present_id = true;
804
    boolean that_present_id = true;
805
    if (this_present_id || that_present_id) {
806
      if (!(this_present_id && that_present_id))
807
        return false;
808
      if (this.id != that.id)
809
        return false;
810
    }
811
 
812
    boolean this_present_customerId = true;
813
    boolean that_present_customerId = true;
814
    if (this_present_customerId || that_present_customerId) {
815
      if (!(this_present_customerId && that_present_customerId))
816
        return false;
817
      if (this.customerId != that.customerId)
818
        return false;
819
    }
820
 
821
    boolean this_present_openDate = true;
822
    boolean that_present_openDate = true;
823
    if (this_present_openDate || that_present_openDate) {
824
      if (!(this_present_openDate && that_present_openDate))
825
        return false;
826
      if (this.openDate != that.openDate)
827
        return false;
828
    }
829
 
830
    boolean this_present_closeDate = true;
831
    boolean that_present_closeDate = true;
832
    if (this_present_closeDate || that_present_closeDate) {
833
      if (!(this_present_closeDate && that_present_closeDate))
834
        return false;
835
      if (this.closeDate != that.closeDate)
836
        return false;
837
    }
838
 
3106 mandeep.dh 839
    boolean this_present_description = true && this.isSetDescription();
840
    boolean that_present_description = true && that.isSetDescription();
841
    if (this_present_description || that_present_description) {
842
      if (!(this_present_description && that_present_description))
3028 mandeep.dh 843
        return false;
3106 mandeep.dh 844
      if (!this.description.equals(that.description))
3028 mandeep.dh 845
        return false;
846
    }
847
 
3106 mandeep.dh 848
    boolean this_present_priority = true && this.isSetPriority();
849
    boolean that_present_priority = true && that.isSetPriority();
850
    if (this_present_priority || that_present_priority) {
851
      if (!(this_present_priority && that_present_priority))
852
        return false;
853
      if (!this.priority.equals(that.priority))
854
        return false;
855
    }
856
 
857
    boolean this_present_category = true && this.isSetCategory();
858
    boolean that_present_category = true && that.isSetCategory();
859
    if (this_present_category || that_present_category) {
860
      if (!(this_present_category && that_present_category))
861
        return false;
862
      if (!this.category.equals(that.category))
863
        return false;
864
    }
865
 
866
    boolean this_present_status = true && this.isSetStatus();
867
    boolean that_present_status = true && that.isSetStatus();
868
    if (this_present_status || that_present_status) {
869
      if (!(this_present_status && that_present_status))
870
        return false;
871
      if (!this.status.equals(that.status))
872
        return false;
873
    }
874
 
875
    boolean this_present_assigneeId = true;
876
    boolean that_present_assigneeId = true;
877
    if (this_present_assigneeId || that_present_assigneeId) {
878
      if (!(this_present_assigneeId && that_present_assigneeId))
879
        return false;
880
      if (this.assigneeId != that.assigneeId)
881
        return false;
882
    }
883
 
3028 mandeep.dh 884
    boolean this_present_creatorId = true;
885
    boolean that_present_creatorId = true;
886
    if (this_present_creatorId || that_present_creatorId) {
887
      if (!(this_present_creatorId && that_present_creatorId))
888
        return false;
889
      if (this.creatorId != that.creatorId)
890
        return false;
891
    }
892
 
893
    boolean this_present_orderId = true;
894
    boolean that_present_orderId = true;
895
    if (this_present_orderId || that_present_orderId) {
896
      if (!(this_present_orderId && that_present_orderId))
897
        return false;
898
      if (this.orderId != that.orderId)
899
        return false;
900
    }
901
 
902
    boolean this_present_airwayBillNo = true && this.isSetAirwayBillNo();
903
    boolean that_present_airwayBillNo = true && that.isSetAirwayBillNo();
904
    if (this_present_airwayBillNo || that_present_airwayBillNo) {
905
      if (!(this_present_airwayBillNo && that_present_airwayBillNo))
906
        return false;
907
      if (!this.airwayBillNo.equals(that.airwayBillNo))
908
        return false;
909
    }
910
 
911
    boolean this_present_productName = true && this.isSetProductName();
912
    boolean that_present_productName = true && that.isSetProductName();
913
    if (this_present_productName || that_present_productName) {
914
      if (!(this_present_productName && that_present_productName))
915
        return false;
916
      if (!this.productName.equals(that.productName))
917
        return false;
918
    }
919
 
920
    return true;
921
  }
922
 
923
  @Override
924
  public int hashCode() {
925
    return 0;
926
  }
927
 
928
  public int compareTo(Ticket other) {
929
    if (!getClass().equals(other.getClass())) {
930
      return getClass().getName().compareTo(other.getClass().getName());
931
    }
932
 
933
    int lastComparison = 0;
934
    Ticket typedOther = (Ticket)other;
935
 
936
    lastComparison = Boolean.valueOf(isSetId()).compareTo(isSetId());
937
    if (lastComparison != 0) {
938
      return lastComparison;
939
    }
940
    lastComparison = TBaseHelper.compareTo(id, typedOther.id);
941
    if (lastComparison != 0) {
942
      return lastComparison;
943
    }
944
    lastComparison = Boolean.valueOf(isSetCustomerId()).compareTo(isSetCustomerId());
945
    if (lastComparison != 0) {
946
      return lastComparison;
947
    }
948
    lastComparison = TBaseHelper.compareTo(customerId, typedOther.customerId);
949
    if (lastComparison != 0) {
950
      return lastComparison;
951
    }
952
    lastComparison = Boolean.valueOf(isSetOpenDate()).compareTo(isSetOpenDate());
953
    if (lastComparison != 0) {
954
      return lastComparison;
955
    }
956
    lastComparison = TBaseHelper.compareTo(openDate, typedOther.openDate);
957
    if (lastComparison != 0) {
958
      return lastComparison;
959
    }
960
    lastComparison = Boolean.valueOf(isSetCloseDate()).compareTo(isSetCloseDate());
961
    if (lastComparison != 0) {
962
      return lastComparison;
963
    }
964
    lastComparison = TBaseHelper.compareTo(closeDate, typedOther.closeDate);
965
    if (lastComparison != 0) {
966
      return lastComparison;
967
    }
3106 mandeep.dh 968
    lastComparison = Boolean.valueOf(isSetDescription()).compareTo(isSetDescription());
3028 mandeep.dh 969
    if (lastComparison != 0) {
970
      return lastComparison;
971
    }
3106 mandeep.dh 972
    lastComparison = TBaseHelper.compareTo(description, typedOther.description);
3028 mandeep.dh 973
    if (lastComparison != 0) {
974
      return lastComparison;
975
    }
3106 mandeep.dh 976
    lastComparison = Boolean.valueOf(isSetPriority()).compareTo(isSetPriority());
3028 mandeep.dh 977
    if (lastComparison != 0) {
978
      return lastComparison;
979
    }
3106 mandeep.dh 980
    lastComparison = TBaseHelper.compareTo(priority, typedOther.priority);
3028 mandeep.dh 981
    if (lastComparison != 0) {
982
      return lastComparison;
983
    }
3106 mandeep.dh 984
    lastComparison = Boolean.valueOf(isSetCategory()).compareTo(isSetCategory());
3028 mandeep.dh 985
    if (lastComparison != 0) {
986
      return lastComparison;
987
    }
3106 mandeep.dh 988
    lastComparison = TBaseHelper.compareTo(category, typedOther.category);
3028 mandeep.dh 989
    if (lastComparison != 0) {
990
      return lastComparison;
991
    }
3106 mandeep.dh 992
    lastComparison = Boolean.valueOf(isSetStatus()).compareTo(isSetStatus());
993
    if (lastComparison != 0) {
994
      return lastComparison;
995
    }
996
    lastComparison = TBaseHelper.compareTo(status, typedOther.status);
997
    if (lastComparison != 0) {
998
      return lastComparison;
999
    }
1000
    lastComparison = Boolean.valueOf(isSetAssigneeId()).compareTo(isSetAssigneeId());
1001
    if (lastComparison != 0) {
1002
      return lastComparison;
1003
    }
1004
    lastComparison = TBaseHelper.compareTo(assigneeId, typedOther.assigneeId);
1005
    if (lastComparison != 0) {
1006
      return lastComparison;
1007
    }
1008
    lastComparison = Boolean.valueOf(isSetCreatorId()).compareTo(isSetCreatorId());
1009
    if (lastComparison != 0) {
1010
      return lastComparison;
1011
    }
1012
    lastComparison = TBaseHelper.compareTo(creatorId, typedOther.creatorId);
1013
    if (lastComparison != 0) {
1014
      return lastComparison;
1015
    }
3028 mandeep.dh 1016
    lastComparison = Boolean.valueOf(isSetOrderId()).compareTo(isSetOrderId());
1017
    if (lastComparison != 0) {
1018
      return lastComparison;
1019
    }
1020
    lastComparison = TBaseHelper.compareTo(orderId, typedOther.orderId);
1021
    if (lastComparison != 0) {
1022
      return lastComparison;
1023
    }
1024
    lastComparison = Boolean.valueOf(isSetAirwayBillNo()).compareTo(isSetAirwayBillNo());
1025
    if (lastComparison != 0) {
1026
      return lastComparison;
1027
    }
1028
    lastComparison = TBaseHelper.compareTo(airwayBillNo, typedOther.airwayBillNo);
1029
    if (lastComparison != 0) {
1030
      return lastComparison;
1031
    }
1032
    lastComparison = Boolean.valueOf(isSetProductName()).compareTo(isSetProductName());
1033
    if (lastComparison != 0) {
1034
      return lastComparison;
1035
    }
1036
    lastComparison = TBaseHelper.compareTo(productName, typedOther.productName);
1037
    if (lastComparison != 0) {
1038
      return lastComparison;
1039
    }
1040
    return 0;
1041
  }
1042
 
1043
  public void read(TProtocol iprot) throws TException {
1044
    TField field;
1045
    iprot.readStructBegin();
1046
    while (true)
1047
    {
1048
      field = iprot.readFieldBegin();
1049
      if (field.type == TType.STOP) { 
1050
        break;
1051
      }
1052
      _Fields fieldId = _Fields.findByThriftId(field.id);
1053
      if (fieldId == null) {
1054
        TProtocolUtil.skip(iprot, field.type);
1055
      } else {
1056
        switch (fieldId) {
1057
          case ID:
1058
            if (field.type == TType.I64) {
1059
              this.id = iprot.readI64();
1060
              setIdIsSet(true);
1061
            } else { 
1062
              TProtocolUtil.skip(iprot, field.type);
1063
            }
1064
            break;
1065
          case CUSTOMER_ID:
1066
            if (field.type == TType.I64) {
1067
              this.customerId = iprot.readI64();
1068
              setCustomerIdIsSet(true);
1069
            } else { 
1070
              TProtocolUtil.skip(iprot, field.type);
1071
            }
1072
            break;
1073
          case OPEN_DATE:
1074
            if (field.type == TType.I64) {
1075
              this.openDate = iprot.readI64();
1076
              setOpenDateIsSet(true);
1077
            } else { 
1078
              TProtocolUtil.skip(iprot, field.type);
1079
            }
1080
            break;
1081
          case CLOSE_DATE:
1082
            if (field.type == TType.I64) {
1083
              this.closeDate = iprot.readI64();
1084
              setCloseDateIsSet(true);
1085
            } else { 
1086
              TProtocolUtil.skip(iprot, field.type);
1087
            }
1088
            break;
3106 mandeep.dh 1089
          case DESCRIPTION:
3028 mandeep.dh 1090
            if (field.type == TType.STRING) {
3106 mandeep.dh 1091
              this.description = iprot.readString();
3028 mandeep.dh 1092
            } else { 
1093
              TProtocolUtil.skip(iprot, field.type);
1094
            }
1095
            break;
3106 mandeep.dh 1096
          case PRIORITY:
1097
            if (field.type == TType.I32) {
1098
              this.priority = TicketPriority.findByValue(iprot.readI32());
1099
            } else { 
1100
              TProtocolUtil.skip(iprot, field.type);
1101
            }
1102
            break;
1103
          case CATEGORY:
1104
            if (field.type == TType.I32) {
1105
              this.category = TicketCategory.findByValue(iprot.readI32());
1106
            } else { 
1107
              TProtocolUtil.skip(iprot, field.type);
1108
            }
1109
            break;
1110
          case STATUS:
1111
            if (field.type == TType.I32) {
1112
              this.status = TicketStatus.findByValue(iprot.readI32());
1113
            } else { 
1114
              TProtocolUtil.skip(iprot, field.type);
1115
            }
1116
            break;
1117
          case ASSIGNEE_ID:
3028 mandeep.dh 1118
            if (field.type == TType.I64) {
3106 mandeep.dh 1119
              this.assigneeId = iprot.readI64();
1120
              setAssigneeIdIsSet(true);
3028 mandeep.dh 1121
            } else { 
1122
              TProtocolUtil.skip(iprot, field.type);
1123
            }
1124
            break;
3106 mandeep.dh 1125
          case CREATOR_ID:
3028 mandeep.dh 1126
            if (field.type == TType.I64) {
3106 mandeep.dh 1127
              this.creatorId = iprot.readI64();
1128
              setCreatorIdIsSet(true);
3028 mandeep.dh 1129
            } else { 
1130
              TProtocolUtil.skip(iprot, field.type);
1131
            }
1132
            break;
1133
          case ORDER_ID:
1134
            if (field.type == TType.I64) {
1135
              this.orderId = iprot.readI64();
1136
              setOrderIdIsSet(true);
1137
            } else { 
1138
              TProtocolUtil.skip(iprot, field.type);
1139
            }
1140
            break;
1141
          case AIRWAY_BILL_NO:
1142
            if (field.type == TType.STRING) {
1143
              this.airwayBillNo = iprot.readString();
1144
            } else { 
1145
              TProtocolUtil.skip(iprot, field.type);
1146
            }
1147
            break;
1148
          case PRODUCT_NAME:
1149
            if (field.type == TType.STRING) {
1150
              this.productName = iprot.readString();
1151
            } else { 
1152
              TProtocolUtil.skip(iprot, field.type);
1153
            }
1154
            break;
1155
        }
1156
        iprot.readFieldEnd();
1157
      }
1158
    }
1159
    iprot.readStructEnd();
1160
    validate();
1161
  }
1162
 
1163
  public void write(TProtocol oprot) throws TException {
1164
    validate();
1165
 
1166
    oprot.writeStructBegin(STRUCT_DESC);
1167
    oprot.writeFieldBegin(ID_FIELD_DESC);
1168
    oprot.writeI64(this.id);
1169
    oprot.writeFieldEnd();
1170
    oprot.writeFieldBegin(CUSTOMER_ID_FIELD_DESC);
1171
    oprot.writeI64(this.customerId);
1172
    oprot.writeFieldEnd();
1173
    oprot.writeFieldBegin(OPEN_DATE_FIELD_DESC);
1174
    oprot.writeI64(this.openDate);
1175
    oprot.writeFieldEnd();
1176
    oprot.writeFieldBegin(CLOSE_DATE_FIELD_DESC);
1177
    oprot.writeI64(this.closeDate);
1178
    oprot.writeFieldEnd();
3106 mandeep.dh 1179
    if (this.description != null) {
1180
      oprot.writeFieldBegin(DESCRIPTION_FIELD_DESC);
1181
      oprot.writeString(this.description);
3028 mandeep.dh 1182
      oprot.writeFieldEnd();
1183
    }
3106 mandeep.dh 1184
    if (this.priority != null) {
1185
      oprot.writeFieldBegin(PRIORITY_FIELD_DESC);
1186
      oprot.writeI32(this.priority.getValue());
1187
      oprot.writeFieldEnd();
1188
    }
1189
    if (this.category != null) {
1190
      oprot.writeFieldBegin(CATEGORY_FIELD_DESC);
1191
      oprot.writeI32(this.category.getValue());
1192
      oprot.writeFieldEnd();
1193
    }
1194
    if (this.status != null) {
1195
      oprot.writeFieldBegin(STATUS_FIELD_DESC);
1196
      oprot.writeI32(this.status.getValue());
1197
      oprot.writeFieldEnd();
1198
    }
1199
    oprot.writeFieldBegin(ASSIGNEE_ID_FIELD_DESC);
1200
    oprot.writeI64(this.assigneeId);
1201
    oprot.writeFieldEnd();
3028 mandeep.dh 1202
    oprot.writeFieldBegin(CREATOR_ID_FIELD_DESC);
1203
    oprot.writeI64(this.creatorId);
1204
    oprot.writeFieldEnd();
1205
    oprot.writeFieldBegin(ORDER_ID_FIELD_DESC);
1206
    oprot.writeI64(this.orderId);
1207
    oprot.writeFieldEnd();
1208
    if (this.airwayBillNo != null) {
1209
      oprot.writeFieldBegin(AIRWAY_BILL_NO_FIELD_DESC);
1210
      oprot.writeString(this.airwayBillNo);
1211
      oprot.writeFieldEnd();
1212
    }
1213
    if (this.productName != null) {
1214
      oprot.writeFieldBegin(PRODUCT_NAME_FIELD_DESC);
1215
      oprot.writeString(this.productName);
1216
      oprot.writeFieldEnd();
1217
    }
1218
    oprot.writeFieldStop();
1219
    oprot.writeStructEnd();
1220
  }
1221
 
1222
  @Override
1223
  public String toString() {
1224
    StringBuilder sb = new StringBuilder("Ticket(");
1225
    boolean first = true;
1226
 
1227
    sb.append("id:");
1228
    sb.append(this.id);
1229
    first = false;
1230
    if (!first) sb.append(", ");
1231
    sb.append("customerId:");
1232
    sb.append(this.customerId);
1233
    first = false;
1234
    if (!first) sb.append(", ");
1235
    sb.append("openDate:");
1236
    sb.append(this.openDate);
1237
    first = false;
1238
    if (!first) sb.append(", ");
1239
    sb.append("closeDate:");
1240
    sb.append(this.closeDate);
1241
    first = false;
1242
    if (!first) sb.append(", ");
3106 mandeep.dh 1243
    sb.append("description:");
1244
    if (this.description == null) {
3028 mandeep.dh 1245
      sb.append("null");
1246
    } else {
3106 mandeep.dh 1247
      sb.append(this.description);
3028 mandeep.dh 1248
    }
1249
    first = false;
1250
    if (!first) sb.append(", ");
3106 mandeep.dh 1251
    sb.append("priority:");
1252
    if (this.priority == null) {
1253
      sb.append("null");
1254
    } else {
1255
      String priority_name = priority.name();
1256
      if (priority_name != null) {
1257
        sb.append(priority_name);
1258
        sb.append(" (");
1259
      }
1260
      sb.append(this.priority);
1261
      if (priority_name != null) {
1262
        sb.append(")");
1263
      }
1264
    }
1265
    first = false;
1266
    if (!first) sb.append(", ");
1267
    sb.append("category:");
1268
    if (this.category == null) {
1269
      sb.append("null");
1270
    } else {
1271
      String category_name = category.name();
1272
      if (category_name != null) {
1273
        sb.append(category_name);
1274
        sb.append(" (");
1275
      }
1276
      sb.append(this.category);
1277
      if (category_name != null) {
1278
        sb.append(")");
1279
      }
1280
    }
1281
    first = false;
1282
    if (!first) sb.append(", ");
1283
    sb.append("status:");
1284
    if (this.status == null) {
1285
      sb.append("null");
1286
    } else {
1287
      String status_name = status.name();
1288
      if (status_name != null) {
1289
        sb.append(status_name);
1290
        sb.append(" (");
1291
      }
1292
      sb.append(this.status);
1293
      if (status_name != null) {
1294
        sb.append(")");
1295
      }
1296
    }
1297
    first = false;
1298
    if (!first) sb.append(", ");
1299
    sb.append("assigneeId:");
1300
    sb.append(this.assigneeId);
1301
    first = false;
1302
    if (!first) sb.append(", ");
3028 mandeep.dh 1303
    sb.append("creatorId:");
1304
    sb.append(this.creatorId);
1305
    first = false;
1306
    if (!first) sb.append(", ");
1307
    sb.append("orderId:");
1308
    sb.append(this.orderId);
1309
    first = false;
1310
    if (!first) sb.append(", ");
1311
    sb.append("airwayBillNo:");
1312
    if (this.airwayBillNo == null) {
1313
      sb.append("null");
1314
    } else {
1315
      sb.append(this.airwayBillNo);
1316
    }
1317
    first = false;
1318
    if (!first) sb.append(", ");
1319
    sb.append("productName:");
1320
    if (this.productName == null) {
1321
      sb.append("null");
1322
    } else {
1323
      sb.append(this.productName);
1324
    }
1325
    first = false;
1326
    sb.append(")");
1327
    return sb.toString();
1328
  }
1329
 
1330
  public void validate() throws TException {
1331
    // check for required fields
1332
  }
1333
 
1334
}
1335