Subversion Repositories SmartDukaan

Rev

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

Rev 3430 Rev 5527
Line 24... Line 24...
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Provider");
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Provider");
25
 
25
 
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);
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);
27
  private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)2);
27
  private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)2);
28
  private static final org.apache.thrift.protocol.TField DETAILS_FIELD_DESC = new org.apache.thrift.protocol.TField("details", org.apache.thrift.protocol.TType.MAP, (short)3);
28
  private static final org.apache.thrift.protocol.TField DETAILS_FIELD_DESC = new org.apache.thrift.protocol.TField("details", org.apache.thrift.protocol.TType.MAP, (short)3);
-
 
29
  private static final org.apache.thrift.protocol.TField PICKUP_FIELD_DESC = new org.apache.thrift.protocol.TField("pickup", org.apache.thrift.protocol.TType.I32, (short)4);
29
 
30
 
30
  private long id; // required
31
  private long id; // required
31
  private String name; // required
32
  private String name; // required
32
  private Map<DeliveryType,ProviderDetails> details; // required
33
  private Map<DeliveryType,ProviderDetails> details; // required
-
 
34
  private PickUpType pickup; // required
33
 
35
 
34
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
36
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
35
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
37
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
36
    ID((short)1, "id"),
38
    ID((short)1, "id"),
37
    NAME((short)2, "name"),
39
    NAME((short)2, "name"),
38
    DETAILS((short)3, "details");
40
    DETAILS((short)3, "details"),
-
 
41
    /**
-
 
42
     * 
-
 
43
     * @see PickUpType
-
 
44
     */
-
 
45
    PICKUP((short)4, "pickup");
39
 
46
 
40
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
47
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
41
 
48
 
42
    static {
49
    static {
43
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
50
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
Line 54... Line 61...
54
          return ID;
61
          return ID;
55
        case 2: // NAME
62
        case 2: // NAME
56
          return NAME;
63
          return NAME;
57
        case 3: // DETAILS
64
        case 3: // DETAILS
58
          return DETAILS;
65
          return DETAILS;
-
 
66
        case 4: // PICKUP
-
 
67
          return PICKUP;
59
        default:
68
        default:
60
          return null;
69
          return null;
61
      }
70
      }
62
    }
71
    }
63
 
72
 
Line 108... Line 117...
108
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
117
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
109
    tmpMap.put(_Fields.DETAILS, new org.apache.thrift.meta_data.FieldMetaData("details", org.apache.thrift.TFieldRequirementType.DEFAULT, 
118
    tmpMap.put(_Fields.DETAILS, new org.apache.thrift.meta_data.FieldMetaData("details", org.apache.thrift.TFieldRequirementType.DEFAULT, 
110
        new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
119
        new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
111
            new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, DeliveryType.class), 
120
            new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, DeliveryType.class), 
112
            new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ProviderDetails.class))));
121
            new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ProviderDetails.class))));
-
 
122
    tmpMap.put(_Fields.PICKUP, new org.apache.thrift.meta_data.FieldMetaData("pickup", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
123
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, PickUpType.class)));
113
    metaDataMap = Collections.unmodifiableMap(tmpMap);
124
    metaDataMap = Collections.unmodifiableMap(tmpMap);
114
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Provider.class, metaDataMap);
125
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Provider.class, metaDataMap);
115
  }
126
  }
116
 
127
 
117
  public Provider() {
128
  public Provider() {
118
  }
129
  }
119
 
130
 
120
  public Provider(
131
  public Provider(
121
    long id,
132
    long id,
122
    String name,
133
    String name,
123
    Map<DeliveryType,ProviderDetails> details)
134
    Map<DeliveryType,ProviderDetails> details,
-
 
135
    PickUpType pickup)
124
  {
136
  {
125
    this();
137
    this();
126
    this.id = id;
138
    this.id = id;
127
    setIdIsSet(true);
139
    setIdIsSet(true);
128
    this.name = name;
140
    this.name = name;
129
    this.details = details;
141
    this.details = details;
-
 
142
    this.pickup = pickup;
130
  }
143
  }
131
 
144
 
132
  /**
145
  /**
133
   * Performs a deep copy on <i>other</i>.
146
   * Performs a deep copy on <i>other</i>.
134
   */
147
   */
Line 152... Line 165...
152
 
165
 
153
        __this__details.put(__this__details_copy_key, __this__details_copy_value);
166
        __this__details.put(__this__details_copy_key, __this__details_copy_value);
154
      }
167
      }
155
      this.details = __this__details;
168
      this.details = __this__details;
156
    }
169
    }
-
 
170
    if (other.isSetPickup()) {
-
 
171
      this.pickup = other.pickup;
-
 
172
    }
157
  }
173
  }
158
 
174
 
159
  public Provider deepCopy() {
175
  public Provider deepCopy() {
160
    return new Provider(this);
176
    return new Provider(this);
161
  }
177
  }
Line 164... Line 180...
164
  public void clear() {
180
  public void clear() {
165
    setIdIsSet(false);
181
    setIdIsSet(false);
166
    this.id = 0;
182
    this.id = 0;
167
    this.name = null;
183
    this.name = null;
168
    this.details = null;
184
    this.details = null;
-
 
185
    this.pickup = null;
169
  }
186
  }
170
 
187
 
171
  public long getId() {
188
  public long getId() {
172
    return this.id;
189
    return this.id;
173
  }
190
  }
Line 245... Line 262...
245
    if (!value) {
262
    if (!value) {
246
      this.details = null;
263
      this.details = null;
247
    }
264
    }
248
  }
265
  }
249
 
266
 
-
 
267
  /**
-
 
268
   * 
-
 
269
   * @see PickUpType
-
 
270
   */
-
 
271
  public PickUpType getPickup() {
-
 
272
    return this.pickup;
-
 
273
  }
-
 
274
 
-
 
275
  /**
-
 
276
   * 
-
 
277
   * @see PickUpType
-
 
278
   */
-
 
279
  public void setPickup(PickUpType pickup) {
-
 
280
    this.pickup = pickup;
-
 
281
  }
-
 
282
 
-
 
283
  public void unsetPickup() {
-
 
284
    this.pickup = null;
-
 
285
  }
-
 
286
 
-
 
287
  /** Returns true if field pickup is set (has been assigned a value) and false otherwise */
-
 
288
  public boolean isSetPickup() {
-
 
289
    return this.pickup != null;
-
 
290
  }
-
 
291
 
-
 
292
  public void setPickupIsSet(boolean value) {
-
 
293
    if (!value) {
-
 
294
      this.pickup = null;
-
 
295
    }
-
 
296
  }
-
 
297
 
250
  public void setFieldValue(_Fields field, Object value) {
298
  public void setFieldValue(_Fields field, Object value) {
251
    switch (field) {
299
    switch (field) {
252
    case ID:
300
    case ID:
253
      if (value == null) {
301
      if (value == null) {
254
        unsetId();
302
        unsetId();
Line 271... Line 319...
271
      } else {
319
      } else {
272
        setDetails((Map<DeliveryType,ProviderDetails>)value);
320
        setDetails((Map<DeliveryType,ProviderDetails>)value);
273
      }
321
      }
274
      break;
322
      break;
275
 
323
 
-
 
324
    case PICKUP:
-
 
325
      if (value == null) {
-
 
326
        unsetPickup();
-
 
327
      } else {
-
 
328
        setPickup((PickUpType)value);
-
 
329
      }
-
 
330
      break;
-
 
331
 
276
    }
332
    }
277
  }
333
  }
278
 
334
 
279
  public Object getFieldValue(_Fields field) {
335
  public Object getFieldValue(_Fields field) {
280
    switch (field) {
336
    switch (field) {
Line 285... Line 341...
285
      return getName();
341
      return getName();
286
 
342
 
287
    case DETAILS:
343
    case DETAILS:
288
      return getDetails();
344
      return getDetails();
289
 
345
 
-
 
346
    case PICKUP:
-
 
347
      return getPickup();
-
 
348
 
290
    }
349
    }
291
    throw new IllegalStateException();
350
    throw new IllegalStateException();
292
  }
351
  }
293
 
352
 
294
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
353
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
Line 302... Line 361...
302
      return isSetId();
361
      return isSetId();
303
    case NAME:
362
    case NAME:
304
      return isSetName();
363
      return isSetName();
305
    case DETAILS:
364
    case DETAILS:
306
      return isSetDetails();
365
      return isSetDetails();
-
 
366
    case PICKUP:
-
 
367
      return isSetPickup();
307
    }
368
    }
308
    throw new IllegalStateException();
369
    throw new IllegalStateException();
309
  }
370
  }
310
 
371
 
311
  @Override
372
  @Override
Line 346... Line 407...
346
        return false;
407
        return false;
347
      if (!this.details.equals(that.details))
408
      if (!this.details.equals(that.details))
348
        return false;
409
        return false;
349
    }
410
    }
350
 
411
 
-
 
412
    boolean this_present_pickup = true && this.isSetPickup();
-
 
413
    boolean that_present_pickup = true && that.isSetPickup();
-
 
414
    if (this_present_pickup || that_present_pickup) {
-
 
415
      if (!(this_present_pickup && that_present_pickup))
-
 
416
        return false;
-
 
417
      if (!this.pickup.equals(that.pickup))
-
 
418
        return false;
-
 
419
    }
-
 
420
 
351
    return true;
421
    return true;
352
  }
422
  }
353
 
423
 
354
  @Override
424
  @Override
355
  public int hashCode() {
425
  public int hashCode() {
Line 392... Line 462...
392
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.details, typedOther.details);
462
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.details, typedOther.details);
393
      if (lastComparison != 0) {
463
      if (lastComparison != 0) {
394
        return lastComparison;
464
        return lastComparison;
395
      }
465
      }
396
    }
466
    }
-
 
467
    lastComparison = Boolean.valueOf(isSetPickup()).compareTo(typedOther.isSetPickup());
-
 
468
    if (lastComparison != 0) {
-
 
469
      return lastComparison;
-
 
470
    }
-
 
471
    if (isSetPickup()) {
-
 
472
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pickup, typedOther.pickup);
-
 
473
      if (lastComparison != 0) {
-
 
474
        return lastComparison;
-
 
475
      }
-
 
476
    }
397
    return 0;
477
    return 0;
398
  }
478
  }
399
 
479
 
400
  public _Fields fieldForId(int fieldId) {
480
  public _Fields fieldForId(int fieldId) {
401
    return _Fields.findByThriftId(fieldId);
481
    return _Fields.findByThriftId(fieldId);
Line 444... Line 524...
444
            }
524
            }
445
          } else { 
525
          } else { 
446
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
526
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
447
          }
527
          }
448
          break;
528
          break;
-
 
529
        case 4: // PICKUP
-
 
530
          if (field.type == org.apache.thrift.protocol.TType.I32) {
-
 
531
            this.pickup = PickUpType.findByValue(iprot.readI32());
-
 
532
          } else { 
-
 
533
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
534
          }
-
 
535
          break;
449
        default:
536
        default:
450
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
537
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
451
      }
538
      }
452
      iprot.readFieldEnd();
539
      iprot.readFieldEnd();
453
    }
540
    }
Line 478... Line 565...
478
        }
565
        }
479
        oprot.writeMapEnd();
566
        oprot.writeMapEnd();
480
      }
567
      }
481
      oprot.writeFieldEnd();
568
      oprot.writeFieldEnd();
482
    }
569
    }
-
 
570
    if (this.pickup != null) {
-
 
571
      oprot.writeFieldBegin(PICKUP_FIELD_DESC);
-
 
572
      oprot.writeI32(this.pickup.getValue());
-
 
573
      oprot.writeFieldEnd();
-
 
574
    }
483
    oprot.writeFieldStop();
575
    oprot.writeFieldStop();
484
    oprot.writeStructEnd();
576
    oprot.writeStructEnd();
485
  }
577
  }
486
 
578
 
487
  @Override
579
  @Override
Line 506... Line 598...
506
      sb.append("null");
598
      sb.append("null");
507
    } else {
599
    } else {
508
      sb.append(this.details);
600
      sb.append(this.details);
509
    }
601
    }
510
    first = false;
602
    first = false;
-
 
603
    if (!first) sb.append(", ");
-
 
604
    sb.append("pickup:");
-
 
605
    if (this.pickup == null) {
-
 
606
      sb.append("null");
-
 
607
    } else {
-
 
608
      sb.append(this.pickup);
-
 
609
    }
-
 
610
    first = false;
511
    sb.append(")");
611
    sb.append(")");
512
    return sb.toString();
612
    return sb.toString();
513
  }
613
  }
514
 
614
 
515
  public void validate() throws org.apache.thrift.TException {
615
  public void validate() throws org.apache.thrift.TException {