Subversion Repositories SmartDukaan

Rev

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

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