Subversion Repositories SmartDukaan

Rev

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

Rev 1013 Rev 1329
Line 26... Line 26...
26
public class Vendor implements TBase<Vendor._Fields>, java.io.Serializable, Cloneable, Comparable<Vendor> {
26
public class Vendor implements TBase<Vendor._Fields>, java.io.Serializable, Cloneable, Comparable<Vendor> {
27
  private static final TStruct STRUCT_DESC = new TStruct("Vendor");
27
  private static final TStruct STRUCT_DESC = new TStruct("Vendor");
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 VENDOR_STATUS_FIELD_DESC = new TField("vendorStatus", TType.I32, (short)3);
-
 
32
  private static final TField ADDED_ON_FIELD_DESC = new TField("addedOn", TType.I64, (short)4);
-
 
33
 
31
 
34
  private long id;
32
  private long id;
35
  private String name;
33
  private String name;
36
  private status vendorStatus;
-
 
37
  private long addedOn;
-
 
38
 
34
 
39
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
35
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
40
  public enum _Fields implements TFieldIdEnum {
36
  public enum _Fields implements TFieldIdEnum {
41
    ID((short)1, "id"),
37
    ID((short)1, "id"),
42
    NAME((short)2, "name"),
38
    NAME((short)2, "name");
43
    /**
-
 
44
     * 
-
 
45
     * @see status
-
 
46
     */
-
 
47
    VENDOR_STATUS((short)3, "vendorStatus"),
-
 
48
    ADDED_ON((short)4, "addedOn");
-
 
49
 
39
 
50
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
40
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
51
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
41
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
52
 
42
 
53
    static {
43
    static {
Line 98... Line 88...
98
    }
88
    }
99
  }
89
  }
100
 
90
 
101
  // isset id assignments
91
  // isset id assignments
102
  private static final int __ID_ISSET_ID = 0;
92
  private static final int __ID_ISSET_ID = 0;
103
  private static final int __ADDEDON_ISSET_ID = 1;
-
 
104
  private BitSet __isset_bit_vector = new BitSet(2);
93
  private BitSet __isset_bit_vector = new BitSet(1);
105
 
94
 
106
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
95
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
107
    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
96
    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
108
        new FieldValueMetaData(TType.I64)));
97
        new FieldValueMetaData(TType.I64)));
109
    put(_Fields.NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT, 
98
    put(_Fields.NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT, 
110
        new FieldValueMetaData(TType.STRING)));
99
        new FieldValueMetaData(TType.STRING)));
111
    put(_Fields.VENDOR_STATUS, new FieldMetaData("vendorStatus", TFieldRequirementType.DEFAULT, 
-
 
112
        new EnumMetaData(TType.ENUM, status.class)));
-
 
113
    put(_Fields.ADDED_ON, new FieldMetaData("addedOn", TFieldRequirementType.DEFAULT, 
-
 
114
        new FieldValueMetaData(TType.I64)));
-
 
115
  }});
100
  }});
116
 
101
 
117
  static {
102
  static {
118
    FieldMetaData.addStructMetaDataMap(Vendor.class, metaDataMap);
103
    FieldMetaData.addStructMetaDataMap(Vendor.class, metaDataMap);
119
  }
104
  }
Line 121... Line 106...
121
  public Vendor() {
106
  public Vendor() {
122
  }
107
  }
123
 
108
 
124
  public Vendor(
109
  public Vendor(
125
    long id,
110
    long id,
126
    String name,
111
    String name)
127
    status vendorStatus,
-
 
128
    long addedOn)
-
 
129
  {
112
  {
130
    this();
113
    this();
131
    this.id = id;
114
    this.id = id;
132
    setIdIsSet(true);
115
    setIdIsSet(true);
133
    this.name = name;
116
    this.name = name;
134
    this.vendorStatus = vendorStatus;
-
 
135
    this.addedOn = addedOn;
-
 
136
    setAddedOnIsSet(true);
-
 
137
  }
117
  }
138
 
118
 
139
  /**
119
  /**
140
   * Performs a deep copy on <i>other</i>.
120
   * Performs a deep copy on <i>other</i>.
141
   */
121
   */
Line 144... Line 124...
144
    __isset_bit_vector.or(other.__isset_bit_vector);
124
    __isset_bit_vector.or(other.__isset_bit_vector);
145
    this.id = other.id;
125
    this.id = other.id;
146
    if (other.isSetName()) {
126
    if (other.isSetName()) {
147
      this.name = other.name;
127
      this.name = other.name;
148
    }
128
    }
149
    if (other.isSetVendorStatus()) {
-
 
150
      this.vendorStatus = other.vendorStatus;
-
 
151
    }
-
 
152
    this.addedOn = other.addedOn;
-
 
153
  }
129
  }
154
 
130
 
155
  public Vendor deepCopy() {
131
  public Vendor deepCopy() {
156
    return new Vendor(this);
132
    return new Vendor(this);
157
  }
133
  }
Line 206... Line 182...
206
    if (!value) {
182
    if (!value) {
207
      this.name = null;
183
      this.name = null;
208
    }
184
    }
209
  }
185
  }
210
 
186
 
211
  /**
-
 
212
   * 
-
 
213
   * @see status
-
 
214
   */
-
 
215
  public status getVendorStatus() {
-
 
216
    return this.vendorStatus;
-
 
217
  }
-
 
218
 
-
 
219
  /**
-
 
220
   * 
-
 
221
   * @see status
-
 
222
   */
-
 
223
  public Vendor setVendorStatus(status vendorStatus) {
-
 
224
    this.vendorStatus = vendorStatus;
-
 
225
    return this;
-
 
226
  }
-
 
227
 
-
 
228
  public void unsetVendorStatus() {
-
 
229
    this.vendorStatus = null;
-
 
230
  }
-
 
231
 
-
 
232
  /** Returns true if field vendorStatus is set (has been asigned a value) and false otherwise */
-
 
233
  public boolean isSetVendorStatus() {
-
 
234
    return this.vendorStatus != null;
-
 
235
  }
-
 
236
 
-
 
237
  public void setVendorStatusIsSet(boolean value) {
-
 
238
    if (!value) {
-
 
239
      this.vendorStatus = null;
-
 
240
    }
-
 
241
  }
-
 
242
 
-
 
243
  public long getAddedOn() {
-
 
244
    return this.addedOn;
-
 
245
  }
-
 
246
 
-
 
247
  public Vendor setAddedOn(long addedOn) {
-
 
248
    this.addedOn = addedOn;
-
 
249
    setAddedOnIsSet(true);
-
 
250
    return this;
-
 
251
  }
-
 
252
 
-
 
253
  public void unsetAddedOn() {
-
 
254
    __isset_bit_vector.clear(__ADDEDON_ISSET_ID);
-
 
255
  }
-
 
256
 
-
 
257
  /** Returns true if field addedOn is set (has been asigned a value) and false otherwise */
-
 
258
  public boolean isSetAddedOn() {
-
 
259
    return __isset_bit_vector.get(__ADDEDON_ISSET_ID);
-
 
260
  }
-
 
261
 
-
 
262
  public void setAddedOnIsSet(boolean value) {
-
 
263
    __isset_bit_vector.set(__ADDEDON_ISSET_ID, value);
-
 
264
  }
-
 
265
 
-
 
266
  public void setFieldValue(_Fields field, Object value) {
187
  public void setFieldValue(_Fields field, Object value) {
267
    switch (field) {
188
    switch (field) {
268
    case ID:
189
    case ID:
269
      if (value == null) {
190
      if (value == null) {
270
        unsetId();
191
        unsetId();
Line 279... Line 200...
279
      } else {
200
      } else {
280
        setName((String)value);
201
        setName((String)value);
281
      }
202
      }
282
      break;
203
      break;
283
 
204
 
284
    case VENDOR_STATUS:
-
 
285
      if (value == null) {
-
 
286
        unsetVendorStatus();
-
 
287
      } else {
-
 
288
        setVendorStatus((status)value);
-
 
289
      }
-
 
290
      break;
-
 
291
 
-
 
292
    case ADDED_ON:
-
 
293
      if (value == null) {
-
 
294
        unsetAddedOn();
-
 
295
      } else {
-
 
296
        setAddedOn((Long)value);
-
 
297
      }
-
 
298
      break;
-
 
299
 
-
 
300
    }
205
    }
301
  }
206
  }
302
 
207
 
303
  public void setFieldValue(int fieldID, Object value) {
208
  public void setFieldValue(int fieldID, Object value) {
304
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
209
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
Line 310... Line 215...
310
      return new Long(getId());
215
      return new Long(getId());
311
 
216
 
312
    case NAME:
217
    case NAME:
313
      return getName();
218
      return getName();
314
 
219
 
315
    case VENDOR_STATUS:
-
 
316
      return getVendorStatus();
-
 
317
 
-
 
318
    case ADDED_ON:
-
 
319
      return new Long(getAddedOn());
-
 
320
 
-
 
321
    }
220
    }
322
    throw new IllegalStateException();
221
    throw new IllegalStateException();
323
  }
222
  }
324
 
223
 
325
  public Object getFieldValue(int fieldId) {
224
  public Object getFieldValue(int fieldId) {
Line 331... Line 230...
331
    switch (field) {
230
    switch (field) {
332
    case ID:
231
    case ID:
333
      return isSetId();
232
      return isSetId();
334
    case NAME:
233
    case NAME:
335
      return isSetName();
234
      return isSetName();
336
    case VENDOR_STATUS:
-
 
337
      return isSetVendorStatus();
-
 
338
    case ADDED_ON:
-
 
339
      return isSetAddedOn();
-
 
340
    }
235
    }
341
    throw new IllegalStateException();
236
    throw new IllegalStateException();
342
  }
237
  }
343
 
238
 
344
  public boolean isSet(int fieldID) {
239
  public boolean isSet(int fieldID) {
Line 374... Line 269...
374
        return false;
269
        return false;
375
      if (!this.name.equals(that.name))
270
      if (!this.name.equals(that.name))
376
        return false;
271
        return false;
377
    }
272
    }
378
 
273
 
379
    boolean this_present_vendorStatus = true && this.isSetVendorStatus();
-
 
380
    boolean that_present_vendorStatus = true && that.isSetVendorStatus();
-
 
381
    if (this_present_vendorStatus || that_present_vendorStatus) {
-
 
382
      if (!(this_present_vendorStatus && that_present_vendorStatus))
-
 
383
        return false;
-
 
384
      if (!this.vendorStatus.equals(that.vendorStatus))
-
 
385
        return false;
-
 
386
    }
-
 
387
 
-
 
388
    boolean this_present_addedOn = true;
-
 
389
    boolean that_present_addedOn = true;
-
 
390
    if (this_present_addedOn || that_present_addedOn) {
-
 
391
      if (!(this_present_addedOn && that_present_addedOn))
-
 
392
        return false;
-
 
393
      if (this.addedOn != that.addedOn)
-
 
394
        return false;
-
 
395
    }
-
 
396
 
-
 
397
    return true;
274
    return true;
398
  }
275
  }
399
 
276
 
400
  @Override
277
  @Override
401
  public int hashCode() {
278
  public int hashCode() {
Line 424... Line 301...
424
    }
301
    }
425
    lastComparison = TBaseHelper.compareTo(name, typedOther.name);
302
    lastComparison = TBaseHelper.compareTo(name, typedOther.name);
426
    if (lastComparison != 0) {
303
    if (lastComparison != 0) {
427
      return lastComparison;
304
      return lastComparison;
428
    }
305
    }
429
    lastComparison = Boolean.valueOf(isSetVendorStatus()).compareTo(isSetVendorStatus());
-
 
430
    if (lastComparison != 0) {
-
 
431
      return lastComparison;
-
 
432
    }
-
 
433
    lastComparison = TBaseHelper.compareTo(vendorStatus, typedOther.vendorStatus);
-
 
434
    if (lastComparison != 0) {
-
 
435
      return lastComparison;
-
 
436
    }
-
 
437
    lastComparison = Boolean.valueOf(isSetAddedOn()).compareTo(isSetAddedOn());
-
 
438
    if (lastComparison != 0) {
-
 
439
      return lastComparison;
-
 
440
    }
-
 
441
    lastComparison = TBaseHelper.compareTo(addedOn, typedOther.addedOn);
-
 
442
    if (lastComparison != 0) {
-
 
443
      return lastComparison;
-
 
444
    }
-
 
445
    return 0;
306
    return 0;
446
  }
307
  }
447
 
308
 
448
  public void read(TProtocol iprot) throws TException {
309
  public void read(TProtocol iprot) throws TException {
449
    TField field;
310
    TField field;
Line 472... Line 333...
472
              this.name = iprot.readString();
333
              this.name = iprot.readString();
473
            } else { 
334
            } else { 
474
              TProtocolUtil.skip(iprot, field.type);
335
              TProtocolUtil.skip(iprot, field.type);
475
            }
336
            }
476
            break;
337
            break;
477
          case VENDOR_STATUS:
-
 
478
            if (field.type == TType.I32) {
-
 
479
              this.vendorStatus = status.findByValue(iprot.readI32());
-
 
480
            } else { 
-
 
481
              TProtocolUtil.skip(iprot, field.type);
-
 
482
            }
-
 
483
            break;
-
 
484
          case ADDED_ON:
-
 
485
            if (field.type == TType.I64) {
-
 
486
              this.addedOn = iprot.readI64();
-
 
487
              setAddedOnIsSet(true);
-
 
488
            } else { 
-
 
489
              TProtocolUtil.skip(iprot, field.type);
-
 
490
            }
-
 
491
            break;
-
 
492
        }
338
        }
493
        iprot.readFieldEnd();
339
        iprot.readFieldEnd();
494
      }
340
      }
495
    }
341
    }
496
    iprot.readStructEnd();
342
    iprot.readStructEnd();
Line 507... Line 353...
507
    if (this.name != null) {
353
    if (this.name != null) {
508
      oprot.writeFieldBegin(NAME_FIELD_DESC);
354
      oprot.writeFieldBegin(NAME_FIELD_DESC);
509
      oprot.writeString(this.name);
355
      oprot.writeString(this.name);
510
      oprot.writeFieldEnd();
356
      oprot.writeFieldEnd();
511
    }
357
    }
512
    if (this.vendorStatus != null) {
-
 
513
      oprot.writeFieldBegin(VENDOR_STATUS_FIELD_DESC);
-
 
514
      oprot.writeI32(this.vendorStatus.getValue());
-
 
515
      oprot.writeFieldEnd();
-
 
516
    }
-
 
517
    oprot.writeFieldBegin(ADDED_ON_FIELD_DESC);
-
 
518
    oprot.writeI64(this.addedOn);
-
 
519
    oprot.writeFieldEnd();
-
 
520
    oprot.writeFieldStop();
358
    oprot.writeFieldStop();
521
    oprot.writeStructEnd();
359
    oprot.writeStructEnd();
522
  }
360
  }
523
 
361
 
524
  @Override
362
  @Override
Line 535... Line 373...
535
      sb.append("null");
373
      sb.append("null");
536
    } else {
374
    } else {
537
      sb.append(this.name);
375
      sb.append(this.name);
538
    }
376
    }
539
    first = false;
377
    first = false;
540
    if (!first) sb.append(", ");
-
 
541
    sb.append("vendorStatus:");
-
 
542
    if (this.vendorStatus == null) {
-
 
543
      sb.append("null");
-
 
544
    } else {
-
 
545
      String vendorStatus_name = vendorStatus.name();
-
 
546
      if (vendorStatus_name != null) {
-
 
547
        sb.append(vendorStatus_name);
-
 
548
        sb.append(" (");
-
 
549
      }
-
 
550
      sb.append(this.vendorStatus);
-
 
551
      if (vendorStatus_name != null) {
-
 
552
        sb.append(")");
-
 
553
      }
-
 
554
    }
-
 
555
    first = false;
-
 
556
    if (!first) sb.append(", ");
-
 
557
    sb.append("addedOn:");
-
 
558
    sb.append(this.addedOn);
-
 
559
    first = false;
-
 
560
    sb.append(")");
378
    sb.append(")");
561
    return sb.toString();
379
    return sb.toString();
562
  }
380
  }
563
 
381
 
564
  public void validate() throws TException {
382
  public void validate() throws TException {