Subversion Repositories SmartDukaan

Rev

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

Rev 1847 Rev 1860
Line 26... Line 26...
26
public class MasterAffiliate implements TBase<MasterAffiliate._Fields>, java.io.Serializable, Cloneable, Comparable<MasterAffiliate> {
26
public class MasterAffiliate implements TBase<MasterAffiliate._Fields>, java.io.Serializable, Cloneable, Comparable<MasterAffiliate> {
27
  private static final TStruct STRUCT_DESC = new TStruct("MasterAffiliate");
27
  private static final TStruct STRUCT_DESC = new TStruct("MasterAffiliate");
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 ADDED_ON_FIELD_DESC = new TField("addedOn", TType.I64, (short)3);
31
 
32
 
32
  private long id;
33
  private long id;
33
  private String name;
34
  private String name;
-
 
35
  private long addedOn;
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
    ADDED_ON((short)3, "addedOn");
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 88... Line 91...
88
    }
91
    }
89
  }
92
  }
90
 
93
 
91
  // isset id assignments
94
  // isset id assignments
92
  private static final int __ID_ISSET_ID = 0;
95
  private static final int __ID_ISSET_ID = 0;
-
 
96
  private static final int __ADDEDON_ISSET_ID = 1;
93
  private BitSet __isset_bit_vector = new BitSet(1);
97
  private BitSet __isset_bit_vector = new BitSet(2);
94
 
98
 
95
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
99
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
96
    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
100
    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
97
        new FieldValueMetaData(TType.I64)));
101
        new FieldValueMetaData(TType.I64)));
98
    put(_Fields.NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT, 
102
    put(_Fields.NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT, 
99
        new FieldValueMetaData(TType.STRING)));
103
        new FieldValueMetaData(TType.STRING)));
-
 
104
    put(_Fields.ADDED_ON, new FieldMetaData("addedOn", TFieldRequirementType.DEFAULT, 
-
 
105
        new FieldValueMetaData(TType.I64)));
100
  }});
106
  }});
101
 
107
 
102
  static {
108
  static {
103
    FieldMetaData.addStructMetaDataMap(MasterAffiliate.class, metaDataMap);
109
    FieldMetaData.addStructMetaDataMap(MasterAffiliate.class, metaDataMap);
104
  }
110
  }
Line 106... Line 112...
106
  public MasterAffiliate() {
112
  public MasterAffiliate() {
107
  }
113
  }
108
 
114
 
109
  public MasterAffiliate(
115
  public MasterAffiliate(
110
    long id,
116
    long id,
111
    String name)
117
    String name,
-
 
118
    long addedOn)
112
  {
119
  {
113
    this();
120
    this();
114
    this.id = id;
121
    this.id = id;
115
    setIdIsSet(true);
122
    setIdIsSet(true);
116
    this.name = name;
123
    this.name = name;
-
 
124
    this.addedOn = addedOn;
-
 
125
    setAddedOnIsSet(true);
117
  }
126
  }
118
 
127
 
119
  /**
128
  /**
120
   * Performs a deep copy on <i>other</i>.
129
   * Performs a deep copy on <i>other</i>.
121
   */
130
   */
Line 124... Line 133...
124
    __isset_bit_vector.or(other.__isset_bit_vector);
133
    __isset_bit_vector.or(other.__isset_bit_vector);
125
    this.id = other.id;
134
    this.id = other.id;
126
    if (other.isSetName()) {
135
    if (other.isSetName()) {
127
      this.name = other.name;
136
      this.name = other.name;
128
    }
137
    }
-
 
138
    this.addedOn = other.addedOn;
129
  }
139
  }
130
 
140
 
131
  public MasterAffiliate deepCopy() {
141
  public MasterAffiliate deepCopy() {
132
    return new MasterAffiliate(this);
142
    return new MasterAffiliate(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 long getAddedOn() {
-
 
198
    return this.addedOn;
-
 
199
  }
-
 
200
 
-
 
201
  public MasterAffiliate setAddedOn(long addedOn) {
-
 
202
    this.addedOn = addedOn;
-
 
203
    setAddedOnIsSet(true);
-
 
204
    return this;
-
 
205
  }
-
 
206
 
-
 
207
  public void unsetAddedOn() {
-
 
208
    __isset_bit_vector.clear(__ADDEDON_ISSET_ID);
-
 
209
  }
-
 
210
 
-
 
211
  /** Returns true if field addedOn is set (has been asigned a value) and false otherwise */
-
 
212
  public boolean isSetAddedOn() {
-
 
213
    return __isset_bit_vector.get(__ADDEDON_ISSET_ID);
-
 
214
  }
-
 
215
 
-
 
216
  public void setAddedOnIsSet(boolean value) {
-
 
217
    __isset_bit_vector.set(__ADDEDON_ISSET_ID, value);
-
 
218
  }
-
 
219
 
187
  public void setFieldValue(_Fields field, Object value) {
220
  public void setFieldValue(_Fields field, Object value) {
188
    switch (field) {
221
    switch (field) {
189
    case ID:
222
    case ID:
190
      if (value == null) {
223
      if (value == null) {
191
        unsetId();
224
        unsetId();
Line 200... Line 233...
200
      } else {
233
      } else {
201
        setName((String)value);
234
        setName((String)value);
202
      }
235
      }
203
      break;
236
      break;
204
 
237
 
-
 
238
    case ADDED_ON:
-
 
239
      if (value == null) {
-
 
240
        unsetAddedOn();
-
 
241
      } else {
-
 
242
        setAddedOn((Long)value);
-
 
243
      }
-
 
244
      break;
-
 
245
 
205
    }
246
    }
206
  }
247
  }
207
 
248
 
208
  public void setFieldValue(int fieldID, Object value) {
249
  public void setFieldValue(int fieldID, Object value) {
209
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
250
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
Line 215... Line 256...
215
      return new Long(getId());
256
      return new Long(getId());
216
 
257
 
217
    case NAME:
258
    case NAME:
218
      return getName();
259
      return getName();
219
 
260
 
-
 
261
    case ADDED_ON:
-
 
262
      return new Long(getAddedOn());
-
 
263
 
220
    }
264
    }
221
    throw new IllegalStateException();
265
    throw new IllegalStateException();
222
  }
266
  }
223
 
267
 
224
  public Object getFieldValue(int fieldId) {
268
  public Object getFieldValue(int fieldId) {
Line 230... Line 274...
230
    switch (field) {
274
    switch (field) {
231
    case ID:
275
    case ID:
232
      return isSetId();
276
      return isSetId();
233
    case NAME:
277
    case NAME:
234
      return isSetName();
278
      return isSetName();
-
 
279
    case ADDED_ON:
-
 
280
      return isSetAddedOn();
235
    }
281
    }
236
    throw new IllegalStateException();
282
    throw new IllegalStateException();
237
  }
283
  }
238
 
284
 
239
  public boolean isSet(int fieldID) {
285
  public boolean isSet(int fieldID) {
Line 269... Line 315...
269
        return false;
315
        return false;
270
      if (!this.name.equals(that.name))
316
      if (!this.name.equals(that.name))
271
        return false;
317
        return false;
272
    }
318
    }
273
 
319
 
-
 
320
    boolean this_present_addedOn = true;
-
 
321
    boolean that_present_addedOn = true;
-
 
322
    if (this_present_addedOn || that_present_addedOn) {
-
 
323
      if (!(this_present_addedOn && that_present_addedOn))
-
 
324
        return false;
-
 
325
      if (this.addedOn != that.addedOn)
-
 
326
        return false;
-
 
327
    }
-
 
328
 
274
    return true;
329
    return true;
275
  }
330
  }
276
 
331
 
277
  @Override
332
  @Override
278
  public int hashCode() {
333
  public int hashCode() {
Line 301... Line 356...
301
    }
356
    }
302
    lastComparison = TBaseHelper.compareTo(name, typedOther.name);
357
    lastComparison = TBaseHelper.compareTo(name, typedOther.name);
303
    if (lastComparison != 0) {
358
    if (lastComparison != 0) {
304
      return lastComparison;
359
      return lastComparison;
305
    }
360
    }
-
 
361
    lastComparison = Boolean.valueOf(isSetAddedOn()).compareTo(isSetAddedOn());
-
 
362
    if (lastComparison != 0) {
-
 
363
      return lastComparison;
-
 
364
    }
-
 
365
    lastComparison = TBaseHelper.compareTo(addedOn, typedOther.addedOn);
-
 
366
    if (lastComparison != 0) {
-
 
367
      return lastComparison;
-
 
368
    }
306
    return 0;
369
    return 0;
307
  }
370
  }
308
 
371
 
309
  public void read(TProtocol iprot) throws TException {
372
  public void read(TProtocol iprot) throws TException {
310
    TField field;
373
    TField field;
Line 333... Line 396...
333
              this.name = iprot.readString();
396
              this.name = iprot.readString();
334
            } else { 
397
            } else { 
335
              TProtocolUtil.skip(iprot, field.type);
398
              TProtocolUtil.skip(iprot, field.type);
336
            }
399
            }
337
            break;
400
            break;
-
 
401
          case ADDED_ON:
-
 
402
            if (field.type == TType.I64) {
-
 
403
              this.addedOn = iprot.readI64();
-
 
404
              setAddedOnIsSet(true);
-
 
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
    oprot.writeFieldBegin(ADDED_ON_FIELD_DESC);
-
 
430
    oprot.writeI64(this.addedOn);
-
 
431
    oprot.writeFieldEnd();
358
    oprot.writeFieldStop();
432
    oprot.writeFieldStop();
359
    oprot.writeStructEnd();
433
    oprot.writeStructEnd();
360
  }
434
  }
361
 
435
 
362
  @Override
436
  @Override
Line 373... Line 447...
373
      sb.append("null");
447
      sb.append("null");
374
    } else {
448
    } else {
375
      sb.append(this.name);
449
      sb.append(this.name);
376
    }
450
    }
377
    first = false;
451
    first = false;
-
 
452
    if (!first) sb.append(", ");
-
 
453
    sb.append("addedOn:");
-
 
454
    sb.append(this.addedOn);
-
 
455
    first = false;
378
    sb.append(")");
456
    sb.append(")");
379
    return sb.toString();
457
    return sb.toString();
380
  }
458
  }
381
 
459
 
382
  public void validate() throws TException {
460
  public void validate() throws TException {