Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
352 ashish 1
/**
3430 rajveer 2
 * Autogenerated by Thrift Compiler (0.7.0)
352 ashish 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;
3430 rajveer 18
import java.nio.ByteBuffer;
352 ashish 19
import java.util.Arrays;
20
import org.slf4j.Logger;
21
import org.slf4j.LoggerFactory;
22
 
3430 rajveer 23
public class Mail implements org.apache.thrift.TBase<Mail, Mail._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Mail");
352 ashish 25
 
3430 rajveer 26
  private static final org.apache.thrift.protocol.TField TO_FIELD_DESC = new org.apache.thrift.protocol.TField("to", org.apache.thrift.protocol.TType.LIST, (short)1);
27
  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)2);
28
  private static final org.apache.thrift.protocol.TField DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("data", org.apache.thrift.protocol.TType.STRING, (short)3);
29
  private static final org.apache.thrift.protocol.TField SENDER_FIELD_DESC = new org.apache.thrift.protocol.TField("sender", org.apache.thrift.protocol.TType.STRING, (short)4);
30
  private static final org.apache.thrift.protocol.TField ATTACHMENTS_FIELD_DESC = new org.apache.thrift.protocol.TField("attachments", org.apache.thrift.protocol.TType.LIST, (short)5);
31
  private static final org.apache.thrift.protocol.TField PASSWORD_FIELD_DESC = new org.apache.thrift.protocol.TField("password", org.apache.thrift.protocol.TType.STRING, (short)6);
352 ashish 32
 
3430 rajveer 33
  private List<String> to; // required
34
  private String subject; // required
35
  private String data; // required
36
  private String sender; // required
37
  private List<String> attachments; // required
38
  private String password; // required
352 ashish 39
 
40
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 41
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
352 ashish 42
    TO((short)1, "to"),
43
    SUBJECT((short)2, "subject"),
44
    DATA((short)3, "data"),
45
    SENDER((short)4, "sender"),
46
    ATTACHMENTS((short)5, "attachments"),
47
    PASSWORD((short)6, "password");
48
 
49
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
50
 
51
    static {
52
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
53
        byName.put(field.getFieldName(), field);
54
      }
55
    }
56
 
57
    /**
58
     * Find the _Fields constant that matches fieldId, or null if its not found.
59
     */
60
    public static _Fields findByThriftId(int fieldId) {
3430 rajveer 61
      switch(fieldId) {
62
        case 1: // TO
63
          return TO;
64
        case 2: // SUBJECT
65
          return SUBJECT;
66
        case 3: // DATA
67
          return DATA;
68
        case 4: // SENDER
69
          return SENDER;
70
        case 5: // ATTACHMENTS
71
          return ATTACHMENTS;
72
        case 6: // PASSWORD
73
          return PASSWORD;
74
        default:
75
          return null;
76
      }
352 ashish 77
    }
78
 
79
    /**
80
     * Find the _Fields constant that matches fieldId, throwing an exception
81
     * if it is not found.
82
     */
83
    public static _Fields findByThriftIdOrThrow(int fieldId) {
84
      _Fields fields = findByThriftId(fieldId);
85
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
86
      return fields;
87
    }
88
 
89
    /**
90
     * Find the _Fields constant that matches name, or null if its not found.
91
     */
92
    public static _Fields findByName(String name) {
93
      return byName.get(name);
94
    }
95
 
96
    private final short _thriftId;
97
    private final String _fieldName;
98
 
99
    _Fields(short thriftId, String fieldName) {
100
      _thriftId = thriftId;
101
      _fieldName = fieldName;
102
    }
103
 
104
    public short getThriftFieldId() {
105
      return _thriftId;
106
    }
107
 
108
    public String getFieldName() {
109
      return _fieldName;
110
    }
111
  }
112
 
113
  // isset id assignments
114
 
3430 rajveer 115
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
352 ashish 116
  static {
3430 rajveer 117
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
118
    tmpMap.put(_Fields.TO, new org.apache.thrift.meta_data.FieldMetaData("to", org.apache.thrift.TFieldRequirementType.DEFAULT, 
119
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
120
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
121
    tmpMap.put(_Fields.SUBJECT, new org.apache.thrift.meta_data.FieldMetaData("subject", org.apache.thrift.TFieldRequirementType.DEFAULT, 
122
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
123
    tmpMap.put(_Fields.DATA, new org.apache.thrift.meta_data.FieldMetaData("data", org.apache.thrift.TFieldRequirementType.DEFAULT, 
124
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
125
    tmpMap.put(_Fields.SENDER, new org.apache.thrift.meta_data.FieldMetaData("sender", org.apache.thrift.TFieldRequirementType.DEFAULT, 
126
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
127
    tmpMap.put(_Fields.ATTACHMENTS, new org.apache.thrift.meta_data.FieldMetaData("attachments", org.apache.thrift.TFieldRequirementType.DEFAULT, 
128
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
129
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
130
    tmpMap.put(_Fields.PASSWORD, new org.apache.thrift.meta_data.FieldMetaData("password", org.apache.thrift.TFieldRequirementType.DEFAULT, 
131
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
132
    metaDataMap = Collections.unmodifiableMap(tmpMap);
133
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Mail.class, metaDataMap);
352 ashish 134
  }
135
 
136
  public Mail() {
137
  }
138
 
139
  public Mail(
140
    List<String> to,
141
    String subject,
142
    String data,
143
    String sender,
144
    List<String> attachments,
145
    String password)
146
  {
147
    this();
148
    this.to = to;
149
    this.subject = subject;
150
    this.data = data;
151
    this.sender = sender;
152
    this.attachments = attachments;
153
    this.password = password;
154
  }
155
 
156
  /**
157
   * Performs a deep copy on <i>other</i>.
158
   */
159
  public Mail(Mail other) {
160
    if (other.isSetTo()) {
161
      List<String> __this__to = new ArrayList<String>();
162
      for (String other_element : other.to) {
163
        __this__to.add(other_element);
164
      }
165
      this.to = __this__to;
166
    }
167
    if (other.isSetSubject()) {
168
      this.subject = other.subject;
169
    }
170
    if (other.isSetData()) {
171
      this.data = other.data;
172
    }
173
    if (other.isSetSender()) {
174
      this.sender = other.sender;
175
    }
176
    if (other.isSetAttachments()) {
177
      List<String> __this__attachments = new ArrayList<String>();
178
      for (String other_element : other.attachments) {
179
        __this__attachments.add(other_element);
180
      }
181
      this.attachments = __this__attachments;
182
    }
183
    if (other.isSetPassword()) {
184
      this.password = other.password;
185
    }
186
  }
187
 
188
  public Mail deepCopy() {
189
    return new Mail(this);
190
  }
191
 
3430 rajveer 192
  @Override
193
  public void clear() {
194
    this.to = null;
195
    this.subject = null;
196
    this.data = null;
197
    this.sender = null;
198
    this.attachments = null;
199
    this.password = null;
352 ashish 200
  }
201
 
202
  public int getToSize() {
203
    return (this.to == null) ? 0 : this.to.size();
204
  }
205
 
206
  public java.util.Iterator<String> getToIterator() {
207
    return (this.to == null) ? null : this.to.iterator();
208
  }
209
 
210
  public void addToTo(String elem) {
211
    if (this.to == null) {
212
      this.to = new ArrayList<String>();
213
    }
214
    this.to.add(elem);
215
  }
216
 
217
  public List<String> getTo() {
218
    return this.to;
219
  }
220
 
3430 rajveer 221
  public void setTo(List<String> to) {
352 ashish 222
    this.to = to;
223
  }
224
 
225
  public void unsetTo() {
226
    this.to = null;
227
  }
228
 
3430 rajveer 229
  /** Returns true if field to is set (has been assigned a value) and false otherwise */
352 ashish 230
  public boolean isSetTo() {
231
    return this.to != null;
232
  }
233
 
234
  public void setToIsSet(boolean value) {
235
    if (!value) {
236
      this.to = null;
237
    }
238
  }
239
 
240
  public String getSubject() {
241
    return this.subject;
242
  }
243
 
3430 rajveer 244
  public void setSubject(String subject) {
352 ashish 245
    this.subject = subject;
246
  }
247
 
248
  public void unsetSubject() {
249
    this.subject = null;
250
  }
251
 
3430 rajveer 252
  /** Returns true if field subject is set (has been assigned a value) and false otherwise */
352 ashish 253
  public boolean isSetSubject() {
254
    return this.subject != null;
255
  }
256
 
257
  public void setSubjectIsSet(boolean value) {
258
    if (!value) {
259
      this.subject = null;
260
    }
261
  }
262
 
263
  public String getData() {
264
    return this.data;
265
  }
266
 
3430 rajveer 267
  public void setData(String data) {
352 ashish 268
    this.data = data;
269
  }
270
 
271
  public void unsetData() {
272
    this.data = null;
273
  }
274
 
3430 rajveer 275
  /** Returns true if field data is set (has been assigned a value) and false otherwise */
352 ashish 276
  public boolean isSetData() {
277
    return this.data != null;
278
  }
279
 
280
  public void setDataIsSet(boolean value) {
281
    if (!value) {
282
      this.data = null;
283
    }
284
  }
285
 
286
  public String getSender() {
287
    return this.sender;
288
  }
289
 
3430 rajveer 290
  public void setSender(String sender) {
352 ashish 291
    this.sender = sender;
292
  }
293
 
294
  public void unsetSender() {
295
    this.sender = null;
296
  }
297
 
3430 rajveer 298
  /** Returns true if field sender is set (has been assigned a value) and false otherwise */
352 ashish 299
  public boolean isSetSender() {
300
    return this.sender != null;
301
  }
302
 
303
  public void setSenderIsSet(boolean value) {
304
    if (!value) {
305
      this.sender = null;
306
    }
307
  }
308
 
309
  public int getAttachmentsSize() {
310
    return (this.attachments == null) ? 0 : this.attachments.size();
311
  }
312
 
313
  public java.util.Iterator<String> getAttachmentsIterator() {
314
    return (this.attachments == null) ? null : this.attachments.iterator();
315
  }
316
 
317
  public void addToAttachments(String elem) {
318
    if (this.attachments == null) {
319
      this.attachments = new ArrayList<String>();
320
    }
321
    this.attachments.add(elem);
322
  }
323
 
324
  public List<String> getAttachments() {
325
    return this.attachments;
326
  }
327
 
3430 rajveer 328
  public void setAttachments(List<String> attachments) {
352 ashish 329
    this.attachments = attachments;
330
  }
331
 
332
  public void unsetAttachments() {
333
    this.attachments = null;
334
  }
335
 
3430 rajveer 336
  /** Returns true if field attachments is set (has been assigned a value) and false otherwise */
352 ashish 337
  public boolean isSetAttachments() {
338
    return this.attachments != null;
339
  }
340
 
341
  public void setAttachmentsIsSet(boolean value) {
342
    if (!value) {
343
      this.attachments = null;
344
    }
345
  }
346
 
347
  public String getPassword() {
348
    return this.password;
349
  }
350
 
3430 rajveer 351
  public void setPassword(String password) {
352 ashish 352
    this.password = password;
353
  }
354
 
355
  public void unsetPassword() {
356
    this.password = null;
357
  }
358
 
3430 rajveer 359
  /** Returns true if field password is set (has been assigned a value) and false otherwise */
352 ashish 360
  public boolean isSetPassword() {
361
    return this.password != null;
362
  }
363
 
364
  public void setPasswordIsSet(boolean value) {
365
    if (!value) {
366
      this.password = null;
367
    }
368
  }
369
 
370
  public void setFieldValue(_Fields field, Object value) {
371
    switch (field) {
372
    case TO:
373
      if (value == null) {
374
        unsetTo();
375
      } else {
376
        setTo((List<String>)value);
377
      }
378
      break;
379
 
380
    case SUBJECT:
381
      if (value == null) {
382
        unsetSubject();
383
      } else {
384
        setSubject((String)value);
385
      }
386
      break;
387
 
388
    case DATA:
389
      if (value == null) {
390
        unsetData();
391
      } else {
392
        setData((String)value);
393
      }
394
      break;
395
 
396
    case SENDER:
397
      if (value == null) {
398
        unsetSender();
399
      } else {
400
        setSender((String)value);
401
      }
402
      break;
403
 
404
    case ATTACHMENTS:
405
      if (value == null) {
406
        unsetAttachments();
407
      } else {
408
        setAttachments((List<String>)value);
409
      }
410
      break;
411
 
412
    case PASSWORD:
413
      if (value == null) {
414
        unsetPassword();
415
      } else {
416
        setPassword((String)value);
417
      }
418
      break;
419
 
420
    }
421
  }
422
 
423
  public Object getFieldValue(_Fields field) {
424
    switch (field) {
425
    case TO:
426
      return getTo();
427
 
428
    case SUBJECT:
429
      return getSubject();
430
 
431
    case DATA:
432
      return getData();
433
 
434
    case SENDER:
435
      return getSender();
436
 
437
    case ATTACHMENTS:
438
      return getAttachments();
439
 
440
    case PASSWORD:
441
      return getPassword();
442
 
443
    }
444
    throw new IllegalStateException();
445
  }
446
 
3430 rajveer 447
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
448
  public boolean isSet(_Fields field) {
449
    if (field == null) {
450
      throw new IllegalArgumentException();
451
    }
352 ashish 452
 
453
    switch (field) {
454
    case TO:
455
      return isSetTo();
456
    case SUBJECT:
457
      return isSetSubject();
458
    case DATA:
459
      return isSetData();
460
    case SENDER:
461
      return isSetSender();
462
    case ATTACHMENTS:
463
      return isSetAttachments();
464
    case PASSWORD:
465
      return isSetPassword();
466
    }
467
    throw new IllegalStateException();
468
  }
469
 
470
  @Override
471
  public boolean equals(Object that) {
472
    if (that == null)
473
      return false;
474
    if (that instanceof Mail)
475
      return this.equals((Mail)that);
476
    return false;
477
  }
478
 
479
  public boolean equals(Mail that) {
480
    if (that == null)
481
      return false;
482
 
483
    boolean this_present_to = true && this.isSetTo();
484
    boolean that_present_to = true && that.isSetTo();
485
    if (this_present_to || that_present_to) {
486
      if (!(this_present_to && that_present_to))
487
        return false;
488
      if (!this.to.equals(that.to))
489
        return false;
490
    }
491
 
492
    boolean this_present_subject = true && this.isSetSubject();
493
    boolean that_present_subject = true && that.isSetSubject();
494
    if (this_present_subject || that_present_subject) {
495
      if (!(this_present_subject && that_present_subject))
496
        return false;
497
      if (!this.subject.equals(that.subject))
498
        return false;
499
    }
500
 
501
    boolean this_present_data = true && this.isSetData();
502
    boolean that_present_data = true && that.isSetData();
503
    if (this_present_data || that_present_data) {
504
      if (!(this_present_data && that_present_data))
505
        return false;
506
      if (!this.data.equals(that.data))
507
        return false;
508
    }
509
 
510
    boolean this_present_sender = true && this.isSetSender();
511
    boolean that_present_sender = true && that.isSetSender();
512
    if (this_present_sender || that_present_sender) {
513
      if (!(this_present_sender && that_present_sender))
514
        return false;
515
      if (!this.sender.equals(that.sender))
516
        return false;
517
    }
518
 
519
    boolean this_present_attachments = true && this.isSetAttachments();
520
    boolean that_present_attachments = true && that.isSetAttachments();
521
    if (this_present_attachments || that_present_attachments) {
522
      if (!(this_present_attachments && that_present_attachments))
523
        return false;
524
      if (!this.attachments.equals(that.attachments))
525
        return false;
526
    }
527
 
528
    boolean this_present_password = true && this.isSetPassword();
529
    boolean that_present_password = true && that.isSetPassword();
530
    if (this_present_password || that_present_password) {
531
      if (!(this_present_password && that_present_password))
532
        return false;
533
      if (!this.password.equals(that.password))
534
        return false;
535
    }
536
 
537
    return true;
538
  }
539
 
540
  @Override
541
  public int hashCode() {
542
    return 0;
543
  }
544
 
545
  public int compareTo(Mail other) {
546
    if (!getClass().equals(other.getClass())) {
547
      return getClass().getName().compareTo(other.getClass().getName());
548
    }
549
 
550
    int lastComparison = 0;
551
    Mail typedOther = (Mail)other;
552
 
3430 rajveer 553
    lastComparison = Boolean.valueOf(isSetTo()).compareTo(typedOther.isSetTo());
352 ashish 554
    if (lastComparison != 0) {
555
      return lastComparison;
556
    }
3430 rajveer 557
    if (isSetTo()) {
558
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.to, typedOther.to);
559
      if (lastComparison != 0) {
560
        return lastComparison;
561
      }
352 ashish 562
    }
3430 rajveer 563
    lastComparison = Boolean.valueOf(isSetSubject()).compareTo(typedOther.isSetSubject());
352 ashish 564
    if (lastComparison != 0) {
565
      return lastComparison;
566
    }
3430 rajveer 567
    if (isSetSubject()) {
568
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.subject, typedOther.subject);
569
      if (lastComparison != 0) {
570
        return lastComparison;
571
      }
352 ashish 572
    }
3430 rajveer 573
    lastComparison = Boolean.valueOf(isSetData()).compareTo(typedOther.isSetData());
352 ashish 574
    if (lastComparison != 0) {
575
      return lastComparison;
576
    }
3430 rajveer 577
    if (isSetData()) {
578
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.data, typedOther.data);
579
      if (lastComparison != 0) {
580
        return lastComparison;
581
      }
352 ashish 582
    }
3430 rajveer 583
    lastComparison = Boolean.valueOf(isSetSender()).compareTo(typedOther.isSetSender());
352 ashish 584
    if (lastComparison != 0) {
585
      return lastComparison;
586
    }
3430 rajveer 587
    if (isSetSender()) {
588
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sender, typedOther.sender);
589
      if (lastComparison != 0) {
590
        return lastComparison;
591
      }
352 ashish 592
    }
3430 rajveer 593
    lastComparison = Boolean.valueOf(isSetAttachments()).compareTo(typedOther.isSetAttachments());
352 ashish 594
    if (lastComparison != 0) {
595
      return lastComparison;
596
    }
3430 rajveer 597
    if (isSetAttachments()) {
598
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.attachments, typedOther.attachments);
599
      if (lastComparison != 0) {
600
        return lastComparison;
601
      }
352 ashish 602
    }
3430 rajveer 603
    lastComparison = Boolean.valueOf(isSetPassword()).compareTo(typedOther.isSetPassword());
352 ashish 604
    if (lastComparison != 0) {
605
      return lastComparison;
606
    }
3430 rajveer 607
    if (isSetPassword()) {
608
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.password, typedOther.password);
609
      if (lastComparison != 0) {
610
        return lastComparison;
611
      }
352 ashish 612
    }
613
    return 0;
614
  }
615
 
3430 rajveer 616
  public _Fields fieldForId(int fieldId) {
617
    return _Fields.findByThriftId(fieldId);
618
  }
619
 
620
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
621
    org.apache.thrift.protocol.TField field;
352 ashish 622
    iprot.readStructBegin();
623
    while (true)
624
    {
625
      field = iprot.readFieldBegin();
3430 rajveer 626
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
352 ashish 627
        break;
628
      }
3430 rajveer 629
      switch (field.id) {
630
        case 1: // TO
631
          if (field.type == org.apache.thrift.protocol.TType.LIST) {
632
            {
633
              org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
634
              this.to = new ArrayList<String>(_list0.size);
635
              for (int _i1 = 0; _i1 < _list0.size; ++_i1)
352 ashish 636
              {
3430 rajveer 637
                String _elem2; // required
638
                _elem2 = iprot.readString();
639
                this.to.add(_elem2);
352 ashish 640
              }
3430 rajveer 641
              iprot.readListEnd();
352 ashish 642
            }
3430 rajveer 643
          } else { 
644
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
645
          }
646
          break;
647
        case 2: // SUBJECT
648
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
649
            this.subject = iprot.readString();
650
          } else { 
651
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
652
          }
653
          break;
654
        case 3: // DATA
655
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
656
            this.data = iprot.readString();
657
          } else { 
658
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
659
          }
660
          break;
661
        case 4: // SENDER
662
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
663
            this.sender = iprot.readString();
664
          } else { 
665
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
666
          }
667
          break;
668
        case 5: // ATTACHMENTS
669
          if (field.type == org.apache.thrift.protocol.TType.LIST) {
670
            {
671
              org.apache.thrift.protocol.TList _list3 = iprot.readListBegin();
672
              this.attachments = new ArrayList<String>(_list3.size);
673
              for (int _i4 = 0; _i4 < _list3.size; ++_i4)
352 ashish 674
              {
3430 rajveer 675
                String _elem5; // required
676
                _elem5 = iprot.readString();
677
                this.attachments.add(_elem5);
352 ashish 678
              }
3430 rajveer 679
              iprot.readListEnd();
352 ashish 680
            }
3430 rajveer 681
          } else { 
682
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
683
          }
684
          break;
685
        case 6: // PASSWORD
686
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
687
            this.password = iprot.readString();
688
          } else { 
689
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
690
          }
691
          break;
692
        default:
693
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
352 ashish 694
      }
3430 rajveer 695
      iprot.readFieldEnd();
352 ashish 696
    }
697
    iprot.readStructEnd();
698
    validate();
699
  }
700
 
3430 rajveer 701
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
352 ashish 702
    validate();
703
 
704
    oprot.writeStructBegin(STRUCT_DESC);
705
    if (this.to != null) {
706
      oprot.writeFieldBegin(TO_FIELD_DESC);
707
      {
3430 rajveer 708
        oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, this.to.size()));
352 ashish 709
        for (String _iter6 : this.to)
710
        {
711
          oprot.writeString(_iter6);
712
        }
713
        oprot.writeListEnd();
714
      }
715
      oprot.writeFieldEnd();
716
    }
717
    if (this.subject != null) {
718
      oprot.writeFieldBegin(SUBJECT_FIELD_DESC);
719
      oprot.writeString(this.subject);
720
      oprot.writeFieldEnd();
721
    }
722
    if (this.data != null) {
723
      oprot.writeFieldBegin(DATA_FIELD_DESC);
724
      oprot.writeString(this.data);
725
      oprot.writeFieldEnd();
726
    }
727
    if (this.sender != null) {
728
      oprot.writeFieldBegin(SENDER_FIELD_DESC);
729
      oprot.writeString(this.sender);
730
      oprot.writeFieldEnd();
731
    }
732
    if (this.attachments != null) {
733
      oprot.writeFieldBegin(ATTACHMENTS_FIELD_DESC);
734
      {
3430 rajveer 735
        oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, this.attachments.size()));
352 ashish 736
        for (String _iter7 : this.attachments)
737
        {
738
          oprot.writeString(_iter7);
739
        }
740
        oprot.writeListEnd();
741
      }
742
      oprot.writeFieldEnd();
743
    }
744
    if (this.password != null) {
745
      oprot.writeFieldBegin(PASSWORD_FIELD_DESC);
746
      oprot.writeString(this.password);
747
      oprot.writeFieldEnd();
748
    }
749
    oprot.writeFieldStop();
750
    oprot.writeStructEnd();
751
  }
752
 
753
  @Override
754
  public String toString() {
755
    StringBuilder sb = new StringBuilder("Mail(");
756
    boolean first = true;
757
 
758
    sb.append("to:");
759
    if (this.to == null) {
760
      sb.append("null");
761
    } else {
762
      sb.append(this.to);
763
    }
764
    first = false;
765
    if (!first) sb.append(", ");
766
    sb.append("subject:");
767
    if (this.subject == null) {
768
      sb.append("null");
769
    } else {
770
      sb.append(this.subject);
771
    }
772
    first = false;
773
    if (!first) sb.append(", ");
774
    sb.append("data:");
775
    if (this.data == null) {
776
      sb.append("null");
777
    } else {
778
      sb.append(this.data);
779
    }
780
    first = false;
781
    if (!first) sb.append(", ");
782
    sb.append("sender:");
783
    if (this.sender == null) {
784
      sb.append("null");
785
    } else {
786
      sb.append(this.sender);
787
    }
788
    first = false;
789
    if (!first) sb.append(", ");
790
    sb.append("attachments:");
791
    if (this.attachments == null) {
792
      sb.append("null");
793
    } else {
794
      sb.append(this.attachments);
795
    }
796
    first = false;
797
    if (!first) sb.append(", ");
798
    sb.append("password:");
799
    if (this.password == null) {
800
      sb.append("null");
801
    } else {
802
      sb.append(this.password);
803
    }
804
    first = false;
805
    sb.append(")");
806
    return sb.toString();
807
  }
808
 
3430 rajveer 809
  public void validate() throws org.apache.thrift.TException {
352 ashish 810
    // check for required fields
811
  }
812
 
3430 rajveer 813
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
814
    try {
815
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
816
    } catch (org.apache.thrift.TException te) {
817
      throw new java.io.IOException(te);
818
    }
819
  }
820
 
821
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
822
    try {
823
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
824
    } catch (org.apache.thrift.TException te) {
825
      throw new java.io.IOException(te);
826
    }
827
  }
828
 
352 ashish 829
}
830