Subversion Repositories SmartDukaan

Rev

Rev 1396 | Rev 3430 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1396 Rev 1424
Line 24... Line 24...
24
import org.apache.thrift.protocol.*;
24
import org.apache.thrift.protocol.*;
25
 
25
 
26
public class UserEmail implements TBase<UserEmail._Fields>, java.io.Serializable, Cloneable, Comparable<UserEmail> {
26
public class UserEmail implements TBase<UserEmail._Fields>, java.io.Serializable, Cloneable, Comparable<UserEmail> {
27
  private static final TStruct STRUCT_DESC = new TStruct("UserEmail");
27
  private static final TStruct STRUCT_DESC = new TStruct("UserEmail");
28
 
28
 
-
 
29
  private static final TField ID_FIELD_DESC = new TField("id", TType.I64, (short)1);
29
  private static final TField EMAIL_TO_FIELD_DESC = new TField("emailTo", TType.STRING, (short)1);
30
  private static final TField EMAIL_TO_FIELD_DESC = new TField("emailTo", TType.STRING, (short)2);
30
  private static final TField EMAIL_FROM_FIELD_DESC = new TField("emailFrom", TType.STRING, (short)2);
31
  private static final TField EMAIL_FROM_FIELD_DESC = new TField("emailFrom", TType.STRING, (short)3);
31
  private static final TField SUBJECT_FIELD_DESC = new TField("subject", TType.STRING, (short)3);
32
  private static final TField SUBJECT_FIELD_DESC = new TField("subject", TType.STRING, (short)4);
32
  private static final TField BODY_FIELD_DESC = new TField("body", TType.STRING, (short)4);
33
  private static final TField BODY_FIELD_DESC = new TField("body", TType.STRING, (short)5);
33
  private static final TField SOURCE_FIELD_DESC = new TField("source", TType.STRING, (short)5);
34
  private static final TField SOURCE_FIELD_DESC = new TField("source", TType.STRING, (short)6);
34
  private static final TField EMAIL_TYPE_FIELD_DESC = new TField("emailType", TType.STRING, (short)6);
35
  private static final TField EMAIL_TYPE_FIELD_DESC = new TField("emailType", TType.STRING, (short)7);
35
  private static final TField STATUS_FIELD_DESC = new TField("status", TType.BOOL, (short)7);
36
  private static final TField STATUS_FIELD_DESC = new TField("status", TType.BOOL, (short)8);
36
  private static final TField TIMESTAMP_FIELD_DESC = new TField("timestamp", TType.I64, (short)8);
37
  private static final TField TIMESTAMP_FIELD_DESC = new TField("timestamp", TType.I64, (short)9);
37
 
38
 
-
 
39
  private long id;
38
  private String emailTo;
40
  private String emailTo;
39
  private String emailFrom;
41
  private String emailFrom;
40
  private String subject;
42
  private String subject;
41
  private String body;
43
  private String body;
42
  private String source;
44
  private String source;
Line 44... Line 46...
44
  private boolean status;
46
  private boolean status;
45
  private long timestamp;
47
  private long timestamp;
46
 
48
 
47
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
49
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
48
  public enum _Fields implements TFieldIdEnum {
50
  public enum _Fields implements TFieldIdEnum {
-
 
51
    ID((short)1, "id"),
49
    EMAIL_TO((short)1, "emailTo"),
52
    EMAIL_TO((short)2, "emailTo"),
50
    EMAIL_FROM((short)2, "emailFrom"),
53
    EMAIL_FROM((short)3, "emailFrom"),
51
    SUBJECT((short)3, "subject"),
54
    SUBJECT((short)4, "subject"),
52
    BODY((short)4, "body"),
55
    BODY((short)5, "body"),
53
    SOURCE((short)5, "source"),
56
    SOURCE((short)6, "source"),
54
    EMAIL_TYPE((short)6, "emailType"),
57
    EMAIL_TYPE((short)7, "emailType"),
55
    STATUS((short)7, "status"),
58
    STATUS((short)8, "status"),
56
    TIMESTAMP((short)8, "timestamp");
59
    TIMESTAMP((short)9, "timestamp");
57
 
60
 
58
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
61
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
59
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
62
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
60
 
63
 
61
    static {
64
    static {
Line 105... Line 108...
105
      return _fieldName;
108
      return _fieldName;
106
    }
109
    }
107
  }
110
  }
108
 
111
 
109
  // isset id assignments
112
  // isset id assignments
-
 
113
  private static final int __ID_ISSET_ID = 0;
110
  private static final int __STATUS_ISSET_ID = 0;
114
  private static final int __STATUS_ISSET_ID = 1;
111
  private static final int __TIMESTAMP_ISSET_ID = 1;
115
  private static final int __TIMESTAMP_ISSET_ID = 2;
112
  private BitSet __isset_bit_vector = new BitSet(2);
116
  private BitSet __isset_bit_vector = new BitSet(3);
113
 
117
 
114
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
118
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
-
 
119
    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
-
 
120
        new FieldValueMetaData(TType.I64)));
115
    put(_Fields.EMAIL_TO, new FieldMetaData("emailTo", TFieldRequirementType.DEFAULT, 
121
    put(_Fields.EMAIL_TO, new FieldMetaData("emailTo", TFieldRequirementType.DEFAULT, 
116
        new FieldValueMetaData(TType.STRING)));
122
        new FieldValueMetaData(TType.STRING)));
117
    put(_Fields.EMAIL_FROM, new FieldMetaData("emailFrom", TFieldRequirementType.DEFAULT, 
123
    put(_Fields.EMAIL_FROM, new FieldMetaData("emailFrom", TFieldRequirementType.DEFAULT, 
118
        new FieldValueMetaData(TType.STRING)));
124
        new FieldValueMetaData(TType.STRING)));
119
    put(_Fields.SUBJECT, new FieldMetaData("subject", TFieldRequirementType.DEFAULT, 
125
    put(_Fields.SUBJECT, new FieldMetaData("subject", TFieldRequirementType.DEFAULT, 
Line 136... Line 142...
136
 
142
 
137
  public UserEmail() {
143
  public UserEmail() {
138
  }
144
  }
139
 
145
 
140
  public UserEmail(
146
  public UserEmail(
-
 
147
    long id,
141
    String emailTo,
148
    String emailTo,
142
    String emailFrom,
149
    String emailFrom,
143
    String subject,
150
    String subject,
144
    String body,
151
    String body,
145
    String source,
152
    String source,
146
    String emailType,
153
    String emailType,
147
    boolean status,
154
    boolean status,
148
    long timestamp)
155
    long timestamp)
149
  {
156
  {
150
    this();
157
    this();
-
 
158
    this.id = id;
-
 
159
    setIdIsSet(true);
151
    this.emailTo = emailTo;
160
    this.emailTo = emailTo;
152
    this.emailFrom = emailFrom;
161
    this.emailFrom = emailFrom;
153
    this.subject = subject;
162
    this.subject = subject;
154
    this.body = body;
163
    this.body = body;
155
    this.source = source;
164
    this.source = source;
Line 164... Line 173...
164
   * Performs a deep copy on <i>other</i>.
173
   * Performs a deep copy on <i>other</i>.
165
   */
174
   */
166
  public UserEmail(UserEmail other) {
175
  public UserEmail(UserEmail other) {
167
    __isset_bit_vector.clear();
176
    __isset_bit_vector.clear();
168
    __isset_bit_vector.or(other.__isset_bit_vector);
177
    __isset_bit_vector.or(other.__isset_bit_vector);
-
 
178
    this.id = other.id;
169
    if (other.isSetEmailTo()) {
179
    if (other.isSetEmailTo()) {
170
      this.emailTo = other.emailTo;
180
      this.emailTo = other.emailTo;
171
    }
181
    }
172
    if (other.isSetEmailFrom()) {
182
    if (other.isSetEmailFrom()) {
173
      this.emailFrom = other.emailFrom;
183
      this.emailFrom = other.emailFrom;
Line 195... Line 205...
195
  @Deprecated
205
  @Deprecated
196
  public UserEmail clone() {
206
  public UserEmail clone() {
197
    return new UserEmail(this);
207
    return new UserEmail(this);
198
  }
208
  }
199
 
209
 
-
 
210
  public long getId() {
-
 
211
    return this.id;
-
 
212
  }
-
 
213
 
-
 
214
  public UserEmail setId(long id) {
-
 
215
    this.id = id;
-
 
216
    setIdIsSet(true);
-
 
217
    return this;
-
 
218
  }
-
 
219
 
-
 
220
  public void unsetId() {
-
 
221
    __isset_bit_vector.clear(__ID_ISSET_ID);
-
 
222
  }
-
 
223
 
-
 
224
  /** Returns true if field id is set (has been asigned a value) and false otherwise */
-
 
225
  public boolean isSetId() {
-
 
226
    return __isset_bit_vector.get(__ID_ISSET_ID);
-
 
227
  }
-
 
228
 
-
 
229
  public void setIdIsSet(boolean value) {
-
 
230
    __isset_bit_vector.set(__ID_ISSET_ID, value);
-
 
231
  }
-
 
232
 
200
  public String getEmailTo() {
233
  public String getEmailTo() {
201
    return this.emailTo;
234
    return this.emailTo;
202
  }
235
  }
203
 
236
 
204
  public UserEmail setEmailTo(String emailTo) {
237
  public UserEmail setEmailTo(String emailTo) {
Line 387... Line 420...
387
    __isset_bit_vector.set(__TIMESTAMP_ISSET_ID, value);
420
    __isset_bit_vector.set(__TIMESTAMP_ISSET_ID, value);
388
  }
421
  }
389
 
422
 
390
  public void setFieldValue(_Fields field, Object value) {
423
  public void setFieldValue(_Fields field, Object value) {
391
    switch (field) {
424
    switch (field) {
-
 
425
    case ID:
-
 
426
      if (value == null) {
-
 
427
        unsetId();
-
 
428
      } else {
-
 
429
        setId((Long)value);
-
 
430
      }
-
 
431
      break;
-
 
432
 
392
    case EMAIL_TO:
433
    case EMAIL_TO:
393
      if (value == null) {
434
      if (value == null) {
394
        unsetEmailTo();
435
        unsetEmailTo();
395
      } else {
436
      } else {
396
        setEmailTo((String)value);
437
        setEmailTo((String)value);
Line 460... Line 501...
460
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
501
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
461
  }
502
  }
462
 
503
 
463
  public Object getFieldValue(_Fields field) {
504
  public Object getFieldValue(_Fields field) {
464
    switch (field) {
505
    switch (field) {
-
 
506
    case ID:
-
 
507
      return new Long(getId());
-
 
508
 
465
    case EMAIL_TO:
509
    case EMAIL_TO:
466
      return getEmailTo();
510
      return getEmailTo();
467
 
511
 
468
    case EMAIL_FROM:
512
    case EMAIL_FROM:
469
      return getEmailFrom();
513
      return getEmailFrom();
Line 495... Line 539...
495
  }
539
  }
496
 
540
 
497
  /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
541
  /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
498
  public boolean isSet(_Fields field) {
542
  public boolean isSet(_Fields field) {
499
    switch (field) {
543
    switch (field) {
-
 
544
    case ID:
-
 
545
      return isSetId();
500
    case EMAIL_TO:
546
    case EMAIL_TO:
501
      return isSetEmailTo();
547
      return isSetEmailTo();
502
    case EMAIL_FROM:
548
    case EMAIL_FROM:
503
      return isSetEmailFrom();
549
      return isSetEmailFrom();
504
    case SUBJECT:
550
    case SUBJECT:
Line 532... Line 578...
532
 
578
 
533
  public boolean equals(UserEmail that) {
579
  public boolean equals(UserEmail that) {
534
    if (that == null)
580
    if (that == null)
535
      return false;
581
      return false;
536
 
582
 
-
 
583
    boolean this_present_id = true;
-
 
584
    boolean that_present_id = true;
-
 
585
    if (this_present_id || that_present_id) {
-
 
586
      if (!(this_present_id && that_present_id))
-
 
587
        return false;
-
 
588
      if (this.id != that.id)
-
 
589
        return false;
-
 
590
    }
-
 
591
 
537
    boolean this_present_emailTo = true && this.isSetEmailTo();
592
    boolean this_present_emailTo = true && this.isSetEmailTo();
538
    boolean that_present_emailTo = true && that.isSetEmailTo();
593
    boolean that_present_emailTo = true && that.isSetEmailTo();
539
    if (this_present_emailTo || that_present_emailTo) {
594
    if (this_present_emailTo || that_present_emailTo) {
540
      if (!(this_present_emailTo && that_present_emailTo))
595
      if (!(this_present_emailTo && that_present_emailTo))
541
        return false;
596
        return false;
Line 620... Line 675...
620
    }
675
    }
621
 
676
 
622
    int lastComparison = 0;
677
    int lastComparison = 0;
623
    UserEmail typedOther = (UserEmail)other;
678
    UserEmail typedOther = (UserEmail)other;
624
 
679
 
-
 
680
    lastComparison = Boolean.valueOf(isSetId()).compareTo(isSetId());
-
 
681
    if (lastComparison != 0) {
-
 
682
      return lastComparison;
-
 
683
    }
-
 
684
    lastComparison = TBaseHelper.compareTo(id, typedOther.id);
-
 
685
    if (lastComparison != 0) {
-
 
686
      return lastComparison;
-
 
687
    }
625
    lastComparison = Boolean.valueOf(isSetEmailTo()).compareTo(isSetEmailTo());
688
    lastComparison = Boolean.valueOf(isSetEmailTo()).compareTo(isSetEmailTo());
626
    if (lastComparison != 0) {
689
    if (lastComparison != 0) {
627
      return lastComparison;
690
      return lastComparison;
628
    }
691
    }
629
    lastComparison = TBaseHelper.compareTo(emailTo, typedOther.emailTo);
692
    lastComparison = TBaseHelper.compareTo(emailTo, typedOther.emailTo);
Line 701... Line 764...
701
      _Fields fieldId = _Fields.findByThriftId(field.id);
764
      _Fields fieldId = _Fields.findByThriftId(field.id);
702
      if (fieldId == null) {
765
      if (fieldId == null) {
703
        TProtocolUtil.skip(iprot, field.type);
766
        TProtocolUtil.skip(iprot, field.type);
704
      } else {
767
      } else {
705
        switch (fieldId) {
768
        switch (fieldId) {
-
 
769
          case ID:
-
 
770
            if (field.type == TType.I64) {
-
 
771
              this.id = iprot.readI64();
-
 
772
              setIdIsSet(true);
-
 
773
            } else { 
-
 
774
              TProtocolUtil.skip(iprot, field.type);
-
 
775
            }
-
 
776
            break;
706
          case EMAIL_TO:
777
          case EMAIL_TO:
707
            if (field.type == TType.STRING) {
778
            if (field.type == TType.STRING) {
708
              this.emailTo = iprot.readString();
779
              this.emailTo = iprot.readString();
709
            } else { 
780
            } else { 
710
              TProtocolUtil.skip(iprot, field.type);
781
              TProtocolUtil.skip(iprot, field.type);
Line 771... Line 842...
771
 
842
 
772
  public void write(TProtocol oprot) throws TException {
843
  public void write(TProtocol oprot) throws TException {
773
    validate();
844
    validate();
774
 
845
 
775
    oprot.writeStructBegin(STRUCT_DESC);
846
    oprot.writeStructBegin(STRUCT_DESC);
-
 
847
    oprot.writeFieldBegin(ID_FIELD_DESC);
-
 
848
    oprot.writeI64(this.id);
-
 
849
    oprot.writeFieldEnd();
776
    if (this.emailTo != null) {
850
    if (this.emailTo != null) {
777
      oprot.writeFieldBegin(EMAIL_TO_FIELD_DESC);
851
      oprot.writeFieldBegin(EMAIL_TO_FIELD_DESC);
778
      oprot.writeString(this.emailTo);
852
      oprot.writeString(this.emailTo);
779
      oprot.writeFieldEnd();
853
      oprot.writeFieldEnd();
780
    }
854
    }
Line 816... Line 890...
816
  @Override
890
  @Override
817
  public String toString() {
891
  public String toString() {
818
    StringBuilder sb = new StringBuilder("UserEmail(");
892
    StringBuilder sb = new StringBuilder("UserEmail(");
819
    boolean first = true;
893
    boolean first = true;
820
 
894
 
-
 
895
    sb.append("id:");
-
 
896
    sb.append(this.id);
-
 
897
    first = false;
-
 
898
    if (!first) sb.append(", ");
821
    sb.append("emailTo:");
899
    sb.append("emailTo:");
822
    if (this.emailTo == null) {
900
    if (this.emailTo == null) {
823
      sb.append("null");
901
      sb.append("null");
824
    } else {
902
    } else {
825
      sb.append(this.emailTo);
903
      sb.append(this.emailTo);