Subversion Repositories SmartDukaan

Rev

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

Rev 2983 Rev 3430
Line 1... Line 1...
1
/**
1
/**
2
 * Autogenerated by Thrift
2
 * Autogenerated by Thrift Compiler (0.7.0)
3
 *
3
 *
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
 */
5
 */
6
package in.shop2020.model.v1.catalog;
6
package in.shop2020.model.v1.catalog;
7
 
7
 
Line 13... Line 13...
13
import java.util.Set;
13
import java.util.Set;
14
import java.util.HashSet;
14
import java.util.HashSet;
15
import java.util.EnumSet;
15
import java.util.EnumSet;
16
import java.util.Collections;
16
import java.util.Collections;
17
import java.util.BitSet;
17
import java.util.BitSet;
-
 
18
import java.nio.ByteBuffer;
18
import java.util.Arrays;
19
import java.util.Arrays;
19
import org.slf4j.Logger;
20
import org.slf4j.Logger;
20
import org.slf4j.LoggerFactory;
21
import org.slf4j.LoggerFactory;
21
 
22
 
22
import org.apache.thrift.*;
-
 
23
import org.apache.thrift.meta_data.*;
-
 
24
import org.apache.thrift.protocol.*;
-
 
25
 
-
 
26
public class ItemShippingInfo implements TBase<ItemShippingInfo._Fields>, java.io.Serializable, Cloneable, Comparable<ItemShippingInfo> {
23
public class ItemShippingInfo implements org.apache.thrift.TBase<ItemShippingInfo, ItemShippingInfo._Fields>, java.io.Serializable, Cloneable {
27
  private static final TStruct STRUCT_DESC = new TStruct("ItemShippingInfo");
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ItemShippingInfo");
28
 
25
 
29
  private static final TField IS_ACTIVE_FIELD_DESC = new TField("isActive", TType.BOOL, (short)1);
26
  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)1);
30
  private static final TField IS_RISKY_FIELD_DESC = new TField("isRisky", TType.BOOL, (short)2);
27
  private static final org.apache.thrift.protocol.TField IS_RISKY_FIELD_DESC = new org.apache.thrift.protocol.TField("isRisky", org.apache.thrift.protocol.TType.BOOL, (short)2);
31
  private static final TField QUANTITY_FIELD_DESC = new TField("quantity", TType.I64, (short)3);
28
  private static final org.apache.thrift.protocol.TField QUANTITY_FIELD_DESC = new org.apache.thrift.protocol.TField("quantity", org.apache.thrift.protocol.TType.I64, (short)3);
32
 
29
 
33
  private boolean isActive;
30
  private boolean isActive; // required
34
  private boolean isRisky;
31
  private boolean isRisky; // required
35
  private long quantity;
32
  private long quantity; // required
36
 
33
 
37
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
34
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
38
  public enum _Fields implements TFieldIdEnum {
35
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
39
    IS_ACTIVE((short)1, "isActive"),
36
    IS_ACTIVE((short)1, "isActive"),
40
    IS_RISKY((short)2, "isRisky"),
37
    IS_RISKY((short)2, "isRisky"),
41
    QUANTITY((short)3, "quantity");
38
    QUANTITY((short)3, "quantity");
42
 
39
 
43
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
-
 
44
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
40
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
45
 
41
 
46
    static {
42
    static {
47
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
43
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
48
        byId.put((int)field._thriftId, field);
-
 
49
        byName.put(field.getFieldName(), field);
44
        byName.put(field.getFieldName(), field);
50
      }
45
      }
51
    }
46
    }
52
 
47
 
53
    /**
48
    /**
54
     * Find the _Fields constant that matches fieldId, or null if its not found.
49
     * Find the _Fields constant that matches fieldId, or null if its not found.
55
     */
50
     */
56
    public static _Fields findByThriftId(int fieldId) {
51
    public static _Fields findByThriftId(int fieldId) {
57
      return byId.get(fieldId);
52
      switch(fieldId) {
-
 
53
        case 1: // IS_ACTIVE
-
 
54
          return IS_ACTIVE;
-
 
55
        case 2: // IS_RISKY
-
 
56
          return IS_RISKY;
-
 
57
        case 3: // QUANTITY
-
 
58
          return QUANTITY;
-
 
59
        default:
-
 
60
          return null;
-
 
61
      }
58
    }
62
    }
59
 
63
 
60
    /**
64
    /**
61
     * Find the _Fields constant that matches fieldId, throwing an exception
65
     * Find the _Fields constant that matches fieldId, throwing an exception
62
     * if it is not found.
66
     * if it is not found.
Line 95... Line 99...
95
  private static final int __ISACTIVE_ISSET_ID = 0;
99
  private static final int __ISACTIVE_ISSET_ID = 0;
96
  private static final int __ISRISKY_ISSET_ID = 1;
100
  private static final int __ISRISKY_ISSET_ID = 1;
97
  private static final int __QUANTITY_ISSET_ID = 2;
101
  private static final int __QUANTITY_ISSET_ID = 2;
98
  private BitSet __isset_bit_vector = new BitSet(3);
102
  private BitSet __isset_bit_vector = new BitSet(3);
99
 
103
 
100
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
104
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
101
    put(_Fields.IS_ACTIVE, new FieldMetaData("isActive", TFieldRequirementType.DEFAULT, 
-
 
102
        new FieldValueMetaData(TType.BOOL)));
-
 
103
    put(_Fields.IS_RISKY, new FieldMetaData("isRisky", TFieldRequirementType.OPTIONAL, 
-
 
104
        new FieldValueMetaData(TType.BOOL)));
-
 
105
    put(_Fields.QUANTITY, new FieldMetaData("quantity", TFieldRequirementType.OPTIONAL, 
-
 
106
        new FieldValueMetaData(TType.I64)));
-
 
107
  }});
-
 
108
 
-
 
109
  static {
105
  static {
-
 
106
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-
 
107
    tmpMap.put(_Fields.IS_ACTIVE, new org.apache.thrift.meta_data.FieldMetaData("isActive", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
108
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
-
 
109
    tmpMap.put(_Fields.IS_RISKY, new org.apache.thrift.meta_data.FieldMetaData("isRisky", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-
 
110
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
-
 
111
    tmpMap.put(_Fields.QUANTITY, new org.apache.thrift.meta_data.FieldMetaData("quantity", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-
 
112
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-
 
113
    metaDataMap = Collections.unmodifiableMap(tmpMap);
110
    FieldMetaData.addStructMetaDataMap(ItemShippingInfo.class, metaDataMap);
114
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ItemShippingInfo.class, metaDataMap);
111
  }
115
  }
112
 
116
 
113
  public ItemShippingInfo() {
117
  public ItemShippingInfo() {
114
  }
118
  }
115
 
119
 
Line 134... Line 138...
134
 
138
 
135
  public ItemShippingInfo deepCopy() {
139
  public ItemShippingInfo deepCopy() {
136
    return new ItemShippingInfo(this);
140
    return new ItemShippingInfo(this);
137
  }
141
  }
138
 
142
 
139
  @Deprecated
143
  @Override
140
  public ItemShippingInfo clone() {
144
  public void clear() {
-
 
145
    setIsActiveIsSet(false);
-
 
146
    this.isActive = false;
-
 
147
    setIsRiskyIsSet(false);
-
 
148
    this.isRisky = false;
141
    return new ItemShippingInfo(this);
149
    setQuantityIsSet(false);
-
 
150
    this.quantity = 0;
142
  }
151
  }
143
 
152
 
144
  public boolean isIsActive() {
153
  public boolean isIsActive() {
145
    return this.isActive;
154
    return this.isActive;
146
  }
155
  }
147
 
156
 
148
  public ItemShippingInfo setIsActive(boolean isActive) {
157
  public void setIsActive(boolean isActive) {
149
    this.isActive = isActive;
158
    this.isActive = isActive;
150
    setIsActiveIsSet(true);
159
    setIsActiveIsSet(true);
151
    return this;
-
 
152
  }
160
  }
153
 
161
 
154
  public void unsetIsActive() {
162
  public void unsetIsActive() {
155
    __isset_bit_vector.clear(__ISACTIVE_ISSET_ID);
163
    __isset_bit_vector.clear(__ISACTIVE_ISSET_ID);
156
  }
164
  }
157
 
165
 
158
  /** Returns true if field isActive is set (has been asigned a value) and false otherwise */
166
  /** Returns true if field isActive is set (has been assigned a value) and false otherwise */
159
  public boolean isSetIsActive() {
167
  public boolean isSetIsActive() {
160
    return __isset_bit_vector.get(__ISACTIVE_ISSET_ID);
168
    return __isset_bit_vector.get(__ISACTIVE_ISSET_ID);
161
  }
169
  }
162
 
170
 
163
  public void setIsActiveIsSet(boolean value) {
171
  public void setIsActiveIsSet(boolean value) {
Line 166... Line 174...
166
 
174
 
167
  public boolean isIsRisky() {
175
  public boolean isIsRisky() {
168
    return this.isRisky;
176
    return this.isRisky;
169
  }
177
  }
170
 
178
 
171
  public ItemShippingInfo setIsRisky(boolean isRisky) {
179
  public void setIsRisky(boolean isRisky) {
172
    this.isRisky = isRisky;
180
    this.isRisky = isRisky;
173
    setIsRiskyIsSet(true);
181
    setIsRiskyIsSet(true);
174
    return this;
-
 
175
  }
182
  }
176
 
183
 
177
  public void unsetIsRisky() {
184
  public void unsetIsRisky() {
178
    __isset_bit_vector.clear(__ISRISKY_ISSET_ID);
185
    __isset_bit_vector.clear(__ISRISKY_ISSET_ID);
179
  }
186
  }
180
 
187
 
181
  /** Returns true if field isRisky is set (has been asigned a value) and false otherwise */
188
  /** Returns true if field isRisky is set (has been assigned a value) and false otherwise */
182
  public boolean isSetIsRisky() {
189
  public boolean isSetIsRisky() {
183
    return __isset_bit_vector.get(__ISRISKY_ISSET_ID);
190
    return __isset_bit_vector.get(__ISRISKY_ISSET_ID);
184
  }
191
  }
185
 
192
 
186
  public void setIsRiskyIsSet(boolean value) {
193
  public void setIsRiskyIsSet(boolean value) {
Line 189... Line 196...
189
 
196
 
190
  public long getQuantity() {
197
  public long getQuantity() {
191
    return this.quantity;
198
    return this.quantity;
192
  }
199
  }
193
 
200
 
194
  public ItemShippingInfo setQuantity(long quantity) {
201
  public void setQuantity(long quantity) {
195
    this.quantity = quantity;
202
    this.quantity = quantity;
196
    setQuantityIsSet(true);
203
    setQuantityIsSet(true);
197
    return this;
-
 
198
  }
204
  }
199
 
205
 
200
  public void unsetQuantity() {
206
  public void unsetQuantity() {
201
    __isset_bit_vector.clear(__QUANTITY_ISSET_ID);
207
    __isset_bit_vector.clear(__QUANTITY_ISSET_ID);
202
  }
208
  }
203
 
209
 
204
  /** Returns true if field quantity is set (has been asigned a value) and false otherwise */
210
  /** Returns true if field quantity is set (has been assigned a value) and false otherwise */
205
  public boolean isSetQuantity() {
211
  public boolean isSetQuantity() {
206
    return __isset_bit_vector.get(__QUANTITY_ISSET_ID);
212
    return __isset_bit_vector.get(__QUANTITY_ISSET_ID);
207
  }
213
  }
208
 
214
 
209
  public void setQuantityIsSet(boolean value) {
215
  public void setQuantityIsSet(boolean value) {
Line 237... Line 243...
237
      break;
243
      break;
238
 
244
 
239
    }
245
    }
240
  }
246
  }
241
 
247
 
242
  public void setFieldValue(int fieldID, Object value) {
-
 
243
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-
 
244
  }
-
 
245
 
-
 
246
  public Object getFieldValue(_Fields field) {
248
  public Object getFieldValue(_Fields field) {
247
    switch (field) {
249
    switch (field) {
248
    case IS_ACTIVE:
250
    case IS_ACTIVE:
249
      return new Boolean(isIsActive());
251
      return Boolean.valueOf(isIsActive());
250
 
252
 
251
    case IS_RISKY:
253
    case IS_RISKY:
252
      return new Boolean(isIsRisky());
254
      return Boolean.valueOf(isIsRisky());
253
 
255
 
254
    case QUANTITY:
256
    case QUANTITY:
255
      return new Long(getQuantity());
257
      return Long.valueOf(getQuantity());
256
 
258
 
257
    }
259
    }
258
    throw new IllegalStateException();
260
    throw new IllegalStateException();
259
  }
261
  }
260
 
262
 
261
  public Object getFieldValue(int fieldId) {
-
 
262
    return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-
 
263
  }
-
 
264
 
-
 
265
  /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
263
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
266
  public boolean isSet(_Fields field) {
264
  public boolean isSet(_Fields field) {
-
 
265
    if (field == null) {
-
 
266
      throw new IllegalArgumentException();
-
 
267
    }
-
 
268
 
267
    switch (field) {
269
    switch (field) {
268
    case IS_ACTIVE:
270
    case IS_ACTIVE:
269
      return isSetIsActive();
271
      return isSetIsActive();
270
    case IS_RISKY:
272
    case IS_RISKY:
271
      return isSetIsRisky();
273
      return isSetIsRisky();
Line 273... Line 275...
273
      return isSetQuantity();
275
      return isSetQuantity();
274
    }
276
    }
275
    throw new IllegalStateException();
277
    throw new IllegalStateException();
276
  }
278
  }
277
 
279
 
278
  public boolean isSet(int fieldID) {
-
 
279
    return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-
 
280
  }
-
 
281
 
-
 
282
  @Override
280
  @Override
283
  public boolean equals(Object that) {
281
  public boolean equals(Object that) {
284
    if (that == null)
282
    if (that == null)
285
      return false;
283
      return false;
286
    if (that instanceof ItemShippingInfo)
284
    if (that instanceof ItemShippingInfo)
Line 333... Line 331...
333
    }
331
    }
334
 
332
 
335
    int lastComparison = 0;
333
    int lastComparison = 0;
336
    ItemShippingInfo typedOther = (ItemShippingInfo)other;
334
    ItemShippingInfo typedOther = (ItemShippingInfo)other;
337
 
335
 
338
    lastComparison = Boolean.valueOf(isSetIsActive()).compareTo(isSetIsActive());
336
    lastComparison = Boolean.valueOf(isSetIsActive()).compareTo(typedOther.isSetIsActive());
339
    if (lastComparison != 0) {
337
    if (lastComparison != 0) {
340
      return lastComparison;
338
      return lastComparison;
341
    }
339
    }
-
 
340
    if (isSetIsActive()) {
342
    lastComparison = TBaseHelper.compareTo(isActive, typedOther.isActive);
341
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isActive, typedOther.isActive);
343
    if (lastComparison != 0) {
342
      if (lastComparison != 0) {
344
      return lastComparison;
343
        return lastComparison;
-
 
344
      }
345
    }
345
    }
346
    lastComparison = Boolean.valueOf(isSetIsRisky()).compareTo(isSetIsRisky());
346
    lastComparison = Boolean.valueOf(isSetIsRisky()).compareTo(typedOther.isSetIsRisky());
347
    if (lastComparison != 0) {
347
    if (lastComparison != 0) {
348
      return lastComparison;
348
      return lastComparison;
349
    }
349
    }
-
 
350
    if (isSetIsRisky()) {
350
    lastComparison = TBaseHelper.compareTo(isRisky, typedOther.isRisky);
351
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isRisky, typedOther.isRisky);
351
    if (lastComparison != 0) {
352
      if (lastComparison != 0) {
352
      return lastComparison;
353
        return lastComparison;
-
 
354
      }
353
    }
355
    }
354
    lastComparison = Boolean.valueOf(isSetQuantity()).compareTo(isSetQuantity());
356
    lastComparison = Boolean.valueOf(isSetQuantity()).compareTo(typedOther.isSetQuantity());
355
    if (lastComparison != 0) {
357
    if (lastComparison != 0) {
356
      return lastComparison;
358
      return lastComparison;
357
    }
359
    }
-
 
360
    if (isSetQuantity()) {
358
    lastComparison = TBaseHelper.compareTo(quantity, typedOther.quantity);
361
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.quantity, typedOther.quantity);
359
    if (lastComparison != 0) {
362
      if (lastComparison != 0) {
360
      return lastComparison;
363
        return lastComparison;
-
 
364
      }
361
    }
365
    }
362
    return 0;
366
    return 0;
363
  }
367
  }
364
 
368
 
-
 
369
  public _Fields fieldForId(int fieldId) {
-
 
370
    return _Fields.findByThriftId(fieldId);
-
 
371
  }
-
 
372
 
365
  public void read(TProtocol iprot) throws TException {
373
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
366
    TField field;
374
    org.apache.thrift.protocol.TField field;
367
    iprot.readStructBegin();
375
    iprot.readStructBegin();
368
    while (true)
376
    while (true)
369
    {
377
    {
370
      field = iprot.readFieldBegin();
378
      field = iprot.readFieldBegin();
371
      if (field.type == TType.STOP) { 
379
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
372
        break;
380
        break;
373
      }
381
      }
374
      _Fields fieldId = _Fields.findByThriftId(field.id);
-
 
375
      if (fieldId == null) {
-
 
376
        TProtocolUtil.skip(iprot, field.type);
-
 
377
      } else {
-
 
378
        switch (fieldId) {
382
      switch (field.id) {
379
          case IS_ACTIVE:
383
        case 1: // IS_ACTIVE
380
            if (field.type == TType.BOOL) {
384
          if (field.type == org.apache.thrift.protocol.TType.BOOL) {
381
              this.isActive = iprot.readBool();
385
            this.isActive = iprot.readBool();
382
              setIsActiveIsSet(true);
386
            setIsActiveIsSet(true);
383
            } else { 
387
          } else { 
384
              TProtocolUtil.skip(iprot, field.type);
388
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
385
            }
389
          }
386
            break;
390
          break;
387
          case IS_RISKY:
391
        case 2: // IS_RISKY
388
            if (field.type == TType.BOOL) {
392
          if (field.type == org.apache.thrift.protocol.TType.BOOL) {
389
              this.isRisky = iprot.readBool();
393
            this.isRisky = iprot.readBool();
390
              setIsRiskyIsSet(true);
394
            setIsRiskyIsSet(true);
391
            } else { 
395
          } else { 
392
              TProtocolUtil.skip(iprot, field.type);
396
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
393
            }
397
          }
394
            break;
398
          break;
395
          case QUANTITY:
399
        case 3: // QUANTITY
396
            if (field.type == TType.I64) {
400
          if (field.type == org.apache.thrift.protocol.TType.I64) {
397
              this.quantity = iprot.readI64();
401
            this.quantity = iprot.readI64();
398
              setQuantityIsSet(true);
402
            setQuantityIsSet(true);
399
            } else { 
403
          } else { 
400
              TProtocolUtil.skip(iprot, field.type);
404
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
401
            }
405
          }
402
            break;
406
          break;
403
        }
407
        default:
404
        iprot.readFieldEnd();
408
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
405
      }
409
      }
-
 
410
      iprot.readFieldEnd();
406
    }
411
    }
407
    iprot.readStructEnd();
412
    iprot.readStructEnd();
408
    validate();
413
    validate();
409
  }
414
  }
410
 
415
 
411
  public void write(TProtocol oprot) throws TException {
416
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
412
    validate();
417
    validate();
413
 
418
 
414
    oprot.writeStructBegin(STRUCT_DESC);
419
    oprot.writeStructBegin(STRUCT_DESC);
415
    oprot.writeFieldBegin(IS_ACTIVE_FIELD_DESC);
420
    oprot.writeFieldBegin(IS_ACTIVE_FIELD_DESC);
416
    oprot.writeBool(this.isActive);
421
    oprot.writeBool(this.isActive);
Line 451... Line 456...
451
    }
456
    }
452
    sb.append(")");
457
    sb.append(")");
453
    return sb.toString();
458
    return sb.toString();
454
  }
459
  }
455
 
460
 
456
  public void validate() throws TException {
461
  public void validate() throws org.apache.thrift.TException {
457
    // check for required fields
462
    // check for required fields
458
  }
463
  }
459
 
464
 
-
 
465
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-
 
466
    try {
-
 
467
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-
 
468
    } catch (org.apache.thrift.TException te) {
-
 
469
      throw new java.io.IOException(te);
-
 
470
    }
-
 
471
  }
-
 
472
 
-
 
473
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-
 
474
    try {
-
 
475
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
-
 
476
      __isset_bit_vector = new BitSet(1);
-
 
477
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
-
 
478
    } catch (org.apache.thrift.TException te) {
-
 
479
      throw new java.io.IOException(te);
-
 
480
    }
-
 
481
  }
-
 
482
 
460
}
483
}
461
 
484