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