Subversion Repositories SmartDukaan

Rev

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

Rev 1013 Rev 2515
Line 27... Line 27...
27
  private static final TStruct STRUCT_DESC = new TStruct("Provider");
27
  private static final TStruct STRUCT_DESC = new TStruct("Provider");
28
 
28
 
29
  private static final TField ID_FIELD_DESC = new TField("id", TType.I64, (short)1);
29
  private static final TField ID_FIELD_DESC = new TField("id", TType.I64, (short)1);
30
  private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)2);
30
  private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)2);
31
  private static final TField ACCOUNT_NO_FIELD_DESC = new TField("accountNo", TType.STRING, (short)3);
31
  private static final TField ACCOUNT_NO_FIELD_DESC = new TField("accountNo", TType.STRING, (short)3);
-
 
32
  private static final TField EMAIL_FIELD_DESC = new TField("email", TType.STRING, (short)4);
32
 
33
 
33
  private long id;
34
  private long id;
34
  private String name;
35
  private String name;
35
  private String accountNo;
36
  private String accountNo;
-
 
37
  private String email;
36
 
38
 
37
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
39
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
38
  public enum _Fields implements TFieldIdEnum {
40
  public enum _Fields implements TFieldIdEnum {
39
    ID((short)1, "id"),
41
    ID((short)1, "id"),
40
    NAME((short)2, "name"),
42
    NAME((short)2, "name"),
41
    ACCOUNT_NO((short)3, "accountNo");
43
    ACCOUNT_NO((short)3, "accountNo"),
-
 
44
    EMAIL((short)4, "email");
42
 
45
 
43
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
46
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
44
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
47
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
45
 
48
 
46
    static {
49
    static {
Line 100... Line 103...
100
        new FieldValueMetaData(TType.I64)));
103
        new FieldValueMetaData(TType.I64)));
101
    put(_Fields.NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT, 
104
    put(_Fields.NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT, 
102
        new FieldValueMetaData(TType.STRING)));
105
        new FieldValueMetaData(TType.STRING)));
103
    put(_Fields.ACCOUNT_NO, new FieldMetaData("accountNo", TFieldRequirementType.DEFAULT, 
106
    put(_Fields.ACCOUNT_NO, new FieldMetaData("accountNo", TFieldRequirementType.DEFAULT, 
104
        new FieldValueMetaData(TType.STRING)));
107
        new FieldValueMetaData(TType.STRING)));
-
 
108
    put(_Fields.EMAIL, new FieldMetaData("email", TFieldRequirementType.DEFAULT, 
-
 
109
        new FieldValueMetaData(TType.STRING)));
105
  }});
110
  }});
106
 
111
 
107
  static {
112
  static {
108
    FieldMetaData.addStructMetaDataMap(Provider.class, metaDataMap);
113
    FieldMetaData.addStructMetaDataMap(Provider.class, metaDataMap);
109
  }
114
  }
Line 112... Line 117...
112
  }
117
  }
113
 
118
 
114
  public Provider(
119
  public Provider(
115
    long id,
120
    long id,
116
    String name,
121
    String name,
117
    String accountNo)
122
    String accountNo,
-
 
123
    String email)
118
  {
124
  {
119
    this();
125
    this();
120
    this.id = id;
126
    this.id = id;
121
    setIdIsSet(true);
127
    setIdIsSet(true);
122
    this.name = name;
128
    this.name = name;
123
    this.accountNo = accountNo;
129
    this.accountNo = accountNo;
-
 
130
    this.email = email;
124
  }
131
  }
125
 
132
 
126
  /**
133
  /**
127
   * Performs a deep copy on <i>other</i>.
134
   * Performs a deep copy on <i>other</i>.
128
   */
135
   */
Line 134... Line 141...
134
      this.name = other.name;
141
      this.name = other.name;
135
    }
142
    }
136
    if (other.isSetAccountNo()) {
143
    if (other.isSetAccountNo()) {
137
      this.accountNo = other.accountNo;
144
      this.accountNo = other.accountNo;
138
    }
145
    }
-
 
146
    if (other.isSetEmail()) {
-
 
147
      this.email = other.email;
-
 
148
    }
139
  }
149
  }
140
 
150
 
141
  public Provider deepCopy() {
151
  public Provider deepCopy() {
142
    return new Provider(this);
152
    return new Provider(this);
143
  }
153
  }
Line 216... Line 226...
216
    if (!value) {
226
    if (!value) {
217
      this.accountNo = null;
227
      this.accountNo = null;
218
    }
228
    }
219
  }
229
  }
220
 
230
 
-
 
231
  public String getEmail() {
-
 
232
    return this.email;
-
 
233
  }
-
 
234
 
-
 
235
  public Provider setEmail(String email) {
-
 
236
    this.email = email;
-
 
237
    return this;
-
 
238
  }
-
 
239
 
-
 
240
  public void unsetEmail() {
-
 
241
    this.email = null;
-
 
242
  }
-
 
243
 
-
 
244
  /** Returns true if field email is set (has been asigned a value) and false otherwise */
-
 
245
  public boolean isSetEmail() {
-
 
246
    return this.email != null;
-
 
247
  }
-
 
248
 
-
 
249
  public void setEmailIsSet(boolean value) {
-
 
250
    if (!value) {
-
 
251
      this.email = null;
-
 
252
    }
-
 
253
  }
-
 
254
 
221
  public void setFieldValue(_Fields field, Object value) {
255
  public void setFieldValue(_Fields field, Object value) {
222
    switch (field) {
256
    switch (field) {
223
    case ID:
257
    case ID:
224
      if (value == null) {
258
      if (value == null) {
225
        unsetId();
259
        unsetId();
Line 242... Line 276...
242
      } else {
276
      } else {
243
        setAccountNo((String)value);
277
        setAccountNo((String)value);
244
      }
278
      }
245
      break;
279
      break;
246
 
280
 
-
 
281
    case EMAIL:
-
 
282
      if (value == null) {
-
 
283
        unsetEmail();
-
 
284
      } else {
-
 
285
        setEmail((String)value);
-
 
286
      }
-
 
287
      break;
-
 
288
 
247
    }
289
    }
248
  }
290
  }
249
 
291
 
250
  public void setFieldValue(int fieldID, Object value) {
292
  public void setFieldValue(int fieldID, Object value) {
251
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
293
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
Line 260... Line 302...
260
      return getName();
302
      return getName();
261
 
303
 
262
    case ACCOUNT_NO:
304
    case ACCOUNT_NO:
263
      return getAccountNo();
305
      return getAccountNo();
264
 
306
 
-
 
307
    case EMAIL:
-
 
308
      return getEmail();
-
 
309
 
265
    }
310
    }
266
    throw new IllegalStateException();
311
    throw new IllegalStateException();
267
  }
312
  }
268
 
313
 
269
  public Object getFieldValue(int fieldId) {
314
  public Object getFieldValue(int fieldId) {
Line 277... Line 322...
277
      return isSetId();
322
      return isSetId();
278
    case NAME:
323
    case NAME:
279
      return isSetName();
324
      return isSetName();
280
    case ACCOUNT_NO:
325
    case ACCOUNT_NO:
281
      return isSetAccountNo();
326
      return isSetAccountNo();
-
 
327
    case EMAIL:
-
 
328
      return isSetEmail();
282
    }
329
    }
283
    throw new IllegalStateException();
330
    throw new IllegalStateException();
284
  }
331
  }
285
 
332
 
286
  public boolean isSet(int fieldID) {
333
  public boolean isSet(int fieldID) {
Line 325... Line 372...
325
        return false;
372
        return false;
326
      if (!this.accountNo.equals(that.accountNo))
373
      if (!this.accountNo.equals(that.accountNo))
327
        return false;
374
        return false;
328
    }
375
    }
329
 
376
 
-
 
377
    boolean this_present_email = true && this.isSetEmail();
-
 
378
    boolean that_present_email = true && that.isSetEmail();
-
 
379
    if (this_present_email || that_present_email) {
-
 
380
      if (!(this_present_email && that_present_email))
-
 
381
        return false;
-
 
382
      if (!this.email.equals(that.email))
-
 
383
        return false;
-
 
384
    }
-
 
385
 
330
    return true;
386
    return true;
331
  }
387
  }
332
 
388
 
333
  @Override
389
  @Override
334
  public int hashCode() {
390
  public int hashCode() {
Line 365... Line 421...
365
    }
421
    }
366
    lastComparison = TBaseHelper.compareTo(accountNo, typedOther.accountNo);
422
    lastComparison = TBaseHelper.compareTo(accountNo, typedOther.accountNo);
367
    if (lastComparison != 0) {
423
    if (lastComparison != 0) {
368
      return lastComparison;
424
      return lastComparison;
369
    }
425
    }
-
 
426
    lastComparison = Boolean.valueOf(isSetEmail()).compareTo(isSetEmail());
-
 
427
    if (lastComparison != 0) {
-
 
428
      return lastComparison;
-
 
429
    }
-
 
430
    lastComparison = TBaseHelper.compareTo(email, typedOther.email);
-
 
431
    if (lastComparison != 0) {
-
 
432
      return lastComparison;
-
 
433
    }
370
    return 0;
434
    return 0;
371
  }
435
  }
372
 
436
 
373
  public void read(TProtocol iprot) throws TException {
437
  public void read(TProtocol iprot) throws TException {
374
    TField field;
438
    TField field;
Line 404... Line 468...
404
              this.accountNo = iprot.readString();
468
              this.accountNo = iprot.readString();
405
            } else { 
469
            } else { 
406
              TProtocolUtil.skip(iprot, field.type);
470
              TProtocolUtil.skip(iprot, field.type);
407
            }
471
            }
408
            break;
472
            break;
-
 
473
          case EMAIL:
-
 
474
            if (field.type == TType.STRING) {
-
 
475
              this.email = iprot.readString();
-
 
476
            } else { 
-
 
477
              TProtocolUtil.skip(iprot, field.type);
-
 
478
            }
-
 
479
            break;
409
        }
480
        }
410
        iprot.readFieldEnd();
481
        iprot.readFieldEnd();
411
      }
482
      }
412
    }
483
    }
413
    iprot.readStructEnd();
484
    iprot.readStructEnd();
Line 429... Line 500...
429
    if (this.accountNo != null) {
500
    if (this.accountNo != null) {
430
      oprot.writeFieldBegin(ACCOUNT_NO_FIELD_DESC);
501
      oprot.writeFieldBegin(ACCOUNT_NO_FIELD_DESC);
431
      oprot.writeString(this.accountNo);
502
      oprot.writeString(this.accountNo);
432
      oprot.writeFieldEnd();
503
      oprot.writeFieldEnd();
433
    }
504
    }
-
 
505
    if (this.email != null) {
-
 
506
      oprot.writeFieldBegin(EMAIL_FIELD_DESC);
-
 
507
      oprot.writeString(this.email);
-
 
508
      oprot.writeFieldEnd();
-
 
509
    }
434
    oprot.writeFieldStop();
510
    oprot.writeFieldStop();
435
    oprot.writeStructEnd();
511
    oprot.writeStructEnd();
436
  }
512
  }
437
 
513
 
438
  @Override
514
  @Override
Line 457... Line 533...
457
      sb.append("null");
533
      sb.append("null");
458
    } else {
534
    } else {
459
      sb.append(this.accountNo);
535
      sb.append(this.accountNo);
460
    }
536
    }
461
    first = false;
537
    first = false;
-
 
538
    if (!first) sb.append(", ");
-
 
539
    sb.append("email:");
-
 
540
    if (this.email == null) {
-
 
541
      sb.append("null");
-
 
542
    } else {
-
 
543
      sb.append(this.email);
-
 
544
    }
-
 
545
    first = false;
462
    sb.append(")");
546
    sb.append(")");
463
    return sb.toString();
547
    return sb.toString();
464
  }
548
  }
465
 
549
 
466
  public void validate() throws TException {
550
  public void validate() throws TException {