Subversion Repositories SmartDukaan

Rev

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