Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
12691 manish.sha 1
/**
2
 * Autogenerated by Thrift Compiler (0.7.0)
3
 *
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
 */
6
package in.shop2020.utils;
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.nio.ByteBuffer;
19
import java.util.Arrays;
20
import org.slf4j.Logger;
21
import org.slf4j.LoggerFactory;
22
 
23
public class UserSms implements org.apache.thrift.TBase<UserSms, UserSms._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("UserSms");
25
 
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("user_id", org.apache.thrift.protocol.TType.I64, (short)2);
28
  private static final org.apache.thrift.protocol.TField MOBILE_NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("mobileNumber", org.apache.thrift.protocol.TType.STRING, (short)3);
29
  private static final org.apache.thrift.protocol.TField SMS_TEXT_FIELD_DESC = new org.apache.thrift.protocol.TField("smsText", org.apache.thrift.protocol.TType.STRING, (short)4);
30
  private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)5);
31
  private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.I32, (short)6);
32
  private static final org.apache.thrift.protocol.TField ATTEMPTS_FIELD_DESC = new org.apache.thrift.protocol.TField("attempts", org.apache.thrift.protocol.TType.I64, (short)7);
33
  private static final org.apache.thrift.protocol.TField CREATED_TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("createdTimestamp", org.apache.thrift.protocol.TType.I64, (short)8);
34
  private static final org.apache.thrift.protocol.TField RESPONSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("responseId", org.apache.thrift.protocol.TType.STRING, (short)9);
35
  private static final org.apache.thrift.protocol.TField RESPONSE_TEXT_FIELD_DESC = new org.apache.thrift.protocol.TField("responseText", org.apache.thrift.protocol.TType.STRING, (short)10);
36
  private static final org.apache.thrift.protocol.TField DELIVERY_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("deliveryStatus", org.apache.thrift.protocol.TType.I32, (short)11);
37
 
38
  private long id; // required
39
  private long user_id; // required
40
  private String mobileNumber; // required
41
  private String smsText; // required
42
  private SmsType type; // required
43
  private SmsStatus status; // required
44
  private long attempts; // required
45
  private long createdTimestamp; // required
46
  private String responseId; // required
47
  private String responseText; // required
48
  private SmsDeliveryStatus deliveryStatus; // required
49
 
50
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
51
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
52
    ID((short)1, "id"),
53
    USER_ID((short)2, "user_id"),
54
    MOBILE_NUMBER((short)3, "mobileNumber"),
55
    SMS_TEXT((short)4, "smsText"),
56
    /**
57
     * 
58
     * @see SmsType
59
     */
60
    TYPE((short)5, "type"),
61
    /**
62
     * 
63
     * @see SmsStatus
64
     */
65
    STATUS((short)6, "status"),
66
    ATTEMPTS((short)7, "attempts"),
67
    CREATED_TIMESTAMP((short)8, "createdTimestamp"),
68
    RESPONSE_ID((short)9, "responseId"),
69
    RESPONSE_TEXT((short)10, "responseText"),
70
    /**
71
     * 
72
     * @see SmsDeliveryStatus
73
     */
74
    DELIVERY_STATUS((short)11, "deliveryStatus");
75
 
76
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
77
 
78
    static {
79
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
80
        byName.put(field.getFieldName(), field);
81
      }
82
    }
83
 
84
    /**
85
     * Find the _Fields constant that matches fieldId, or null if its not found.
86
     */
87
    public static _Fields findByThriftId(int fieldId) {
88
      switch(fieldId) {
89
        case 1: // ID
90
          return ID;
91
        case 2: // USER_ID
92
          return USER_ID;
93
        case 3: // MOBILE_NUMBER
94
          return MOBILE_NUMBER;
95
        case 4: // SMS_TEXT
96
          return SMS_TEXT;
97
        case 5: // TYPE
98
          return TYPE;
99
        case 6: // STATUS
100
          return STATUS;
101
        case 7: // ATTEMPTS
102
          return ATTEMPTS;
103
        case 8: // CREATED_TIMESTAMP
104
          return CREATED_TIMESTAMP;
105
        case 9: // RESPONSE_ID
106
          return RESPONSE_ID;
107
        case 10: // RESPONSE_TEXT
108
          return RESPONSE_TEXT;
109
        case 11: // DELIVERY_STATUS
110
          return DELIVERY_STATUS;
111
        default:
112
          return null;
113
      }
114
    }
115
 
116
    /**
117
     * Find the _Fields constant that matches fieldId, throwing an exception
118
     * if it is not found.
119
     */
120
    public static _Fields findByThriftIdOrThrow(int fieldId) {
121
      _Fields fields = findByThriftId(fieldId);
122
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
123
      return fields;
124
    }
125
 
126
    /**
127
     * Find the _Fields constant that matches name, or null if its not found.
128
     */
129
    public static _Fields findByName(String name) {
130
      return byName.get(name);
131
    }
132
 
133
    private final short _thriftId;
134
    private final String _fieldName;
135
 
136
    _Fields(short thriftId, String fieldName) {
137
      _thriftId = thriftId;
138
      _fieldName = fieldName;
139
    }
140
 
141
    public short getThriftFieldId() {
142
      return _thriftId;
143
    }
144
 
145
    public String getFieldName() {
146
      return _fieldName;
147
    }
148
  }
149
 
150
  // isset id assignments
151
  private static final int __ID_ISSET_ID = 0;
152
  private static final int __USER_ID_ISSET_ID = 1;
153
  private static final int __ATTEMPTS_ISSET_ID = 2;
154
  private static final int __CREATEDTIMESTAMP_ISSET_ID = 3;
155
  private BitSet __isset_bit_vector = new BitSet(4);
156
 
157
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
158
  static {
159
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
160
    tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
161
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
162
    tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("user_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
163
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
164
    tmpMap.put(_Fields.MOBILE_NUMBER, new org.apache.thrift.meta_data.FieldMetaData("mobileNumber", org.apache.thrift.TFieldRequirementType.DEFAULT, 
165
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
166
    tmpMap.put(_Fields.SMS_TEXT, new org.apache.thrift.meta_data.FieldMetaData("smsText", org.apache.thrift.TFieldRequirementType.DEFAULT, 
167
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
168
    tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.DEFAULT, 
169
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, SmsType.class)));
170
    tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.DEFAULT, 
171
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, SmsStatus.class)));
172
    tmpMap.put(_Fields.ATTEMPTS, new org.apache.thrift.meta_data.FieldMetaData("attempts", org.apache.thrift.TFieldRequirementType.DEFAULT, 
173
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
174
    tmpMap.put(_Fields.CREATED_TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("createdTimestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, 
175
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
176
    tmpMap.put(_Fields.RESPONSE_ID, new org.apache.thrift.meta_data.FieldMetaData("responseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
177
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
178
    tmpMap.put(_Fields.RESPONSE_TEXT, new org.apache.thrift.meta_data.FieldMetaData("responseText", org.apache.thrift.TFieldRequirementType.DEFAULT, 
179
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
180
    tmpMap.put(_Fields.DELIVERY_STATUS, new org.apache.thrift.meta_data.FieldMetaData("deliveryStatus", org.apache.thrift.TFieldRequirementType.DEFAULT, 
181
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, SmsDeliveryStatus.class)));
182
    metaDataMap = Collections.unmodifiableMap(tmpMap);
183
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(UserSms.class, metaDataMap);
184
  }
185
 
186
  public UserSms() {
187
  }
188
 
189
  public UserSms(
190
    long id,
191
    long user_id,
192
    String mobileNumber,
193
    String smsText,
194
    SmsType type,
195
    SmsStatus status,
196
    long attempts,
197
    long createdTimestamp,
198
    String responseId,
199
    String responseText,
200
    SmsDeliveryStatus deliveryStatus)
201
  {
202
    this();
203
    this.id = id;
204
    setIdIsSet(true);
205
    this.user_id = user_id;
206
    setUser_idIsSet(true);
207
    this.mobileNumber = mobileNumber;
208
    this.smsText = smsText;
209
    this.type = type;
210
    this.status = status;
211
    this.attempts = attempts;
212
    setAttemptsIsSet(true);
213
    this.createdTimestamp = createdTimestamp;
214
    setCreatedTimestampIsSet(true);
215
    this.responseId = responseId;
216
    this.responseText = responseText;
217
    this.deliveryStatus = deliveryStatus;
218
  }
219
 
220
  /**
221
   * Performs a deep copy on <i>other</i>.
222
   */
223
  public UserSms(UserSms other) {
224
    __isset_bit_vector.clear();
225
    __isset_bit_vector.or(other.__isset_bit_vector);
226
    this.id = other.id;
227
    this.user_id = other.user_id;
228
    if (other.isSetMobileNumber()) {
229
      this.mobileNumber = other.mobileNumber;
230
    }
231
    if (other.isSetSmsText()) {
232
      this.smsText = other.smsText;
233
    }
234
    if (other.isSetType()) {
235
      this.type = other.type;
236
    }
237
    if (other.isSetStatus()) {
238
      this.status = other.status;
239
    }
240
    this.attempts = other.attempts;
241
    this.createdTimestamp = other.createdTimestamp;
242
    if (other.isSetResponseId()) {
243
      this.responseId = other.responseId;
244
    }
245
    if (other.isSetResponseText()) {
246
      this.responseText = other.responseText;
247
    }
248
    if (other.isSetDeliveryStatus()) {
249
      this.deliveryStatus = other.deliveryStatus;
250
    }
251
  }
252
 
253
  public UserSms deepCopy() {
254
    return new UserSms(this);
255
  }
256
 
257
  @Override
258
  public void clear() {
259
    setIdIsSet(false);
260
    this.id = 0;
261
    setUser_idIsSet(false);
262
    this.user_id = 0;
263
    this.mobileNumber = null;
264
    this.smsText = null;
265
    this.type = null;
266
    this.status = null;
267
    setAttemptsIsSet(false);
268
    this.attempts = 0;
269
    setCreatedTimestampIsSet(false);
270
    this.createdTimestamp = 0;
271
    this.responseId = null;
272
    this.responseText = null;
273
    this.deliveryStatus = null;
274
  }
275
 
276
  public long getId() {
277
    return this.id;
278
  }
279
 
280
  public void setId(long id) {
281
    this.id = id;
282
    setIdIsSet(true);
283
  }
284
 
285
  public void unsetId() {
286
    __isset_bit_vector.clear(__ID_ISSET_ID);
287
  }
288
 
289
  /** Returns true if field id is set (has been assigned a value) and false otherwise */
290
  public boolean isSetId() {
291
    return __isset_bit_vector.get(__ID_ISSET_ID);
292
  }
293
 
294
  public void setIdIsSet(boolean value) {
295
    __isset_bit_vector.set(__ID_ISSET_ID, value);
296
  }
297
 
298
  public long getUser_id() {
299
    return this.user_id;
300
  }
301
 
302
  public void setUser_id(long user_id) {
303
    this.user_id = user_id;
304
    setUser_idIsSet(true);
305
  }
306
 
307
  public void unsetUser_id() {
308
    __isset_bit_vector.clear(__USER_ID_ISSET_ID);
309
  }
310
 
311
  /** Returns true if field user_id is set (has been assigned a value) and false otherwise */
312
  public boolean isSetUser_id() {
313
    return __isset_bit_vector.get(__USER_ID_ISSET_ID);
314
  }
315
 
316
  public void setUser_idIsSet(boolean value) {
317
    __isset_bit_vector.set(__USER_ID_ISSET_ID, value);
318
  }
319
 
320
  public String getMobileNumber() {
321
    return this.mobileNumber;
322
  }
323
 
324
  public void setMobileNumber(String mobileNumber) {
325
    this.mobileNumber = mobileNumber;
326
  }
327
 
328
  public void unsetMobileNumber() {
329
    this.mobileNumber = null;
330
  }
331
 
332
  /** Returns true if field mobileNumber is set (has been assigned a value) and false otherwise */
333
  public boolean isSetMobileNumber() {
334
    return this.mobileNumber != null;
335
  }
336
 
337
  public void setMobileNumberIsSet(boolean value) {
338
    if (!value) {
339
      this.mobileNumber = null;
340
    }
341
  }
342
 
343
  public String getSmsText() {
344
    return this.smsText;
345
  }
346
 
347
  public void setSmsText(String smsText) {
348
    this.smsText = smsText;
349
  }
350
 
351
  public void unsetSmsText() {
352
    this.smsText = null;
353
  }
354
 
355
  /** Returns true if field smsText is set (has been assigned a value) and false otherwise */
356
  public boolean isSetSmsText() {
357
    return this.smsText != null;
358
  }
359
 
360
  public void setSmsTextIsSet(boolean value) {
361
    if (!value) {
362
      this.smsText = null;
363
    }
364
  }
365
 
366
  /**
367
   * 
368
   * @see SmsType
369
   */
370
  public SmsType getType() {
371
    return this.type;
372
  }
373
 
374
  /**
375
   * 
376
   * @see SmsType
377
   */
378
  public void setType(SmsType type) {
379
    this.type = type;
380
  }
381
 
382
  public void unsetType() {
383
    this.type = null;
384
  }
385
 
386
  /** Returns true if field type is set (has been assigned a value) and false otherwise */
387
  public boolean isSetType() {
388
    return this.type != null;
389
  }
390
 
391
  public void setTypeIsSet(boolean value) {
392
    if (!value) {
393
      this.type = null;
394
    }
395
  }
396
 
397
  /**
398
   * 
399
   * @see SmsStatus
400
   */
401
  public SmsStatus getStatus() {
402
    return this.status;
403
  }
404
 
405
  /**
406
   * 
407
   * @see SmsStatus
408
   */
409
  public void setStatus(SmsStatus status) {
410
    this.status = status;
411
  }
412
 
413
  public void unsetStatus() {
414
    this.status = null;
415
  }
416
 
417
  /** Returns true if field status is set (has been assigned a value) and false otherwise */
418
  public boolean isSetStatus() {
419
    return this.status != null;
420
  }
421
 
422
  public void setStatusIsSet(boolean value) {
423
    if (!value) {
424
      this.status = null;
425
    }
426
  }
427
 
428
  public long getAttempts() {
429
    return this.attempts;
430
  }
431
 
432
  public void setAttempts(long attempts) {
433
    this.attempts = attempts;
434
    setAttemptsIsSet(true);
435
  }
436
 
437
  public void unsetAttempts() {
438
    __isset_bit_vector.clear(__ATTEMPTS_ISSET_ID);
439
  }
440
 
441
  /** Returns true if field attempts is set (has been assigned a value) and false otherwise */
442
  public boolean isSetAttempts() {
443
    return __isset_bit_vector.get(__ATTEMPTS_ISSET_ID);
444
  }
445
 
446
  public void setAttemptsIsSet(boolean value) {
447
    __isset_bit_vector.set(__ATTEMPTS_ISSET_ID, value);
448
  }
449
 
450
  public long getCreatedTimestamp() {
451
    return this.createdTimestamp;
452
  }
453
 
454
  public void setCreatedTimestamp(long createdTimestamp) {
455
    this.createdTimestamp = createdTimestamp;
456
    setCreatedTimestampIsSet(true);
457
  }
458
 
459
  public void unsetCreatedTimestamp() {
460
    __isset_bit_vector.clear(__CREATEDTIMESTAMP_ISSET_ID);
461
  }
462
 
463
  /** Returns true if field createdTimestamp is set (has been assigned a value) and false otherwise */
464
  public boolean isSetCreatedTimestamp() {
465
    return __isset_bit_vector.get(__CREATEDTIMESTAMP_ISSET_ID);
466
  }
467
 
468
  public void setCreatedTimestampIsSet(boolean value) {
469
    __isset_bit_vector.set(__CREATEDTIMESTAMP_ISSET_ID, value);
470
  }
471
 
472
  public String getResponseId() {
473
    return this.responseId;
474
  }
475
 
476
  public void setResponseId(String responseId) {
477
    this.responseId = responseId;
478
  }
479
 
480
  public void unsetResponseId() {
481
    this.responseId = null;
482
  }
483
 
484
  /** Returns true if field responseId is set (has been assigned a value) and false otherwise */
485
  public boolean isSetResponseId() {
486
    return this.responseId != null;
487
  }
488
 
489
  public void setResponseIdIsSet(boolean value) {
490
    if (!value) {
491
      this.responseId = null;
492
    }
493
  }
494
 
495
  public String getResponseText() {
496
    return this.responseText;
497
  }
498
 
499
  public void setResponseText(String responseText) {
500
    this.responseText = responseText;
501
  }
502
 
503
  public void unsetResponseText() {
504
    this.responseText = null;
505
  }
506
 
507
  /** Returns true if field responseText is set (has been assigned a value) and false otherwise */
508
  public boolean isSetResponseText() {
509
    return this.responseText != null;
510
  }
511
 
512
  public void setResponseTextIsSet(boolean value) {
513
    if (!value) {
514
      this.responseText = null;
515
    }
516
  }
517
 
518
  /**
519
   * 
520
   * @see SmsDeliveryStatus
521
   */
522
  public SmsDeliveryStatus getDeliveryStatus() {
523
    return this.deliveryStatus;
524
  }
525
 
526
  /**
527
   * 
528
   * @see SmsDeliveryStatus
529
   */
530
  public void setDeliveryStatus(SmsDeliveryStatus deliveryStatus) {
531
    this.deliveryStatus = deliveryStatus;
532
  }
533
 
534
  public void unsetDeliveryStatus() {
535
    this.deliveryStatus = null;
536
  }
537
 
538
  /** Returns true if field deliveryStatus is set (has been assigned a value) and false otherwise */
539
  public boolean isSetDeliveryStatus() {
540
    return this.deliveryStatus != null;
541
  }
542
 
543
  public void setDeliveryStatusIsSet(boolean value) {
544
    if (!value) {
545
      this.deliveryStatus = null;
546
    }
547
  }
548
 
549
  public void setFieldValue(_Fields field, Object value) {
550
    switch (field) {
551
    case ID:
552
      if (value == null) {
553
        unsetId();
554
      } else {
555
        setId((Long)value);
556
      }
557
      break;
558
 
559
    case USER_ID:
560
      if (value == null) {
561
        unsetUser_id();
562
      } else {
563
        setUser_id((Long)value);
564
      }
565
      break;
566
 
567
    case MOBILE_NUMBER:
568
      if (value == null) {
569
        unsetMobileNumber();
570
      } else {
571
        setMobileNumber((String)value);
572
      }
573
      break;
574
 
575
    case SMS_TEXT:
576
      if (value == null) {
577
        unsetSmsText();
578
      } else {
579
        setSmsText((String)value);
580
      }
581
      break;
582
 
583
    case TYPE:
584
      if (value == null) {
585
        unsetType();
586
      } else {
587
        setType((SmsType)value);
588
      }
589
      break;
590
 
591
    case STATUS:
592
      if (value == null) {
593
        unsetStatus();
594
      } else {
595
        setStatus((SmsStatus)value);
596
      }
597
      break;
598
 
599
    case ATTEMPTS:
600
      if (value == null) {
601
        unsetAttempts();
602
      } else {
603
        setAttempts((Long)value);
604
      }
605
      break;
606
 
607
    case CREATED_TIMESTAMP:
608
      if (value == null) {
609
        unsetCreatedTimestamp();
610
      } else {
611
        setCreatedTimestamp((Long)value);
612
      }
613
      break;
614
 
615
    case RESPONSE_ID:
616
      if (value == null) {
617
        unsetResponseId();
618
      } else {
619
        setResponseId((String)value);
620
      }
621
      break;
622
 
623
    case RESPONSE_TEXT:
624
      if (value == null) {
625
        unsetResponseText();
626
      } else {
627
        setResponseText((String)value);
628
      }
629
      break;
630
 
631
    case DELIVERY_STATUS:
632
      if (value == null) {
633
        unsetDeliveryStatus();
634
      } else {
635
        setDeliveryStatus((SmsDeliveryStatus)value);
636
      }
637
      break;
638
 
639
    }
640
  }
641
 
642
  public Object getFieldValue(_Fields field) {
643
    switch (field) {
644
    case ID:
645
      return Long.valueOf(getId());
646
 
647
    case USER_ID:
648
      return Long.valueOf(getUser_id());
649
 
650
    case MOBILE_NUMBER:
651
      return getMobileNumber();
652
 
653
    case SMS_TEXT:
654
      return getSmsText();
655
 
656
    case TYPE:
657
      return getType();
658
 
659
    case STATUS:
660
      return getStatus();
661
 
662
    case ATTEMPTS:
663
      return Long.valueOf(getAttempts());
664
 
665
    case CREATED_TIMESTAMP:
666
      return Long.valueOf(getCreatedTimestamp());
667
 
668
    case RESPONSE_ID:
669
      return getResponseId();
670
 
671
    case RESPONSE_TEXT:
672
      return getResponseText();
673
 
674
    case DELIVERY_STATUS:
675
      return getDeliveryStatus();
676
 
677
    }
678
    throw new IllegalStateException();
679
  }
680
 
681
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
682
  public boolean isSet(_Fields field) {
683
    if (field == null) {
684
      throw new IllegalArgumentException();
685
    }
686
 
687
    switch (field) {
688
    case ID:
689
      return isSetId();
690
    case USER_ID:
691
      return isSetUser_id();
692
    case MOBILE_NUMBER:
693
      return isSetMobileNumber();
694
    case SMS_TEXT:
695
      return isSetSmsText();
696
    case TYPE:
697
      return isSetType();
698
    case STATUS:
699
      return isSetStatus();
700
    case ATTEMPTS:
701
      return isSetAttempts();
702
    case CREATED_TIMESTAMP:
703
      return isSetCreatedTimestamp();
704
    case RESPONSE_ID:
705
      return isSetResponseId();
706
    case RESPONSE_TEXT:
707
      return isSetResponseText();
708
    case DELIVERY_STATUS:
709
      return isSetDeliveryStatus();
710
    }
711
    throw new IllegalStateException();
712
  }
713
 
714
  @Override
715
  public boolean equals(Object that) {
716
    if (that == null)
717
      return false;
718
    if (that instanceof UserSms)
719
      return this.equals((UserSms)that);
720
    return false;
721
  }
722
 
723
  public boolean equals(UserSms that) {
724
    if (that == null)
725
      return false;
726
 
727
    boolean this_present_id = true;
728
    boolean that_present_id = true;
729
    if (this_present_id || that_present_id) {
730
      if (!(this_present_id && that_present_id))
731
        return false;
732
      if (this.id != that.id)
733
        return false;
734
    }
735
 
736
    boolean this_present_user_id = true;
737
    boolean that_present_user_id = true;
738
    if (this_present_user_id || that_present_user_id) {
739
      if (!(this_present_user_id && that_present_user_id))
740
        return false;
741
      if (this.user_id != that.user_id)
742
        return false;
743
    }
744
 
745
    boolean this_present_mobileNumber = true && this.isSetMobileNumber();
746
    boolean that_present_mobileNumber = true && that.isSetMobileNumber();
747
    if (this_present_mobileNumber || that_present_mobileNumber) {
748
      if (!(this_present_mobileNumber && that_present_mobileNumber))
749
        return false;
750
      if (!this.mobileNumber.equals(that.mobileNumber))
751
        return false;
752
    }
753
 
754
    boolean this_present_smsText = true && this.isSetSmsText();
755
    boolean that_present_smsText = true && that.isSetSmsText();
756
    if (this_present_smsText || that_present_smsText) {
757
      if (!(this_present_smsText && that_present_smsText))
758
        return false;
759
      if (!this.smsText.equals(that.smsText))
760
        return false;
761
    }
762
 
763
    boolean this_present_type = true && this.isSetType();
764
    boolean that_present_type = true && that.isSetType();
765
    if (this_present_type || that_present_type) {
766
      if (!(this_present_type && that_present_type))
767
        return false;
768
      if (!this.type.equals(that.type))
769
        return false;
770
    }
771
 
772
    boolean this_present_status = true && this.isSetStatus();
773
    boolean that_present_status = true && that.isSetStatus();
774
    if (this_present_status || that_present_status) {
775
      if (!(this_present_status && that_present_status))
776
        return false;
777
      if (!this.status.equals(that.status))
778
        return false;
779
    }
780
 
781
    boolean this_present_attempts = true;
782
    boolean that_present_attempts = true;
783
    if (this_present_attempts || that_present_attempts) {
784
      if (!(this_present_attempts && that_present_attempts))
785
        return false;
786
      if (this.attempts != that.attempts)
787
        return false;
788
    }
789
 
790
    boolean this_present_createdTimestamp = true;
791
    boolean that_present_createdTimestamp = true;
792
    if (this_present_createdTimestamp || that_present_createdTimestamp) {
793
      if (!(this_present_createdTimestamp && that_present_createdTimestamp))
794
        return false;
795
      if (this.createdTimestamp != that.createdTimestamp)
796
        return false;
797
    }
798
 
799
    boolean this_present_responseId = true && this.isSetResponseId();
800
    boolean that_present_responseId = true && that.isSetResponseId();
801
    if (this_present_responseId || that_present_responseId) {
802
      if (!(this_present_responseId && that_present_responseId))
803
        return false;
804
      if (!this.responseId.equals(that.responseId))
805
        return false;
806
    }
807
 
808
    boolean this_present_responseText = true && this.isSetResponseText();
809
    boolean that_present_responseText = true && that.isSetResponseText();
810
    if (this_present_responseText || that_present_responseText) {
811
      if (!(this_present_responseText && that_present_responseText))
812
        return false;
813
      if (!this.responseText.equals(that.responseText))
814
        return false;
815
    }
816
 
817
    boolean this_present_deliveryStatus = true && this.isSetDeliveryStatus();
818
    boolean that_present_deliveryStatus = true && that.isSetDeliveryStatus();
819
    if (this_present_deliveryStatus || that_present_deliveryStatus) {
820
      if (!(this_present_deliveryStatus && that_present_deliveryStatus))
821
        return false;
822
      if (!this.deliveryStatus.equals(that.deliveryStatus))
823
        return false;
824
    }
825
 
826
    return true;
827
  }
828
 
829
  @Override
830
  public int hashCode() {
831
    return 0;
832
  }
833
 
834
  public int compareTo(UserSms other) {
835
    if (!getClass().equals(other.getClass())) {
836
      return getClass().getName().compareTo(other.getClass().getName());
837
    }
838
 
839
    int lastComparison = 0;
840
    UserSms typedOther = (UserSms)other;
841
 
842
    lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
843
    if (lastComparison != 0) {
844
      return lastComparison;
845
    }
846
    if (isSetId()) {
847
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
848
      if (lastComparison != 0) {
849
        return lastComparison;
850
      }
851
    }
852
    lastComparison = Boolean.valueOf(isSetUser_id()).compareTo(typedOther.isSetUser_id());
853
    if (lastComparison != 0) {
854
      return lastComparison;
855
    }
856
    if (isSetUser_id()) {
857
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.user_id, typedOther.user_id);
858
      if (lastComparison != 0) {
859
        return lastComparison;
860
      }
861
    }
862
    lastComparison = Boolean.valueOf(isSetMobileNumber()).compareTo(typedOther.isSetMobileNumber());
863
    if (lastComparison != 0) {
864
      return lastComparison;
865
    }
866
    if (isSetMobileNumber()) {
867
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mobileNumber, typedOther.mobileNumber);
868
      if (lastComparison != 0) {
869
        return lastComparison;
870
      }
871
    }
872
    lastComparison = Boolean.valueOf(isSetSmsText()).compareTo(typedOther.isSetSmsText());
873
    if (lastComparison != 0) {
874
      return lastComparison;
875
    }
876
    if (isSetSmsText()) {
877
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.smsText, typedOther.smsText);
878
      if (lastComparison != 0) {
879
        return lastComparison;
880
      }
881
    }
882
    lastComparison = Boolean.valueOf(isSetType()).compareTo(typedOther.isSetType());
883
    if (lastComparison != 0) {
884
      return lastComparison;
885
    }
886
    if (isSetType()) {
887
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, typedOther.type);
888
      if (lastComparison != 0) {
889
        return lastComparison;
890
      }
891
    }
892
    lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus());
893
    if (lastComparison != 0) {
894
      return lastComparison;
895
    }
896
    if (isSetStatus()) {
897
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status);
898
      if (lastComparison != 0) {
899
        return lastComparison;
900
      }
901
    }
902
    lastComparison = Boolean.valueOf(isSetAttempts()).compareTo(typedOther.isSetAttempts());
903
    if (lastComparison != 0) {
904
      return lastComparison;
905
    }
906
    if (isSetAttempts()) {
907
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.attempts, typedOther.attempts);
908
      if (lastComparison != 0) {
909
        return lastComparison;
910
      }
911
    }
912
    lastComparison = Boolean.valueOf(isSetCreatedTimestamp()).compareTo(typedOther.isSetCreatedTimestamp());
913
    if (lastComparison != 0) {
914
      return lastComparison;
915
    }
916
    if (isSetCreatedTimestamp()) {
917
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.createdTimestamp, typedOther.createdTimestamp);
918
      if (lastComparison != 0) {
919
        return lastComparison;
920
      }
921
    }
922
    lastComparison = Boolean.valueOf(isSetResponseId()).compareTo(typedOther.isSetResponseId());
923
    if (lastComparison != 0) {
924
      return lastComparison;
925
    }
926
    if (isSetResponseId()) {
927
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.responseId, typedOther.responseId);
928
      if (lastComparison != 0) {
929
        return lastComparison;
930
      }
931
    }
932
    lastComparison = Boolean.valueOf(isSetResponseText()).compareTo(typedOther.isSetResponseText());
933
    if (lastComparison != 0) {
934
      return lastComparison;
935
    }
936
    if (isSetResponseText()) {
937
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.responseText, typedOther.responseText);
938
      if (lastComparison != 0) {
939
        return lastComparison;
940
      }
941
    }
942
    lastComparison = Boolean.valueOf(isSetDeliveryStatus()).compareTo(typedOther.isSetDeliveryStatus());
943
    if (lastComparison != 0) {
944
      return lastComparison;
945
    }
946
    if (isSetDeliveryStatus()) {
947
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.deliveryStatus, typedOther.deliveryStatus);
948
      if (lastComparison != 0) {
949
        return lastComparison;
950
      }
951
    }
952
    return 0;
953
  }
954
 
955
  public _Fields fieldForId(int fieldId) {
956
    return _Fields.findByThriftId(fieldId);
957
  }
958
 
959
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
960
    org.apache.thrift.protocol.TField field;
961
    iprot.readStructBegin();
962
    while (true)
963
    {
964
      field = iprot.readFieldBegin();
965
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
966
        break;
967
      }
968
      switch (field.id) {
969
        case 1: // ID
970
          if (field.type == org.apache.thrift.protocol.TType.I64) {
971
            this.id = iprot.readI64();
972
            setIdIsSet(true);
973
          } else { 
974
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
975
          }
976
          break;
977
        case 2: // USER_ID
978
          if (field.type == org.apache.thrift.protocol.TType.I64) {
979
            this.user_id = iprot.readI64();
980
            setUser_idIsSet(true);
981
          } else { 
982
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
983
          }
984
          break;
985
        case 3: // MOBILE_NUMBER
986
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
987
            this.mobileNumber = iprot.readString();
988
          } else { 
989
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
990
          }
991
          break;
992
        case 4: // SMS_TEXT
993
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
994
            this.smsText = iprot.readString();
995
          } else { 
996
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
997
          }
998
          break;
999
        case 5: // TYPE
1000
          if (field.type == org.apache.thrift.protocol.TType.I32) {
1001
            this.type = SmsType.findByValue(iprot.readI32());
1002
          } else { 
1003
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1004
          }
1005
          break;
1006
        case 6: // STATUS
1007
          if (field.type == org.apache.thrift.protocol.TType.I32) {
1008
            this.status = SmsStatus.findByValue(iprot.readI32());
1009
          } else { 
1010
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1011
          }
1012
          break;
1013
        case 7: // ATTEMPTS
1014
          if (field.type == org.apache.thrift.protocol.TType.I64) {
1015
            this.attempts = iprot.readI64();
1016
            setAttemptsIsSet(true);
1017
          } else { 
1018
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1019
          }
1020
          break;
1021
        case 8: // CREATED_TIMESTAMP
1022
          if (field.type == org.apache.thrift.protocol.TType.I64) {
1023
            this.createdTimestamp = iprot.readI64();
1024
            setCreatedTimestampIsSet(true);
1025
          } else { 
1026
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1027
          }
1028
          break;
1029
        case 9: // RESPONSE_ID
1030
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
1031
            this.responseId = iprot.readString();
1032
          } else { 
1033
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1034
          }
1035
          break;
1036
        case 10: // RESPONSE_TEXT
1037
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
1038
            this.responseText = iprot.readString();
1039
          } else { 
1040
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1041
          }
1042
          break;
1043
        case 11: // DELIVERY_STATUS
1044
          if (field.type == org.apache.thrift.protocol.TType.I32) {
1045
            this.deliveryStatus = SmsDeliveryStatus.findByValue(iprot.readI32());
1046
          } else { 
1047
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1048
          }
1049
          break;
1050
        default:
1051
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1052
      }
1053
      iprot.readFieldEnd();
1054
    }
1055
    iprot.readStructEnd();
1056
    validate();
1057
  }
1058
 
1059
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1060
    validate();
1061
 
1062
    oprot.writeStructBegin(STRUCT_DESC);
1063
    oprot.writeFieldBegin(ID_FIELD_DESC);
1064
    oprot.writeI64(this.id);
1065
    oprot.writeFieldEnd();
1066
    oprot.writeFieldBegin(USER_ID_FIELD_DESC);
1067
    oprot.writeI64(this.user_id);
1068
    oprot.writeFieldEnd();
1069
    if (this.mobileNumber != null) {
1070
      oprot.writeFieldBegin(MOBILE_NUMBER_FIELD_DESC);
1071
      oprot.writeString(this.mobileNumber);
1072
      oprot.writeFieldEnd();
1073
    }
1074
    if (this.smsText != null) {
1075
      oprot.writeFieldBegin(SMS_TEXT_FIELD_DESC);
1076
      oprot.writeString(this.smsText);
1077
      oprot.writeFieldEnd();
1078
    }
1079
    if (this.type != null) {
1080
      oprot.writeFieldBegin(TYPE_FIELD_DESC);
1081
      oprot.writeI32(this.type.getValue());
1082
      oprot.writeFieldEnd();
1083
    }
1084
    if (this.status != null) {
1085
      oprot.writeFieldBegin(STATUS_FIELD_DESC);
1086
      oprot.writeI32(this.status.getValue());
1087
      oprot.writeFieldEnd();
1088
    }
1089
    oprot.writeFieldBegin(ATTEMPTS_FIELD_DESC);
1090
    oprot.writeI64(this.attempts);
1091
    oprot.writeFieldEnd();
1092
    oprot.writeFieldBegin(CREATED_TIMESTAMP_FIELD_DESC);
1093
    oprot.writeI64(this.createdTimestamp);
1094
    oprot.writeFieldEnd();
1095
    if (this.responseId != null) {
1096
      oprot.writeFieldBegin(RESPONSE_ID_FIELD_DESC);
1097
      oprot.writeString(this.responseId);
1098
      oprot.writeFieldEnd();
1099
    }
1100
    if (this.responseText != null) {
1101
      oprot.writeFieldBegin(RESPONSE_TEXT_FIELD_DESC);
1102
      oprot.writeString(this.responseText);
1103
      oprot.writeFieldEnd();
1104
    }
1105
    if (this.deliveryStatus != null) {
1106
      oprot.writeFieldBegin(DELIVERY_STATUS_FIELD_DESC);
1107
      oprot.writeI32(this.deliveryStatus.getValue());
1108
      oprot.writeFieldEnd();
1109
    }
1110
    oprot.writeFieldStop();
1111
    oprot.writeStructEnd();
1112
  }
1113
 
1114
  @Override
1115
  public String toString() {
1116
    StringBuilder sb = new StringBuilder("UserSms(");
1117
    boolean first = true;
1118
 
1119
    sb.append("id:");
1120
    sb.append(this.id);
1121
    first = false;
1122
    if (!first) sb.append(", ");
1123
    sb.append("user_id:");
1124
    sb.append(this.user_id);
1125
    first = false;
1126
    if (!first) sb.append(", ");
1127
    sb.append("mobileNumber:");
1128
    if (this.mobileNumber == null) {
1129
      sb.append("null");
1130
    } else {
1131
      sb.append(this.mobileNumber);
1132
    }
1133
    first = false;
1134
    if (!first) sb.append(", ");
1135
    sb.append("smsText:");
1136
    if (this.smsText == null) {
1137
      sb.append("null");
1138
    } else {
1139
      sb.append(this.smsText);
1140
    }
1141
    first = false;
1142
    if (!first) sb.append(", ");
1143
    sb.append("type:");
1144
    if (this.type == null) {
1145
      sb.append("null");
1146
    } else {
1147
      sb.append(this.type);
1148
    }
1149
    first = false;
1150
    if (!first) sb.append(", ");
1151
    sb.append("status:");
1152
    if (this.status == null) {
1153
      sb.append("null");
1154
    } else {
1155
      sb.append(this.status);
1156
    }
1157
    first = false;
1158
    if (!first) sb.append(", ");
1159
    sb.append("attempts:");
1160
    sb.append(this.attempts);
1161
    first = false;
1162
    if (!first) sb.append(", ");
1163
    sb.append("createdTimestamp:");
1164
    sb.append(this.createdTimestamp);
1165
    first = false;
1166
    if (!first) sb.append(", ");
1167
    sb.append("responseId:");
1168
    if (this.responseId == null) {
1169
      sb.append("null");
1170
    } else {
1171
      sb.append(this.responseId);
1172
    }
1173
    first = false;
1174
    if (!first) sb.append(", ");
1175
    sb.append("responseText:");
1176
    if (this.responseText == null) {
1177
      sb.append("null");
1178
    } else {
1179
      sb.append(this.responseText);
1180
    }
1181
    first = false;
1182
    if (!first) sb.append(", ");
1183
    sb.append("deliveryStatus:");
1184
    if (this.deliveryStatus == null) {
1185
      sb.append("null");
1186
    } else {
1187
      sb.append(this.deliveryStatus);
1188
    }
1189
    first = false;
1190
    sb.append(")");
1191
    return sb.toString();
1192
  }
1193
 
1194
  public void validate() throws org.apache.thrift.TException {
1195
    // check for required fields
1196
  }
1197
 
1198
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
1199
    try {
1200
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
1201
    } catch (org.apache.thrift.TException te) {
1202
      throw new java.io.IOException(te);
1203
    }
1204
  }
1205
 
1206
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
1207
    try {
1208
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
1209
      __isset_bit_vector = new BitSet(1);
1210
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
1211
    } catch (org.apache.thrift.TException te) {
1212
      throw new java.io.IOException(te);
1213
    }
1214
  }
1215
 
1216
}
1217