Subversion Repositories SmartDukaan

Rev

Rev 1302 | Details | Compare with Previous | Last modification | View Log | RSS feed

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