Subversion Repositories SmartDukaan

Rev

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

Rev 1891 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.utils;
6
package in.shop2020.utils;
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 Report implements TBase<Report._Fields>, java.io.Serializable, Cloneable, Comparable<Report> {
23
public class Report implements org.apache.thrift.TBase<Report, Report._Fields>, java.io.Serializable, Cloneable {
27
  private static final TStruct STRUCT_DESC = new TStruct("Report");
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Report");
28
 
25
 
29
  private static final TField ID_FIELD_DESC = new TField("id", TType.I64, (short)1);
26
  private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I64, (short)1);
30
  private static final TField DESCRIPTION_FIELD_DESC = new TField("description", TType.STRING, (short)2);
27
  private static final org.apache.thrift.protocol.TField DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("description", org.apache.thrift.protocol.TType.STRING, (short)2);
31
  private static final TField CONTROLLER_FIELD_DESC = new TField("controller", TType.STRING, (short)3);
28
  private static final org.apache.thrift.protocol.TField CONTROLLER_FIELD_DESC = new org.apache.thrift.protocol.TField("controller", org.apache.thrift.protocol.TType.STRING, (short)3);
32
 
29
 
33
  private long id;
30
  private long id; // required
34
  private String description;
31
  private String description; // required
35
  private String controller;
32
  private String controller; // 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
    ID((short)1, "id"),
36
    ID((short)1, "id"),
40
    DESCRIPTION((short)2, "description"),
37
    DESCRIPTION((short)2, "description"),
41
    CONTROLLER((short)3, "controller");
38
    CONTROLLER((short)3, "controller");
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: // ID
-
 
54
          return ID;
-
 
55
        case 2: // DESCRIPTION
-
 
56
          return DESCRIPTION;
-
 
57
        case 3: // CONTROLLER
-
 
58
          return CONTROLLER;
-
 
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 93... Line 97...
93
 
97
 
94
  // isset id assignments
98
  // isset id assignments
95
  private static final int __ID_ISSET_ID = 0;
99
  private static final int __ID_ISSET_ID = 0;
96
  private BitSet __isset_bit_vector = new BitSet(1);
100
  private BitSet __isset_bit_vector = new BitSet(1);
97
 
101
 
98
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
102
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
99
    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
-
 
100
        new FieldValueMetaData(TType.I64)));
-
 
101
    put(_Fields.DESCRIPTION, new FieldMetaData("description", TFieldRequirementType.DEFAULT, 
-
 
102
        new FieldValueMetaData(TType.STRING)));
-
 
103
    put(_Fields.CONTROLLER, new FieldMetaData("controller", TFieldRequirementType.DEFAULT, 
-
 
104
        new FieldValueMetaData(TType.STRING)));
-
 
105
  }});
-
 
106
 
-
 
107
  static {
103
  static {
-
 
104
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-
 
105
    tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
106
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-
 
107
    tmpMap.put(_Fields.DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("description", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
108
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-
 
109
    tmpMap.put(_Fields.CONTROLLER, new org.apache.thrift.meta_data.FieldMetaData("controller", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
110
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-
 
111
    metaDataMap = Collections.unmodifiableMap(tmpMap);
108
    FieldMetaData.addStructMetaDataMap(Report.class, metaDataMap);
112
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Report.class, metaDataMap);
109
  }
113
  }
110
 
114
 
111
  public Report() {
115
  public Report() {
112
  }
116
  }
113
 
117
 
Line 140... Line 144...
140
 
144
 
141
  public Report deepCopy() {
145
  public Report deepCopy() {
142
    return new Report(this);
146
    return new Report(this);
143
  }
147
  }
144
 
148
 
145
  @Deprecated
149
  @Override
146
  public Report clone() {
150
  public void clear() {
147
    return new Report(this);
151
    setIdIsSet(false);
-
 
152
    this.id = 0;
-
 
153
    this.description = null;
-
 
154
    this.controller = null;
148
  }
155
  }
149
 
156
 
150
  public long getId() {
157
  public long getId() {
151
    return this.id;
158
    return this.id;
152
  }
159
  }
153
 
160
 
154
  public Report setId(long id) {
161
  public void setId(long id) {
155
    this.id = id;
162
    this.id = id;
156
    setIdIsSet(true);
163
    setIdIsSet(true);
157
    return this;
-
 
158
  }
164
  }
159
 
165
 
160
  public void unsetId() {
166
  public void unsetId() {
161
    __isset_bit_vector.clear(__ID_ISSET_ID);
167
    __isset_bit_vector.clear(__ID_ISSET_ID);
162
  }
168
  }
163
 
169
 
164
  /** Returns true if field id is set (has been asigned a value) and false otherwise */
170
  /** Returns true if field id is set (has been assigned a value) and false otherwise */
165
  public boolean isSetId() {
171
  public boolean isSetId() {
166
    return __isset_bit_vector.get(__ID_ISSET_ID);
172
    return __isset_bit_vector.get(__ID_ISSET_ID);
167
  }
173
  }
168
 
174
 
169
  public void setIdIsSet(boolean value) {
175
  public void setIdIsSet(boolean value) {
Line 172... Line 178...
172
 
178
 
173
  public String getDescription() {
179
  public String getDescription() {
174
    return this.description;
180
    return this.description;
175
  }
181
  }
176
 
182
 
177
  public Report setDescription(String description) {
183
  public void setDescription(String description) {
178
    this.description = description;
184
    this.description = description;
179
    return this;
-
 
180
  }
185
  }
181
 
186
 
182
  public void unsetDescription() {
187
  public void unsetDescription() {
183
    this.description = null;
188
    this.description = null;
184
  }
189
  }
185
 
190
 
186
  /** Returns true if field description is set (has been asigned a value) and false otherwise */
191
  /** Returns true if field description is set (has been assigned a value) and false otherwise */
187
  public boolean isSetDescription() {
192
  public boolean isSetDescription() {
188
    return this.description != null;
193
    return this.description != null;
189
  }
194
  }
190
 
195
 
191
  public void setDescriptionIsSet(boolean value) {
196
  public void setDescriptionIsSet(boolean value) {
Line 196... Line 201...
196
 
201
 
197
  public String getController() {
202
  public String getController() {
198
    return this.controller;
203
    return this.controller;
199
  }
204
  }
200
 
205
 
201
  public Report setController(String controller) {
206
  public void setController(String controller) {
202
    this.controller = controller;
207
    this.controller = controller;
203
    return this;
-
 
204
  }
208
  }
205
 
209
 
206
  public void unsetController() {
210
  public void unsetController() {
207
    this.controller = null;
211
    this.controller = null;
208
  }
212
  }
209
 
213
 
210
  /** Returns true if field controller is set (has been asigned a value) and false otherwise */
214
  /** Returns true if field controller is set (has been assigned a value) and false otherwise */
211
  public boolean isSetController() {
215
  public boolean isSetController() {
212
    return this.controller != null;
216
    return this.controller != null;
213
  }
217
  }
214
 
218
 
215
  public void setControllerIsSet(boolean value) {
219
  public void setControllerIsSet(boolean value) {
Line 245... Line 249...
245
      break;
249
      break;
246
 
250
 
247
    }
251
    }
248
  }
252
  }
249
 
253
 
250
  public void setFieldValue(int fieldID, Object value) {
-
 
251
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-
 
252
  }
-
 
253
 
-
 
254
  public Object getFieldValue(_Fields field) {
254
  public Object getFieldValue(_Fields field) {
255
    switch (field) {
255
    switch (field) {
256
    case ID:
256
    case ID:
257
      return new Long(getId());
257
      return Long.valueOf(getId());
258
 
258
 
259
    case DESCRIPTION:
259
    case DESCRIPTION:
260
      return getDescription();
260
      return getDescription();
261
 
261
 
262
    case CONTROLLER:
262
    case CONTROLLER:
Line 264... Line 264...
264
 
264
 
265
    }
265
    }
266
    throw new IllegalStateException();
266
    throw new IllegalStateException();
267
  }
267
  }
268
 
268
 
269
  public Object getFieldValue(int fieldId) {
-
 
270
    return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-
 
271
  }
-
 
272
 
-
 
273
  /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
269
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
274
  public boolean isSet(_Fields field) {
270
  public boolean isSet(_Fields field) {
-
 
271
    if (field == null) {
-
 
272
      throw new IllegalArgumentException();
-
 
273
    }
-
 
274
 
275
    switch (field) {
275
    switch (field) {
276
    case ID:
276
    case ID:
277
      return isSetId();
277
      return isSetId();
278
    case DESCRIPTION:
278
    case DESCRIPTION:
279
      return isSetDescription();
279
      return isSetDescription();
Line 281... Line 281...
281
      return isSetController();
281
      return isSetController();
282
    }
282
    }
283
    throw new IllegalStateException();
283
    throw new IllegalStateException();
284
  }
284
  }
285
 
285
 
286
  public boolean isSet(int fieldID) {
-
 
287
    return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-
 
288
  }
-
 
289
 
-
 
290
  @Override
286
  @Override
291
  public boolean equals(Object that) {
287
  public boolean equals(Object that) {
292
    if (that == null)
288
    if (that == null)
293
      return false;
289
      return false;
294
    if (that instanceof Report)
290
    if (that instanceof Report)
Line 341... Line 337...
341
    }
337
    }
342
 
338
 
343
    int lastComparison = 0;
339
    int lastComparison = 0;
344
    Report typedOther = (Report)other;
340
    Report typedOther = (Report)other;
345
 
341
 
346
    lastComparison = Boolean.valueOf(isSetId()).compareTo(isSetId());
342
    lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
347
    if (lastComparison != 0) {
343
    if (lastComparison != 0) {
348
      return lastComparison;
344
      return lastComparison;
349
    }
345
    }
-
 
346
    if (isSetId()) {
350
    lastComparison = TBaseHelper.compareTo(id, typedOther.id);
347
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
351
    if (lastComparison != 0) {
348
      if (lastComparison != 0) {
352
      return lastComparison;
349
        return lastComparison;
-
 
350
      }
353
    }
351
    }
354
    lastComparison = Boolean.valueOf(isSetDescription()).compareTo(isSetDescription());
352
    lastComparison = Boolean.valueOf(isSetDescription()).compareTo(typedOther.isSetDescription());
355
    if (lastComparison != 0) {
353
    if (lastComparison != 0) {
356
      return lastComparison;
354
      return lastComparison;
357
    }
355
    }
-
 
356
    if (isSetDescription()) {
358
    lastComparison = TBaseHelper.compareTo(description, typedOther.description);
357
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.description, typedOther.description);
359
    if (lastComparison != 0) {
358
      if (lastComparison != 0) {
360
      return lastComparison;
359
        return lastComparison;
-
 
360
      }
361
    }
361
    }
362
    lastComparison = Boolean.valueOf(isSetController()).compareTo(isSetController());
362
    lastComparison = Boolean.valueOf(isSetController()).compareTo(typedOther.isSetController());
363
    if (lastComparison != 0) {
363
    if (lastComparison != 0) {
364
      return lastComparison;
364
      return lastComparison;
365
    }
365
    }
-
 
366
    if (isSetController()) {
366
    lastComparison = TBaseHelper.compareTo(controller, typedOther.controller);
367
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.controller, typedOther.controller);
367
    if (lastComparison != 0) {
368
      if (lastComparison != 0) {
368
      return lastComparison;
369
        return lastComparison;
-
 
370
      }
369
    }
371
    }
370
    return 0;
372
    return 0;
371
  }
373
  }
372
 
374
 
-
 
375
  public _Fields fieldForId(int fieldId) {
-
 
376
    return _Fields.findByThriftId(fieldId);
-
 
377
  }
-
 
378
 
373
  public void read(TProtocol iprot) throws TException {
379
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
374
    TField field;
380
    org.apache.thrift.protocol.TField field;
375
    iprot.readStructBegin();
381
    iprot.readStructBegin();
376
    while (true)
382
    while (true)
377
    {
383
    {
378
      field = iprot.readFieldBegin();
384
      field = iprot.readFieldBegin();
379
      if (field.type == TType.STOP) { 
385
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
380
        break;
386
        break;
381
      }
387
      }
382
      _Fields fieldId = _Fields.findByThriftId(field.id);
-
 
383
      if (fieldId == null) {
-
 
384
        TProtocolUtil.skip(iprot, field.type);
-
 
385
      } else {
-
 
386
        switch (fieldId) {
388
      switch (field.id) {
387
          case ID:
389
        case 1: // ID
388
            if (field.type == TType.I64) {
390
          if (field.type == org.apache.thrift.protocol.TType.I64) {
389
              this.id = iprot.readI64();
391
            this.id = iprot.readI64();
390
              setIdIsSet(true);
392
            setIdIsSet(true);
391
            } else { 
393
          } else { 
392
              TProtocolUtil.skip(iprot, field.type);
394
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
393
            }
395
          }
394
            break;
396
          break;
395
          case DESCRIPTION:
397
        case 2: // DESCRIPTION
396
            if (field.type == TType.STRING) {
398
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
397
              this.description = iprot.readString();
399
            this.description = iprot.readString();
398
            } else { 
400
          } else { 
399
              TProtocolUtil.skip(iprot, field.type);
401
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
400
            }
402
          }
401
            break;
403
          break;
402
          case CONTROLLER:
404
        case 3: // CONTROLLER
403
            if (field.type == TType.STRING) {
405
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
404
              this.controller = iprot.readString();
406
            this.controller = iprot.readString();
405
            } else { 
407
          } else { 
406
              TProtocolUtil.skip(iprot, field.type);
408
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
407
            }
409
          }
408
            break;
410
          break;
409
        }
411
        default:
410
        iprot.readFieldEnd();
412
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
411
      }
413
      }
-
 
414
      iprot.readFieldEnd();
412
    }
415
    }
413
    iprot.readStructEnd();
416
    iprot.readStructEnd();
414
    validate();
417
    validate();
415
  }
418
  }
416
 
419
 
417
  public void write(TProtocol oprot) throws TException {
420
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
418
    validate();
421
    validate();
419
 
422
 
420
    oprot.writeStructBegin(STRUCT_DESC);
423
    oprot.writeStructBegin(STRUCT_DESC);
421
    oprot.writeFieldBegin(ID_FIELD_DESC);
424
    oprot.writeFieldBegin(ID_FIELD_DESC);
422
    oprot.writeI64(this.id);
425
    oprot.writeI64(this.id);
Line 461... Line 464...
461
    first = false;
464
    first = false;
462
    sb.append(")");
465
    sb.append(")");
463
    return sb.toString();
466
    return sb.toString();
464
  }
467
  }
465
 
468
 
466
  public void validate() throws TException {
469
  public void validate() throws org.apache.thrift.TException {
467
    // check for required fields
470
    // check for required fields
468
  }
471
  }
469
 
472
 
-
 
473
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-
 
474
    try {
-
 
475
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-
 
476
    } catch (org.apache.thrift.TException te) {
-
 
477
      throw new java.io.IOException(te);
-
 
478
    }
-
 
479
  }
-
 
480
 
-
 
481
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-
 
482
    try {
-
 
483
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
-
 
484
      __isset_bit_vector = new BitSet(1);
-
 
485
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
-
 
486
    } catch (org.apache.thrift.TException te) {
-
 
487
      throw new java.io.IOException(te);
-
 
488
    }
-
 
489
  }
-
 
490
 
470
}
491
}
471
 
492