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 28... Line 28...
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 URL_FIELD_DESC = new TField("url", TType.STRING, (short)3);
31
  private static final TField URL_FIELD_DESC = new TField("url", TType.STRING, (short)3);
32
  private static final TField MASTER_AFFILIATE_ID_FIELD_DESC = new TField("masterAffiliateId", TType.I64, (short)4);
32
  private static final TField MASTER_AFFILIATE_ID_FIELD_DESC = new TField("masterAffiliateId", TType.I64, (short)4);
-
 
33
  private static final TField ADDED_ON_FIELD_DESC = new TField("addedOn", TType.I64, (short)5);
33
 
34
 
34
  private long id;
35
  private long id;
35
  private String name;
36
  private String name;
36
  private String url;
37
  private String url;
37
  private long masterAffiliateId;
38
  private long masterAffiliateId;
-
 
39
  private long addedOn;
38
 
40
 
39
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
41
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
40
  public enum _Fields implements TFieldIdEnum {
42
  public enum _Fields implements TFieldIdEnum {
41
    ID((short)1, "id"),
43
    ID((short)1, "id"),
42
    NAME((short)2, "name"),
44
    NAME((short)2, "name"),
43
    URL((short)3, "url"),
45
    URL((short)3, "url"),
44
    MASTER_AFFILIATE_ID((short)4, "masterAffiliateId");
46
    MASTER_AFFILIATE_ID((short)4, "masterAffiliateId"),
-
 
47
    ADDED_ON((short)5, "addedOn");
45
 
48
 
46
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
49
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
47
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
50
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
48
 
51
 
49
    static {
52
    static {
Line 95... Line 98...
95
  }
98
  }
96
 
99
 
97
  // isset id assignments
100
  // isset id assignments
98
  private static final int __ID_ISSET_ID = 0;
101
  private static final int __ID_ISSET_ID = 0;
99
  private static final int __MASTERAFFILIATEID_ISSET_ID = 1;
102
  private static final int __MASTERAFFILIATEID_ISSET_ID = 1;
-
 
103
  private static final int __ADDEDON_ISSET_ID = 2;
100
  private BitSet __isset_bit_vector = new BitSet(2);
104
  private BitSet __isset_bit_vector = new BitSet(3);
101
 
105
 
102
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
106
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
103
    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
107
    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
104
        new FieldValueMetaData(TType.I64)));
108
        new FieldValueMetaData(TType.I64)));
105
    put(_Fields.NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT, 
109
    put(_Fields.NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT, 
106
        new FieldValueMetaData(TType.STRING)));
110
        new FieldValueMetaData(TType.STRING)));
107
    put(_Fields.URL, new FieldMetaData("url", TFieldRequirementType.DEFAULT, 
111
    put(_Fields.URL, new FieldMetaData("url", TFieldRequirementType.DEFAULT, 
108
        new FieldValueMetaData(TType.STRING)));
112
        new FieldValueMetaData(TType.STRING)));
109
    put(_Fields.MASTER_AFFILIATE_ID, new FieldMetaData("masterAffiliateId", TFieldRequirementType.DEFAULT, 
113
    put(_Fields.MASTER_AFFILIATE_ID, new FieldMetaData("masterAffiliateId", TFieldRequirementType.DEFAULT, 
110
        new FieldValueMetaData(TType.I64)));
114
        new FieldValueMetaData(TType.I64)));
-
 
115
    put(_Fields.ADDED_ON, new FieldMetaData("addedOn", TFieldRequirementType.DEFAULT, 
-
 
116
        new FieldValueMetaData(TType.I64)));
111
  }});
117
  }});
112
 
118
 
113
  static {
119
  static {
114
    FieldMetaData.addStructMetaDataMap(Affiliate.class, metaDataMap);
120
    FieldMetaData.addStructMetaDataMap(Affiliate.class, metaDataMap);
115
  }
121
  }
Line 119... Line 125...
119
 
125
 
120
  public Affiliate(
126
  public Affiliate(
121
    long id,
127
    long id,
122
    String name,
128
    String name,
123
    String url,
129
    String url,
124
    long masterAffiliateId)
130
    long masterAffiliateId,
-
 
131
    long addedOn)
125
  {
132
  {
126
    this();
133
    this();
127
    this.id = id;
134
    this.id = id;
128
    setIdIsSet(true);
135
    setIdIsSet(true);
129
    this.name = name;
136
    this.name = name;
130
    this.url = url;
137
    this.url = url;
131
    this.masterAffiliateId = masterAffiliateId;
138
    this.masterAffiliateId = masterAffiliateId;
132
    setMasterAffiliateIdIsSet(true);
139
    setMasterAffiliateIdIsSet(true);
-
 
140
    this.addedOn = addedOn;
-
 
141
    setAddedOnIsSet(true);
133
  }
142
  }
134
 
143
 
135
  /**
144
  /**
136
   * Performs a deep copy on <i>other</i>.
145
   * Performs a deep copy on <i>other</i>.
137
   */
146
   */
Line 144... Line 153...
144
    }
153
    }
145
    if (other.isSetUrl()) {
154
    if (other.isSetUrl()) {
146
      this.url = other.url;
155
      this.url = other.url;
147
    }
156
    }
148
    this.masterAffiliateId = other.masterAffiliateId;
157
    this.masterAffiliateId = other.masterAffiliateId;
-
 
158
    this.addedOn = other.addedOn;
149
  }
159
  }
150
 
160
 
151
  public Affiliate deepCopy() {
161
  public Affiliate deepCopy() {
152
    return new Affiliate(this);
162
    return new Affiliate(this);
153
  }
163
  }
Line 249... Line 259...
249
 
259
 
250
  public void setMasterAffiliateIdIsSet(boolean value) {
260
  public void setMasterAffiliateIdIsSet(boolean value) {
251
    __isset_bit_vector.set(__MASTERAFFILIATEID_ISSET_ID, value);
261
    __isset_bit_vector.set(__MASTERAFFILIATEID_ISSET_ID, value);
252
  }
262
  }
253
 
263
 
-
 
264
  public long getAddedOn() {
-
 
265
    return this.addedOn;
-
 
266
  }
-
 
267
 
-
 
268
  public Affiliate setAddedOn(long addedOn) {
-
 
269
    this.addedOn = addedOn;
-
 
270
    setAddedOnIsSet(true);
-
 
271
    return this;
-
 
272
  }
-
 
273
 
-
 
274
  public void unsetAddedOn() {
-
 
275
    __isset_bit_vector.clear(__ADDEDON_ISSET_ID);
-
 
276
  }
-
 
277
 
-
 
278
  /** Returns true if field addedOn is set (has been asigned a value) and false otherwise */
-
 
279
  public boolean isSetAddedOn() {
-
 
280
    return __isset_bit_vector.get(__ADDEDON_ISSET_ID);
-
 
281
  }
-
 
282
 
-
 
283
  public void setAddedOnIsSet(boolean value) {
-
 
284
    __isset_bit_vector.set(__ADDEDON_ISSET_ID, value);
-
 
285
  }
-
 
286
 
254
  public void setFieldValue(_Fields field, Object value) {
287
  public void setFieldValue(_Fields field, Object value) {
255
    switch (field) {
288
    switch (field) {
256
    case ID:
289
    case ID:
257
      if (value == null) {
290
      if (value == null) {
258
        unsetId();
291
        unsetId();
Line 283... Line 316...
283
      } else {
316
      } else {
284
        setMasterAffiliateId((Long)value);
317
        setMasterAffiliateId((Long)value);
285
      }
318
      }
286
      break;
319
      break;
287
 
320
 
-
 
321
    case ADDED_ON:
-
 
322
      if (value == null) {
-
 
323
        unsetAddedOn();
-
 
324
      } else {
-
 
325
        setAddedOn((Long)value);
-
 
326
      }
-
 
327
      break;
-
 
328
 
288
    }
329
    }
289
  }
330
  }
290
 
331
 
291
  public void setFieldValue(int fieldID, Object value) {
332
  public void setFieldValue(int fieldID, Object value) {
292
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
333
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
Line 304... Line 345...
304
      return getUrl();
345
      return getUrl();
305
 
346
 
306
    case MASTER_AFFILIATE_ID:
347
    case MASTER_AFFILIATE_ID:
307
      return new Long(getMasterAffiliateId());
348
      return new Long(getMasterAffiliateId());
308
 
349
 
-
 
350
    case ADDED_ON:
-
 
351
      return new Long(getAddedOn());
-
 
352
 
309
    }
353
    }
310
    throw new IllegalStateException();
354
    throw new IllegalStateException();
311
  }
355
  }
312
 
356
 
313
  public Object getFieldValue(int fieldId) {
357
  public Object getFieldValue(int fieldId) {
Line 323... Line 367...
323
      return isSetName();
367
      return isSetName();
324
    case URL:
368
    case URL:
325
      return isSetUrl();
369
      return isSetUrl();
326
    case MASTER_AFFILIATE_ID:
370
    case MASTER_AFFILIATE_ID:
327
      return isSetMasterAffiliateId();
371
      return isSetMasterAffiliateId();
-
 
372
    case ADDED_ON:
-
 
373
      return isSetAddedOn();
328
    }
374
    }
329
    throw new IllegalStateException();
375
    throw new IllegalStateException();
330
  }
376
  }
331
 
377
 
332
  public boolean isSet(int fieldID) {
378
  public boolean isSet(int fieldID) {
Line 380... Line 426...
380
        return false;
426
        return false;
381
      if (this.masterAffiliateId != that.masterAffiliateId)
427
      if (this.masterAffiliateId != that.masterAffiliateId)
382
        return false;
428
        return false;
383
    }
429
    }
384
 
430
 
-
 
431
    boolean this_present_addedOn = true;
-
 
432
    boolean that_present_addedOn = true;
-
 
433
    if (this_present_addedOn || that_present_addedOn) {
-
 
434
      if (!(this_present_addedOn && that_present_addedOn))
-
 
435
        return false;
-
 
436
      if (this.addedOn != that.addedOn)
-
 
437
        return false;
-
 
438
    }
-
 
439
 
385
    return true;
440
    return true;
386
  }
441
  }
387
 
442
 
388
  @Override
443
  @Override
389
  public int hashCode() {
444
  public int hashCode() {
Line 428... Line 483...
428
    }
483
    }
429
    lastComparison = TBaseHelper.compareTo(masterAffiliateId, typedOther.masterAffiliateId);
484
    lastComparison = TBaseHelper.compareTo(masterAffiliateId, typedOther.masterAffiliateId);
430
    if (lastComparison != 0) {
485
    if (lastComparison != 0) {
431
      return lastComparison;
486
      return lastComparison;
432
    }
487
    }
-
 
488
    lastComparison = Boolean.valueOf(isSetAddedOn()).compareTo(isSetAddedOn());
-
 
489
    if (lastComparison != 0) {
-
 
490
      return lastComparison;
-
 
491
    }
-
 
492
    lastComparison = TBaseHelper.compareTo(addedOn, typedOther.addedOn);
-
 
493
    if (lastComparison != 0) {
-
 
494
      return lastComparison;
-
 
495
    }
433
    return 0;
496
    return 0;
434
  }
497
  }
435
 
498
 
436
  public void read(TProtocol iprot) throws TException {
499
  public void read(TProtocol iprot) throws TException {
437
    TField field;
500
    TField field;
Line 475... Line 538...
475
              setMasterAffiliateIdIsSet(true);
538
              setMasterAffiliateIdIsSet(true);
476
            } else { 
539
            } else { 
477
              TProtocolUtil.skip(iprot, field.type);
540
              TProtocolUtil.skip(iprot, field.type);
478
            }
541
            }
479
            break;
542
            break;
-
 
543
          case ADDED_ON:
-
 
544
            if (field.type == TType.I64) {
-
 
545
              this.addedOn = iprot.readI64();
-
 
546
              setAddedOnIsSet(true);
-
 
547
            } else { 
-
 
548
              TProtocolUtil.skip(iprot, field.type);
-
 
549
            }
-
 
550
            break;
480
        }
551
        }
481
        iprot.readFieldEnd();
552
        iprot.readFieldEnd();
482
      }
553
      }
483
    }
554
    }
484
    iprot.readStructEnd();
555
    iprot.readStructEnd();
Line 503... Line 574...
503
      oprot.writeFieldEnd();
574
      oprot.writeFieldEnd();
504
    }
575
    }
505
    oprot.writeFieldBegin(MASTER_AFFILIATE_ID_FIELD_DESC);
576
    oprot.writeFieldBegin(MASTER_AFFILIATE_ID_FIELD_DESC);
506
    oprot.writeI64(this.masterAffiliateId);
577
    oprot.writeI64(this.masterAffiliateId);
507
    oprot.writeFieldEnd();
578
    oprot.writeFieldEnd();
-
 
579
    oprot.writeFieldBegin(ADDED_ON_FIELD_DESC);
-
 
580
    oprot.writeI64(this.addedOn);
-
 
581
    oprot.writeFieldEnd();
508
    oprot.writeFieldStop();
582
    oprot.writeFieldStop();
509
    oprot.writeStructEnd();
583
    oprot.writeStructEnd();
510
  }
584
  }
511
 
585
 
512
  @Override
586
  @Override
Line 535... Line 609...
535
    first = false;
609
    first = false;
536
    if (!first) sb.append(", ");
610
    if (!first) sb.append(", ");
537
    sb.append("masterAffiliateId:");
611
    sb.append("masterAffiliateId:");
538
    sb.append(this.masterAffiliateId);
612
    sb.append(this.masterAffiliateId);
539
    first = false;
613
    first = false;
-
 
614
    if (!first) sb.append(", ");
-
 
615
    sb.append("addedOn:");
-
 
616
    sb.append(this.addedOn);
-
 
617
    first = false;
540
    sb.append(")");
618
    sb.append(")");
541
    return sb.toString();
619
    return sb.toString();
542
  }
620
  }
543
 
621
 
544
  public void validate() throws TException {
622
  public void validate() throws TException {