Subversion Repositories SmartDukaan

Rev

Rev 8579 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
8579 kshitij.so 1
/**
2
 * Autogenerated by Thrift Compiler (0.7.0)
3
 *
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
 */
6
package in.shop2020.model.v1.catalog;
7
 
8
import java.util.List;
9
import java.util.ArrayList;
10
import java.util.Map;
11
import java.util.HashMap;
12
import java.util.EnumMap;
13
import java.util.Set;
14
import java.util.HashSet;
15
import java.util.EnumSet;
16
import java.util.Collections;
17
import java.util.BitSet;
18
import java.nio.ByteBuffer;
19
import java.util.Arrays;
20
import org.slf4j.Logger;
21
import org.slf4j.LoggerFactory;
22
 
23
public class BannerUriMapping implements org.apache.thrift.TBase<BannerUriMapping, BannerUriMapping._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("BannerUriMapping");
25
 
26
  private static final org.apache.thrift.protocol.TField BANNER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("bannerName", org.apache.thrift.protocol.TType.STRING, (short)1);
27
  private static final org.apache.thrift.protocol.TField URI_FIELD_DESC = new org.apache.thrift.protocol.TField("uri", org.apache.thrift.protocol.TType.STRING, (short)2);
28
  private static final org.apache.thrift.protocol.TField IS_ACTIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("isActive", org.apache.thrift.protocol.TType.BOOL, (short)3);
10097 kshitij.so 29
  private static final org.apache.thrift.protocol.TField TARGET_FIELD_DESC = new org.apache.thrift.protocol.TField("target", org.apache.thrift.protocol.TType.BOOL, (short)4);
8579 kshitij.so 30
 
31
  private String bannerName; // required
32
  private String uri; // required
33
  private boolean isActive; // required
10097 kshitij.so 34
  private boolean target; // required
8579 kshitij.so 35
 
36
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
37
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
38
    BANNER_NAME((short)1, "bannerName"),
39
    URI((short)2, "uri"),
10097 kshitij.so 40
    IS_ACTIVE((short)3, "isActive"),
41
    TARGET((short)4, "target");
8579 kshitij.so 42
 
43
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
44
 
45
    static {
46
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
47
        byName.put(field.getFieldName(), field);
48
      }
49
    }
50
 
51
    /**
52
     * Find the _Fields constant that matches fieldId, or null if its not found.
53
     */
54
    public static _Fields findByThriftId(int fieldId) {
55
      switch(fieldId) {
56
        case 1: // BANNER_NAME
57
          return BANNER_NAME;
58
        case 2: // URI
59
          return URI;
60
        case 3: // IS_ACTIVE
61
          return IS_ACTIVE;
10097 kshitij.so 62
        case 4: // TARGET
63
          return TARGET;
8579 kshitij.so 64
        default:
65
          return null;
66
      }
67
    }
68
 
69
    /**
70
     * Find the _Fields constant that matches fieldId, throwing an exception
71
     * if it is not found.
72
     */
73
    public static _Fields findByThriftIdOrThrow(int fieldId) {
74
      _Fields fields = findByThriftId(fieldId);
75
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
76
      return fields;
77
    }
78
 
79
    /**
80
     * Find the _Fields constant that matches name, or null if its not found.
81
     */
82
    public static _Fields findByName(String name) {
83
      return byName.get(name);
84
    }
85
 
86
    private final short _thriftId;
87
    private final String _fieldName;
88
 
89
    _Fields(short thriftId, String fieldName) {
90
      _thriftId = thriftId;
91
      _fieldName = fieldName;
92
    }
93
 
94
    public short getThriftFieldId() {
95
      return _thriftId;
96
    }
97
 
98
    public String getFieldName() {
99
      return _fieldName;
100
    }
101
  }
102
 
103
  // isset id assignments
104
  private static final int __ISACTIVE_ISSET_ID = 0;
10097 kshitij.so 105
  private static final int __TARGET_ISSET_ID = 1;
106
  private BitSet __isset_bit_vector = new BitSet(2);
8579 kshitij.so 107
 
108
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
109
  static {
110
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
111
    tmpMap.put(_Fields.BANNER_NAME, new org.apache.thrift.meta_data.FieldMetaData("bannerName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
112
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
113
    tmpMap.put(_Fields.URI, new org.apache.thrift.meta_data.FieldMetaData("uri", org.apache.thrift.TFieldRequirementType.DEFAULT, 
114
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
115
    tmpMap.put(_Fields.IS_ACTIVE, new org.apache.thrift.meta_data.FieldMetaData("isActive", org.apache.thrift.TFieldRequirementType.DEFAULT, 
116
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
10097 kshitij.so 117
    tmpMap.put(_Fields.TARGET, new org.apache.thrift.meta_data.FieldMetaData("target", org.apache.thrift.TFieldRequirementType.DEFAULT, 
118
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
8579 kshitij.so 119
    metaDataMap = Collections.unmodifiableMap(tmpMap);
120
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(BannerUriMapping.class, metaDataMap);
121
  }
122
 
123
  public BannerUriMapping() {
124
  }
125
 
126
  public BannerUriMapping(
127
    String bannerName,
128
    String uri,
10097 kshitij.so 129
    boolean isActive,
130
    boolean target)
8579 kshitij.so 131
  {
132
    this();
133
    this.bannerName = bannerName;
134
    this.uri = uri;
135
    this.isActive = isActive;
136
    setIsActiveIsSet(true);
10097 kshitij.so 137
    this.target = target;
138
    setTargetIsSet(true);
8579 kshitij.so 139
  }
140
 
141
  /**
142
   * Performs a deep copy on <i>other</i>.
143
   */
144
  public BannerUriMapping(BannerUriMapping other) {
145
    __isset_bit_vector.clear();
146
    __isset_bit_vector.or(other.__isset_bit_vector);
147
    if (other.isSetBannerName()) {
148
      this.bannerName = other.bannerName;
149
    }
150
    if (other.isSetUri()) {
151
      this.uri = other.uri;
152
    }
153
    this.isActive = other.isActive;
10097 kshitij.so 154
    this.target = other.target;
8579 kshitij.so 155
  }
156
 
157
  public BannerUriMapping deepCopy() {
158
    return new BannerUriMapping(this);
159
  }
160
 
161
  @Override
162
  public void clear() {
163
    this.bannerName = null;
164
    this.uri = null;
165
    setIsActiveIsSet(false);
166
    this.isActive = false;
10097 kshitij.so 167
    setTargetIsSet(false);
168
    this.target = false;
8579 kshitij.so 169
  }
170
 
171
  public String getBannerName() {
172
    return this.bannerName;
173
  }
174
 
175
  public void setBannerName(String bannerName) {
176
    this.bannerName = bannerName;
177
  }
178
 
179
  public void unsetBannerName() {
180
    this.bannerName = null;
181
  }
182
 
183
  /** Returns true if field bannerName is set (has been assigned a value) and false otherwise */
184
  public boolean isSetBannerName() {
185
    return this.bannerName != null;
186
  }
187
 
188
  public void setBannerNameIsSet(boolean value) {
189
    if (!value) {
190
      this.bannerName = null;
191
    }
192
  }
193
 
194
  public String getUri() {
195
    return this.uri;
196
  }
197
 
198
  public void setUri(String uri) {
199
    this.uri = uri;
200
  }
201
 
202
  public void unsetUri() {
203
    this.uri = null;
204
  }
205
 
206
  /** Returns true if field uri is set (has been assigned a value) and false otherwise */
207
  public boolean isSetUri() {
208
    return this.uri != null;
209
  }
210
 
211
  public void setUriIsSet(boolean value) {
212
    if (!value) {
213
      this.uri = null;
214
    }
215
  }
216
 
217
  public boolean isIsActive() {
218
    return this.isActive;
219
  }
220
 
221
  public void setIsActive(boolean isActive) {
222
    this.isActive = isActive;
223
    setIsActiveIsSet(true);
224
  }
225
 
226
  public void unsetIsActive() {
227
    __isset_bit_vector.clear(__ISACTIVE_ISSET_ID);
228
  }
229
 
230
  /** Returns true if field isActive is set (has been assigned a value) and false otherwise */
231
  public boolean isSetIsActive() {
232
    return __isset_bit_vector.get(__ISACTIVE_ISSET_ID);
233
  }
234
 
235
  public void setIsActiveIsSet(boolean value) {
236
    __isset_bit_vector.set(__ISACTIVE_ISSET_ID, value);
237
  }
238
 
10097 kshitij.so 239
  public boolean isTarget() {
240
    return this.target;
241
  }
242
 
243
  public void setTarget(boolean target) {
244
    this.target = target;
245
    setTargetIsSet(true);
246
  }
247
 
248
  public void unsetTarget() {
249
    __isset_bit_vector.clear(__TARGET_ISSET_ID);
250
  }
251
 
252
  /** Returns true if field target is set (has been assigned a value) and false otherwise */
253
  public boolean isSetTarget() {
254
    return __isset_bit_vector.get(__TARGET_ISSET_ID);
255
  }
256
 
257
  public void setTargetIsSet(boolean value) {
258
    __isset_bit_vector.set(__TARGET_ISSET_ID, value);
259
  }
260
 
8579 kshitij.so 261
  public void setFieldValue(_Fields field, Object value) {
262
    switch (field) {
263
    case BANNER_NAME:
264
      if (value == null) {
265
        unsetBannerName();
266
      } else {
267
        setBannerName((String)value);
268
      }
269
      break;
270
 
271
    case URI:
272
      if (value == null) {
273
        unsetUri();
274
      } else {
275
        setUri((String)value);
276
      }
277
      break;
278
 
279
    case IS_ACTIVE:
280
      if (value == null) {
281
        unsetIsActive();
282
      } else {
283
        setIsActive((Boolean)value);
284
      }
285
      break;
286
 
10097 kshitij.so 287
    case TARGET:
288
      if (value == null) {
289
        unsetTarget();
290
      } else {
291
        setTarget((Boolean)value);
292
      }
293
      break;
294
 
8579 kshitij.so 295
    }
296
  }
297
 
298
  public Object getFieldValue(_Fields field) {
299
    switch (field) {
300
    case BANNER_NAME:
301
      return getBannerName();
302
 
303
    case URI:
304
      return getUri();
305
 
306
    case IS_ACTIVE:
307
      return Boolean.valueOf(isIsActive());
308
 
10097 kshitij.so 309
    case TARGET:
310
      return Boolean.valueOf(isTarget());
311
 
8579 kshitij.so 312
    }
313
    throw new IllegalStateException();
314
  }
315
 
316
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
317
  public boolean isSet(_Fields field) {
318
    if (field == null) {
319
      throw new IllegalArgumentException();
320
    }
321
 
322
    switch (field) {
323
    case BANNER_NAME:
324
      return isSetBannerName();
325
    case URI:
326
      return isSetUri();
327
    case IS_ACTIVE:
328
      return isSetIsActive();
10097 kshitij.so 329
    case TARGET:
330
      return isSetTarget();
8579 kshitij.so 331
    }
332
    throw new IllegalStateException();
333
  }
334
 
335
  @Override
336
  public boolean equals(Object that) {
337
    if (that == null)
338
      return false;
339
    if (that instanceof BannerUriMapping)
340
      return this.equals((BannerUriMapping)that);
341
    return false;
342
  }
343
 
344
  public boolean equals(BannerUriMapping that) {
345
    if (that == null)
346
      return false;
347
 
348
    boolean this_present_bannerName = true && this.isSetBannerName();
349
    boolean that_present_bannerName = true && that.isSetBannerName();
350
    if (this_present_bannerName || that_present_bannerName) {
351
      if (!(this_present_bannerName && that_present_bannerName))
352
        return false;
353
      if (!this.bannerName.equals(that.bannerName))
354
        return false;
355
    }
356
 
357
    boolean this_present_uri = true && this.isSetUri();
358
    boolean that_present_uri = true && that.isSetUri();
359
    if (this_present_uri || that_present_uri) {
360
      if (!(this_present_uri && that_present_uri))
361
        return false;
362
      if (!this.uri.equals(that.uri))
363
        return false;
364
    }
365
 
366
    boolean this_present_isActive = true;
367
    boolean that_present_isActive = true;
368
    if (this_present_isActive || that_present_isActive) {
369
      if (!(this_present_isActive && that_present_isActive))
370
        return false;
371
      if (this.isActive != that.isActive)
372
        return false;
373
    }
374
 
10097 kshitij.so 375
    boolean this_present_target = true;
376
    boolean that_present_target = true;
377
    if (this_present_target || that_present_target) {
378
      if (!(this_present_target && that_present_target))
379
        return false;
380
      if (this.target != that.target)
381
        return false;
382
    }
383
 
8579 kshitij.so 384
    return true;
385
  }
386
 
387
  @Override
388
  public int hashCode() {
389
    return 0;
390
  }
391
 
392
  public int compareTo(BannerUriMapping other) {
393
    if (!getClass().equals(other.getClass())) {
394
      return getClass().getName().compareTo(other.getClass().getName());
395
    }
396
 
397
    int lastComparison = 0;
398
    BannerUriMapping typedOther = (BannerUriMapping)other;
399
 
400
    lastComparison = Boolean.valueOf(isSetBannerName()).compareTo(typedOther.isSetBannerName());
401
    if (lastComparison != 0) {
402
      return lastComparison;
403
    }
404
    if (isSetBannerName()) {
405
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bannerName, typedOther.bannerName);
406
      if (lastComparison != 0) {
407
        return lastComparison;
408
      }
409
    }
410
    lastComparison = Boolean.valueOf(isSetUri()).compareTo(typedOther.isSetUri());
411
    if (lastComparison != 0) {
412
      return lastComparison;
413
    }
414
    if (isSetUri()) {
415
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uri, typedOther.uri);
416
      if (lastComparison != 0) {
417
        return lastComparison;
418
      }
419
    }
420
    lastComparison = Boolean.valueOf(isSetIsActive()).compareTo(typedOther.isSetIsActive());
421
    if (lastComparison != 0) {
422
      return lastComparison;
423
    }
424
    if (isSetIsActive()) {
425
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isActive, typedOther.isActive);
426
      if (lastComparison != 0) {
427
        return lastComparison;
428
      }
429
    }
10097 kshitij.so 430
    lastComparison = Boolean.valueOf(isSetTarget()).compareTo(typedOther.isSetTarget());
431
    if (lastComparison != 0) {
432
      return lastComparison;
433
    }
434
    if (isSetTarget()) {
435
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.target, typedOther.target);
436
      if (lastComparison != 0) {
437
        return lastComparison;
438
      }
439
    }
8579 kshitij.so 440
    return 0;
441
  }
442
 
443
  public _Fields fieldForId(int fieldId) {
444
    return _Fields.findByThriftId(fieldId);
445
  }
446
 
447
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
448
    org.apache.thrift.protocol.TField field;
449
    iprot.readStructBegin();
450
    while (true)
451
    {
452
      field = iprot.readFieldBegin();
453
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
454
        break;
455
      }
456
      switch (field.id) {
457
        case 1: // BANNER_NAME
458
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
459
            this.bannerName = iprot.readString();
460
          } else { 
461
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
462
          }
463
          break;
464
        case 2: // URI
465
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
466
            this.uri = iprot.readString();
467
          } else { 
468
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
469
          }
470
          break;
471
        case 3: // IS_ACTIVE
472
          if (field.type == org.apache.thrift.protocol.TType.BOOL) {
473
            this.isActive = iprot.readBool();
474
            setIsActiveIsSet(true);
475
          } else { 
476
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
477
          }
478
          break;
10097 kshitij.so 479
        case 4: // TARGET
480
          if (field.type == org.apache.thrift.protocol.TType.BOOL) {
481
            this.target = iprot.readBool();
482
            setTargetIsSet(true);
483
          } else { 
484
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
485
          }
486
          break;
8579 kshitij.so 487
        default:
488
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
489
      }
490
      iprot.readFieldEnd();
491
    }
492
    iprot.readStructEnd();
493
    validate();
494
  }
495
 
496
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
497
    validate();
498
 
499
    oprot.writeStructBegin(STRUCT_DESC);
500
    if (this.bannerName != null) {
501
      oprot.writeFieldBegin(BANNER_NAME_FIELD_DESC);
502
      oprot.writeString(this.bannerName);
503
      oprot.writeFieldEnd();
504
    }
505
    if (this.uri != null) {
506
      oprot.writeFieldBegin(URI_FIELD_DESC);
507
      oprot.writeString(this.uri);
508
      oprot.writeFieldEnd();
509
    }
510
    oprot.writeFieldBegin(IS_ACTIVE_FIELD_DESC);
511
    oprot.writeBool(this.isActive);
512
    oprot.writeFieldEnd();
10097 kshitij.so 513
    oprot.writeFieldBegin(TARGET_FIELD_DESC);
514
    oprot.writeBool(this.target);
515
    oprot.writeFieldEnd();
8579 kshitij.so 516
    oprot.writeFieldStop();
517
    oprot.writeStructEnd();
518
  }
519
 
520
  @Override
521
  public String toString() {
522
    StringBuilder sb = new StringBuilder("BannerUriMapping(");
523
    boolean first = true;
524
 
525
    sb.append("bannerName:");
526
    if (this.bannerName == null) {
527
      sb.append("null");
528
    } else {
529
      sb.append(this.bannerName);
530
    }
531
    first = false;
532
    if (!first) sb.append(", ");
533
    sb.append("uri:");
534
    if (this.uri == null) {
535
      sb.append("null");
536
    } else {
537
      sb.append(this.uri);
538
    }
539
    first = false;
540
    if (!first) sb.append(", ");
541
    sb.append("isActive:");
542
    sb.append(this.isActive);
543
    first = false;
10097 kshitij.so 544
    if (!first) sb.append(", ");
545
    sb.append("target:");
546
    sb.append(this.target);
547
    first = false;
8579 kshitij.so 548
    sb.append(")");
549
    return sb.toString();
550
  }
551
 
552
  public void validate() throws org.apache.thrift.TException {
553
    // check for required fields
554
  }
555
 
556
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
557
    try {
558
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
559
    } catch (org.apache.thrift.TException te) {
560
      throw new java.io.IOException(te);
561
    }
562
  }
563
 
564
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
565
    try {
566
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
567
      __isset_bit_vector = new BitSet(1);
568
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
569
    } catch (org.apache.thrift.TException te) {
570
      throw new java.io.IOException(te);
571
    }
572
  }
573
 
574
}
575