Subversion Repositories SmartDukaan

Rev

Rev 412 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 412 Rev 668
Line 26... Line 26...
26
public class Provider implements TBase<Provider._Fields>, java.io.Serializable, Cloneable, Comparable<Provider> {
26
public class Provider implements TBase<Provider._Fields>, java.io.Serializable, Cloneable, Comparable<Provider> {
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
 
32
 
32
  private long id;
33
  private long id;
33
  private String name;
34
  private String name;
-
 
35
  private String accountNo;
34
 
36
 
35
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
37
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
36
  public enum _Fields implements TFieldIdEnum {
38
  public enum _Fields implements TFieldIdEnum {
37
    ID((short)1, "id"),
39
    ID((short)1, "id"),
38
    NAME((short)2, "name");
40
    NAME((short)2, "name"),
-
 
41
    ACCOUNT_NO((short)3, "accountNo");
39
 
42
 
40
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
43
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
41
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
44
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
42
 
45
 
43
    static {
46
    static {
Line 95... Line 98...
95
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
98
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
96
    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
99
    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
97
        new FieldValueMetaData(TType.I64)));
100
        new FieldValueMetaData(TType.I64)));
98
    put(_Fields.NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT, 
101
    put(_Fields.NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT, 
99
        new FieldValueMetaData(TType.STRING)));
102
        new FieldValueMetaData(TType.STRING)));
-
 
103
    put(_Fields.ACCOUNT_NO, new FieldMetaData("accountNo", TFieldRequirementType.DEFAULT, 
-
 
104
        new FieldValueMetaData(TType.STRING)));
100
  }});
105
  }});
101
 
106
 
102
  static {
107
  static {
103
    FieldMetaData.addStructMetaDataMap(Provider.class, metaDataMap);
108
    FieldMetaData.addStructMetaDataMap(Provider.class, metaDataMap);
104
  }
109
  }
Line 106... Line 111...
106
  public Provider() {
111
  public Provider() {
107
  }
112
  }
108
 
113
 
109
  public Provider(
114
  public Provider(
110
    long id,
115
    long id,
111
    String name)
116
    String name,
-
 
117
    String accountNo)
112
  {
118
  {
113
    this();
119
    this();
114
    this.id = id;
120
    this.id = id;
115
    setIdIsSet(true);
121
    setIdIsSet(true);
116
    this.name = name;
122
    this.name = name;
-
 
123
    this.accountNo = accountNo;
117
  }
124
  }
118
 
125
 
119
  /**
126
  /**
120
   * Performs a deep copy on <i>other</i>.
127
   * Performs a deep copy on <i>other</i>.
121
   */
128
   */
Line 124... Line 131...
124
    __isset_bit_vector.or(other.__isset_bit_vector);
131
    __isset_bit_vector.or(other.__isset_bit_vector);
125
    this.id = other.id;
132
    this.id = other.id;
126
    if (other.isSetName()) {
133
    if (other.isSetName()) {
127
      this.name = other.name;
134
      this.name = other.name;
128
    }
135
    }
-
 
136
    if (other.isSetAccountNo()) {
-
 
137
      this.accountNo = other.accountNo;
-
 
138
    }
129
  }
139
  }
130
 
140
 
131
  public Provider deepCopy() {
141
  public Provider deepCopy() {
132
    return new Provider(this);
142
    return new Provider(this);
133
  }
143
  }
Line 182... Line 192...
182
    if (!value) {
192
    if (!value) {
183
      this.name = null;
193
      this.name = null;
184
    }
194
    }
185
  }
195
  }
186
 
196
 
-
 
197
  public String getAccountNo() {
-
 
198
    return this.accountNo;
-
 
199
  }
-
 
200
 
-
 
201
  public Provider setAccountNo(String accountNo) {
-
 
202
    this.accountNo = accountNo;
-
 
203
    return this;
-
 
204
  }
-
 
205
 
-
 
206
  public void unsetAccountNo() {
-
 
207
    this.accountNo = null;
-
 
208
  }
-
 
209
 
-
 
210
  /** Returns true if field accountNo is set (has been asigned a value) and false otherwise */
-
 
211
  public boolean isSetAccountNo() {
-
 
212
    return this.accountNo != null;
-
 
213
  }
-
 
214
 
-
 
215
  public void setAccountNoIsSet(boolean value) {
-
 
216
    if (!value) {
-
 
217
      this.accountNo = null;
-
 
218
    }
-
 
219
  }
-
 
220
 
187
  public void setFieldValue(_Fields field, Object value) {
221
  public void setFieldValue(_Fields field, Object value) {
188
    switch (field) {
222
    switch (field) {
189
    case ID:
223
    case ID:
190
      if (value == null) {
224
      if (value == null) {
191
        unsetId();
225
        unsetId();
Line 200... Line 234...
200
      } else {
234
      } else {
201
        setName((String)value);
235
        setName((String)value);
202
      }
236
      }
203
      break;
237
      break;
204
 
238
 
-
 
239
    case ACCOUNT_NO:
-
 
240
      if (value == null) {
-
 
241
        unsetAccountNo();
-
 
242
      } else {
-
 
243
        setAccountNo((String)value);
-
 
244
      }
-
 
245
      break;
-
 
246
 
205
    }
247
    }
206
  }
248
  }
207
 
249
 
208
  public void setFieldValue(int fieldID, Object value) {
250
  public void setFieldValue(int fieldID, Object value) {
209
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
251
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
Line 215... Line 257...
215
      return new Long(getId());
257
      return new Long(getId());
216
 
258
 
217
    case NAME:
259
    case NAME:
218
      return getName();
260
      return getName();
219
 
261
 
-
 
262
    case ACCOUNT_NO:
-
 
263
      return getAccountNo();
-
 
264
 
220
    }
265
    }
221
    throw new IllegalStateException();
266
    throw new IllegalStateException();
222
  }
267
  }
223
 
268
 
224
  public Object getFieldValue(int fieldId) {
269
  public Object getFieldValue(int fieldId) {
Line 230... Line 275...
230
    switch (field) {
275
    switch (field) {
231
    case ID:
276
    case ID:
232
      return isSetId();
277
      return isSetId();
233
    case NAME:
278
    case NAME:
234
      return isSetName();
279
      return isSetName();
-
 
280
    case ACCOUNT_NO:
-
 
281
      return isSetAccountNo();
235
    }
282
    }
236
    throw new IllegalStateException();
283
    throw new IllegalStateException();
237
  }
284
  }
238
 
285
 
239
  public boolean isSet(int fieldID) {
286
  public boolean isSet(int fieldID) {
Line 269... Line 316...
269
        return false;
316
        return false;
270
      if (!this.name.equals(that.name))
317
      if (!this.name.equals(that.name))
271
        return false;
318
        return false;
272
    }
319
    }
273
 
320
 
-
 
321
    boolean this_present_accountNo = true && this.isSetAccountNo();
-
 
322
    boolean that_present_accountNo = true && that.isSetAccountNo();
-
 
323
    if (this_present_accountNo || that_present_accountNo) {
-
 
324
      if (!(this_present_accountNo && that_present_accountNo))
-
 
325
        return false;
-
 
326
      if (!this.accountNo.equals(that.accountNo))
-
 
327
        return false;
-
 
328
    }
-
 
329
 
274
    return true;
330
    return true;
275
  }
331
  }
276
 
332
 
277
  @Override
333
  @Override
278
  public int hashCode() {
334
  public int hashCode() {
Line 301... Line 357...
301
    }
357
    }
302
    lastComparison = TBaseHelper.compareTo(name, typedOther.name);
358
    lastComparison = TBaseHelper.compareTo(name, typedOther.name);
303
    if (lastComparison != 0) {
359
    if (lastComparison != 0) {
304
      return lastComparison;
360
      return lastComparison;
305
    }
361
    }
-
 
362
    lastComparison = Boolean.valueOf(isSetAccountNo()).compareTo(isSetAccountNo());
-
 
363
    if (lastComparison != 0) {
-
 
364
      return lastComparison;
-
 
365
    }
-
 
366
    lastComparison = TBaseHelper.compareTo(accountNo, typedOther.accountNo);
-
 
367
    if (lastComparison != 0) {
-
 
368
      return lastComparison;
-
 
369
    }
306
    return 0;
370
    return 0;
307
  }
371
  }
308
 
372
 
309
  public void read(TProtocol iprot) throws TException {
373
  public void read(TProtocol iprot) throws TException {
310
    TField field;
374
    TField field;
Line 333... Line 397...
333
              this.name = iprot.readString();
397
              this.name = iprot.readString();
334
            } else { 
398
            } else { 
335
              TProtocolUtil.skip(iprot, field.type);
399
              TProtocolUtil.skip(iprot, field.type);
336
            }
400
            }
337
            break;
401
            break;
-
 
402
          case ACCOUNT_NO:
-
 
403
            if (field.type == TType.STRING) {
-
 
404
              this.accountNo = iprot.readString();
-
 
405
            } else { 
-
 
406
              TProtocolUtil.skip(iprot, field.type);
-
 
407
            }
-
 
408
            break;
338
        }
409
        }
339
        iprot.readFieldEnd();
410
        iprot.readFieldEnd();
340
      }
411
      }
341
    }
412
    }
342
    iprot.readStructEnd();
413
    iprot.readStructEnd();
Line 353... Line 424...
353
    if (this.name != null) {
424
    if (this.name != null) {
354
      oprot.writeFieldBegin(NAME_FIELD_DESC);
425
      oprot.writeFieldBegin(NAME_FIELD_DESC);
355
      oprot.writeString(this.name);
426
      oprot.writeString(this.name);
356
      oprot.writeFieldEnd();
427
      oprot.writeFieldEnd();
357
    }
428
    }
-
 
429
    if (this.accountNo != null) {
-
 
430
      oprot.writeFieldBegin(ACCOUNT_NO_FIELD_DESC);
-
 
431
      oprot.writeString(this.accountNo);
-
 
432
      oprot.writeFieldEnd();
-
 
433
    }
358
    oprot.writeFieldStop();
434
    oprot.writeFieldStop();
359
    oprot.writeStructEnd();
435
    oprot.writeStructEnd();
360
  }
436
  }
361
 
437
 
362
  @Override
438
  @Override
Line 373... Line 449...
373
      sb.append("null");
449
      sb.append("null");
374
    } else {
450
    } else {
375
      sb.append(this.name);
451
      sb.append(this.name);
376
    }
452
    }
377
    first = false;
453
    first = false;
-
 
454
    if (!first) sb.append(", ");
-
 
455
    sb.append("accountNo:");
-
 
456
    if (this.accountNo == null) {
-
 
457
      sb.append("null");
-
 
458
    } else {
-
 
459
      sb.append(this.accountNo);
-
 
460
    }
-
 
461
    first = false;
378
    sb.append(")");
462
    sb.append(")");
379
    return sb.toString();
463
    return sb.toString();
380
  }
464
  }
381
 
465
 
382
  public void validate() throws TException {
466
  public void validate() throws TException {