Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
412 ashish 1
/**
3430 rajveer 2
 * Autogenerated by Thrift Compiler (0.7.0)
412 ashish 3
 *
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
 */
6
package in.shop2020.logistics;
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;
3430 rajveer 18
import java.nio.ByteBuffer;
412 ashish 19
import java.util.Arrays;
20
import org.slf4j.Logger;
21
import org.slf4j.LoggerFactory;
22
 
3430 rajveer 23
public class Provider implements org.apache.thrift.TBase<Provider, Provider._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Provider");
412 ashish 25
 
3430 rajveer 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);
7792 anupam.sin 28
  private static final org.apache.thrift.protocol.TField DETAILS_FIELD_DESC = new org.apache.thrift.protocol.TField("details", org.apache.thrift.protocol.TType.LIST, (short)3);
5527 anupam.sin 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);
13146 manish.sha 30
  private static final org.apache.thrift.protocol.TField BUNDLE_WEIGHT_LIMIT_FIELD_DESC = new org.apache.thrift.protocol.TField("bundleWeightLimit", org.apache.thrift.protocol.TType.DOUBLE, (short)5);
31
  private static final org.apache.thrift.protocol.TField GROUP_SHIPMENT_ALLOWED_FIELD_DESC = new org.apache.thrift.protocol.TField("groupShipmentAllowed", org.apache.thrift.protocol.TType.BOOL, (short)6);
32
  private static final org.apache.thrift.protocol.TField MAX_COD_LIMIT_FIELD_DESC = new org.apache.thrift.protocol.TField("maxCodLimit", org.apache.thrift.protocol.TType.DOUBLE, (short)7);
412 ashish 33
 
3430 rajveer 34
  private long id; // required
35
  private String name; // required
7792 anupam.sin 36
  private List<ProviderDetails> details; // required
5527 anupam.sin 37
  private PickUpType pickup; // required
13146 manish.sha 38
  private double bundleWeightLimit; // required
39
  private boolean groupShipmentAllowed; // required
40
  private double maxCodLimit; // required
412 ashish 41
 
42
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 43
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
412 ashish 44
    ID((short)1, "id"),
668 chandransh 45
    NAME((short)2, "name"),
5527 anupam.sin 46
    DETAILS((short)3, "details"),
47
    /**
48
     * 
49
     * @see PickUpType
50
     */
13146 manish.sha 51
    PICKUP((short)4, "pickup"),
52
    BUNDLE_WEIGHT_LIMIT((short)5, "bundleWeightLimit"),
53
    GROUP_SHIPMENT_ALLOWED((short)6, "groupShipmentAllowed"),
54
    MAX_COD_LIMIT((short)7, "maxCodLimit");
412 ashish 55
 
56
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
57
 
58
    static {
59
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
60
        byName.put(field.getFieldName(), field);
61
      }
62
    }
63
 
64
    /**
65
     * Find the _Fields constant that matches fieldId, or null if its not found.
66
     */
67
    public static _Fields findByThriftId(int fieldId) {
3430 rajveer 68
      switch(fieldId) {
69
        case 1: // ID
70
          return ID;
71
        case 2: // NAME
72
          return NAME;
73
        case 3: // DETAILS
74
          return DETAILS;
5527 anupam.sin 75
        case 4: // PICKUP
76
          return PICKUP;
13146 manish.sha 77
        case 5: // BUNDLE_WEIGHT_LIMIT
78
          return BUNDLE_WEIGHT_LIMIT;
79
        case 6: // GROUP_SHIPMENT_ALLOWED
80
          return GROUP_SHIPMENT_ALLOWED;
81
        case 7: // MAX_COD_LIMIT
82
          return MAX_COD_LIMIT;
3430 rajveer 83
        default:
84
          return null;
85
      }
412 ashish 86
    }
87
 
88
    /**
89
     * Find the _Fields constant that matches fieldId, throwing an exception
90
     * if it is not found.
91
     */
92
    public static _Fields findByThriftIdOrThrow(int fieldId) {
93
      _Fields fields = findByThriftId(fieldId);
94
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
95
      return fields;
96
    }
97
 
98
    /**
99
     * Find the _Fields constant that matches name, or null if its not found.
100
     */
101
    public static _Fields findByName(String name) {
102
      return byName.get(name);
103
    }
104
 
105
    private final short _thriftId;
106
    private final String _fieldName;
107
 
108
    _Fields(short thriftId, String fieldName) {
109
      _thriftId = thriftId;
110
      _fieldName = fieldName;
111
    }
112
 
113
    public short getThriftFieldId() {
114
      return _thriftId;
115
    }
116
 
117
    public String getFieldName() {
118
      return _fieldName;
119
    }
120
  }
121
 
122
  // isset id assignments
123
  private static final int __ID_ISSET_ID = 0;
13146 manish.sha 124
  private static final int __BUNDLEWEIGHTLIMIT_ISSET_ID = 1;
125
  private static final int __GROUPSHIPMENTALLOWED_ISSET_ID = 2;
126
  private static final int __MAXCODLIMIT_ISSET_ID = 3;
127
  private BitSet __isset_bit_vector = new BitSet(4);
412 ashish 128
 
3430 rajveer 129
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
412 ashish 130
  static {
3430 rajveer 131
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
132
    tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
133
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
134
    tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, 
135
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
136
    tmpMap.put(_Fields.DETAILS, new org.apache.thrift.meta_data.FieldMetaData("details", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7792 anupam.sin 137
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
3430 rajveer 138
            new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ProviderDetails.class))));
5527 anupam.sin 139
    tmpMap.put(_Fields.PICKUP, new org.apache.thrift.meta_data.FieldMetaData("pickup", org.apache.thrift.TFieldRequirementType.DEFAULT, 
140
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, PickUpType.class)));
13146 manish.sha 141
    tmpMap.put(_Fields.BUNDLE_WEIGHT_LIMIT, new org.apache.thrift.meta_data.FieldMetaData("bundleWeightLimit", org.apache.thrift.TFieldRequirementType.DEFAULT, 
142
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
143
    tmpMap.put(_Fields.GROUP_SHIPMENT_ALLOWED, new org.apache.thrift.meta_data.FieldMetaData("groupShipmentAllowed", org.apache.thrift.TFieldRequirementType.DEFAULT, 
144
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
145
    tmpMap.put(_Fields.MAX_COD_LIMIT, new org.apache.thrift.meta_data.FieldMetaData("maxCodLimit", org.apache.thrift.TFieldRequirementType.DEFAULT, 
146
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
3430 rajveer 147
    metaDataMap = Collections.unmodifiableMap(tmpMap);
148
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Provider.class, metaDataMap);
412 ashish 149
  }
150
 
151
  public Provider() {
152
  }
153
 
154
  public Provider(
155
    long id,
668 chandransh 156
    String name,
7792 anupam.sin 157
    List<ProviderDetails> details,
13146 manish.sha 158
    PickUpType pickup,
159
    double bundleWeightLimit,
160
    boolean groupShipmentAllowed,
161
    double maxCodLimit)
412 ashish 162
  {
163
    this();
164
    this.id = id;
165
    setIdIsSet(true);
166
    this.name = name;
3044 chandransh 167
    this.details = details;
5527 anupam.sin 168
    this.pickup = pickup;
13146 manish.sha 169
    this.bundleWeightLimit = bundleWeightLimit;
170
    setBundleWeightLimitIsSet(true);
171
    this.groupShipmentAllowed = groupShipmentAllowed;
172
    setGroupShipmentAllowedIsSet(true);
173
    this.maxCodLimit = maxCodLimit;
174
    setMaxCodLimitIsSet(true);
412 ashish 175
  }
176
 
177
  /**
178
   * Performs a deep copy on <i>other</i>.
179
   */
180
  public Provider(Provider other) {
181
    __isset_bit_vector.clear();
182
    __isset_bit_vector.or(other.__isset_bit_vector);
183
    this.id = other.id;
184
    if (other.isSetName()) {
185
      this.name = other.name;
186
    }
3044 chandransh 187
    if (other.isSetDetails()) {
7792 anupam.sin 188
      List<ProviderDetails> __this__details = new ArrayList<ProviderDetails>();
189
      for (ProviderDetails other_element : other.details) {
190
        __this__details.add(new ProviderDetails(other_element));
3044 chandransh 191
      }
192
      this.details = __this__details;
668 chandransh 193
    }
5527 anupam.sin 194
    if (other.isSetPickup()) {
195
      this.pickup = other.pickup;
196
    }
13146 manish.sha 197
    this.bundleWeightLimit = other.bundleWeightLimit;
198
    this.groupShipmentAllowed = other.groupShipmentAllowed;
199
    this.maxCodLimit = other.maxCodLimit;
412 ashish 200
  }
201
 
202
  public Provider deepCopy() {
203
    return new Provider(this);
204
  }
205
 
3430 rajveer 206
  @Override
207
  public void clear() {
208
    setIdIsSet(false);
209
    this.id = 0;
210
    this.name = null;
211
    this.details = null;
5527 anupam.sin 212
    this.pickup = null;
13146 manish.sha 213
    setBundleWeightLimitIsSet(false);
214
    this.bundleWeightLimit = 0.0;
215
    setGroupShipmentAllowedIsSet(false);
216
    this.groupShipmentAllowed = false;
217
    setMaxCodLimitIsSet(false);
218
    this.maxCodLimit = 0.0;
412 ashish 219
  }
220
 
221
  public long getId() {
222
    return this.id;
223
  }
224
 
3430 rajveer 225
  public void setId(long id) {
412 ashish 226
    this.id = id;
227
    setIdIsSet(true);
228
  }
229
 
230
  public void unsetId() {
231
    __isset_bit_vector.clear(__ID_ISSET_ID);
232
  }
233
 
3430 rajveer 234
  /** Returns true if field id is set (has been assigned a value) and false otherwise */
412 ashish 235
  public boolean isSetId() {
236
    return __isset_bit_vector.get(__ID_ISSET_ID);
237
  }
238
 
239
  public void setIdIsSet(boolean value) {
240
    __isset_bit_vector.set(__ID_ISSET_ID, value);
241
  }
242
 
243
  public String getName() {
244
    return this.name;
245
  }
246
 
3430 rajveer 247
  public void setName(String name) {
412 ashish 248
    this.name = name;
249
  }
250
 
251
  public void unsetName() {
252
    this.name = null;
253
  }
254
 
3430 rajveer 255
  /** Returns true if field name is set (has been assigned a value) and false otherwise */
412 ashish 256
  public boolean isSetName() {
257
    return this.name != null;
258
  }
259
 
260
  public void setNameIsSet(boolean value) {
261
    if (!value) {
262
      this.name = null;
263
    }
264
  }
265
 
3044 chandransh 266
  public int getDetailsSize() {
267
    return (this.details == null) ? 0 : this.details.size();
668 chandransh 268
  }
269
 
7792 anupam.sin 270
  public java.util.Iterator<ProviderDetails> getDetailsIterator() {
271
    return (this.details == null) ? null : this.details.iterator();
272
  }
273
 
274
  public void addToDetails(ProviderDetails elem) {
3044 chandransh 275
    if (this.details == null) {
7792 anupam.sin 276
      this.details = new ArrayList<ProviderDetails>();
668 chandransh 277
    }
7792 anupam.sin 278
    this.details.add(elem);
668 chandransh 279
  }
280
 
7792 anupam.sin 281
  public List<ProviderDetails> getDetails() {
3044 chandransh 282
    return this.details;
2515 chandransh 283
  }
284
 
7792 anupam.sin 285
  public void setDetails(List<ProviderDetails> details) {
3044 chandransh 286
    this.details = details;
2515 chandransh 287
  }
288
 
3044 chandransh 289
  public void unsetDetails() {
290
    this.details = null;
2515 chandransh 291
  }
292
 
3430 rajveer 293
  /** Returns true if field details is set (has been assigned a value) and false otherwise */
3044 chandransh 294
  public boolean isSetDetails() {
295
    return this.details != null;
2515 chandransh 296
  }
297
 
3044 chandransh 298
  public void setDetailsIsSet(boolean value) {
2515 chandransh 299
    if (!value) {
3044 chandransh 300
      this.details = null;
2515 chandransh 301
    }
302
  }
303
 
5527 anupam.sin 304
  /**
305
   * 
306
   * @see PickUpType
307
   */
308
  public PickUpType getPickup() {
309
    return this.pickup;
310
  }
311
 
312
  /**
313
   * 
314
   * @see PickUpType
315
   */
316
  public void setPickup(PickUpType pickup) {
317
    this.pickup = pickup;
318
  }
319
 
320
  public void unsetPickup() {
321
    this.pickup = null;
322
  }
323
 
324
  /** Returns true if field pickup is set (has been assigned a value) and false otherwise */
325
  public boolean isSetPickup() {
326
    return this.pickup != null;
327
  }
328
 
329
  public void setPickupIsSet(boolean value) {
330
    if (!value) {
331
      this.pickup = null;
332
    }
333
  }
334
 
13146 manish.sha 335
  public double getBundleWeightLimit() {
336
    return this.bundleWeightLimit;
337
  }
338
 
339
  public void setBundleWeightLimit(double bundleWeightLimit) {
340
    this.bundleWeightLimit = bundleWeightLimit;
341
    setBundleWeightLimitIsSet(true);
342
  }
343
 
344
  public void unsetBundleWeightLimit() {
345
    __isset_bit_vector.clear(__BUNDLEWEIGHTLIMIT_ISSET_ID);
346
  }
347
 
348
  /** Returns true if field bundleWeightLimit is set (has been assigned a value) and false otherwise */
349
  public boolean isSetBundleWeightLimit() {
350
    return __isset_bit_vector.get(__BUNDLEWEIGHTLIMIT_ISSET_ID);
351
  }
352
 
353
  public void setBundleWeightLimitIsSet(boolean value) {
354
    __isset_bit_vector.set(__BUNDLEWEIGHTLIMIT_ISSET_ID, value);
355
  }
356
 
357
  public boolean isGroupShipmentAllowed() {
358
    return this.groupShipmentAllowed;
359
  }
360
 
361
  public void setGroupShipmentAllowed(boolean groupShipmentAllowed) {
362
    this.groupShipmentAllowed = groupShipmentAllowed;
363
    setGroupShipmentAllowedIsSet(true);
364
  }
365
 
366
  public void unsetGroupShipmentAllowed() {
367
    __isset_bit_vector.clear(__GROUPSHIPMENTALLOWED_ISSET_ID);
368
  }
369
 
370
  /** Returns true if field groupShipmentAllowed is set (has been assigned a value) and false otherwise */
371
  public boolean isSetGroupShipmentAllowed() {
372
    return __isset_bit_vector.get(__GROUPSHIPMENTALLOWED_ISSET_ID);
373
  }
374
 
375
  public void setGroupShipmentAllowedIsSet(boolean value) {
376
    __isset_bit_vector.set(__GROUPSHIPMENTALLOWED_ISSET_ID, value);
377
  }
378
 
379
  public double getMaxCodLimit() {
380
    return this.maxCodLimit;
381
  }
382
 
383
  public void setMaxCodLimit(double maxCodLimit) {
384
    this.maxCodLimit = maxCodLimit;
385
    setMaxCodLimitIsSet(true);
386
  }
387
 
388
  public void unsetMaxCodLimit() {
389
    __isset_bit_vector.clear(__MAXCODLIMIT_ISSET_ID);
390
  }
391
 
392
  /** Returns true if field maxCodLimit is set (has been assigned a value) and false otherwise */
393
  public boolean isSetMaxCodLimit() {
394
    return __isset_bit_vector.get(__MAXCODLIMIT_ISSET_ID);
395
  }
396
 
397
  public void setMaxCodLimitIsSet(boolean value) {
398
    __isset_bit_vector.set(__MAXCODLIMIT_ISSET_ID, value);
399
  }
400
 
412 ashish 401
  public void setFieldValue(_Fields field, Object value) {
402
    switch (field) {
403
    case ID:
404
      if (value == null) {
405
        unsetId();
406
      } else {
407
        setId((Long)value);
408
      }
409
      break;
410
 
411
    case NAME:
412
      if (value == null) {
413
        unsetName();
414
      } else {
415
        setName((String)value);
416
      }
417
      break;
418
 
3044 chandransh 419
    case DETAILS:
668 chandransh 420
      if (value == null) {
3044 chandransh 421
        unsetDetails();
668 chandransh 422
      } else {
7792 anupam.sin 423
        setDetails((List<ProviderDetails>)value);
668 chandransh 424
      }
425
      break;
426
 
5527 anupam.sin 427
    case PICKUP:
428
      if (value == null) {
429
        unsetPickup();
430
      } else {
431
        setPickup((PickUpType)value);
432
      }
433
      break;
434
 
13146 manish.sha 435
    case BUNDLE_WEIGHT_LIMIT:
436
      if (value == null) {
437
        unsetBundleWeightLimit();
438
      } else {
439
        setBundleWeightLimit((Double)value);
440
      }
441
      break;
442
 
443
    case GROUP_SHIPMENT_ALLOWED:
444
      if (value == null) {
445
        unsetGroupShipmentAllowed();
446
      } else {
447
        setGroupShipmentAllowed((Boolean)value);
448
      }
449
      break;
450
 
451
    case MAX_COD_LIMIT:
452
      if (value == null) {
453
        unsetMaxCodLimit();
454
      } else {
455
        setMaxCodLimit((Double)value);
456
      }
457
      break;
458
 
412 ashish 459
    }
460
  }
461
 
462
  public Object getFieldValue(_Fields field) {
463
    switch (field) {
464
    case ID:
3430 rajveer 465
      return Long.valueOf(getId());
412 ashish 466
 
467
    case NAME:
468
      return getName();
469
 
3044 chandransh 470
    case DETAILS:
471
      return getDetails();
668 chandransh 472
 
5527 anupam.sin 473
    case PICKUP:
474
      return getPickup();
475
 
13146 manish.sha 476
    case BUNDLE_WEIGHT_LIMIT:
477
      return Double.valueOf(getBundleWeightLimit());
478
 
479
    case GROUP_SHIPMENT_ALLOWED:
480
      return Boolean.valueOf(isGroupShipmentAllowed());
481
 
482
    case MAX_COD_LIMIT:
483
      return Double.valueOf(getMaxCodLimit());
484
 
412 ashish 485
    }
486
    throw new IllegalStateException();
487
  }
488
 
3430 rajveer 489
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
490
  public boolean isSet(_Fields field) {
491
    if (field == null) {
492
      throw new IllegalArgumentException();
493
    }
412 ashish 494
 
495
    switch (field) {
496
    case ID:
497
      return isSetId();
498
    case NAME:
499
      return isSetName();
3044 chandransh 500
    case DETAILS:
501
      return isSetDetails();
5527 anupam.sin 502
    case PICKUP:
503
      return isSetPickup();
13146 manish.sha 504
    case BUNDLE_WEIGHT_LIMIT:
505
      return isSetBundleWeightLimit();
506
    case GROUP_SHIPMENT_ALLOWED:
507
      return isSetGroupShipmentAllowed();
508
    case MAX_COD_LIMIT:
509
      return isSetMaxCodLimit();
412 ashish 510
    }
511
    throw new IllegalStateException();
512
  }
513
 
514
  @Override
515
  public boolean equals(Object that) {
516
    if (that == null)
517
      return false;
518
    if (that instanceof Provider)
519
      return this.equals((Provider)that);
520
    return false;
521
  }
522
 
523
  public boolean equals(Provider that) {
524
    if (that == null)
525
      return false;
526
 
527
    boolean this_present_id = true;
528
    boolean that_present_id = true;
529
    if (this_present_id || that_present_id) {
530
      if (!(this_present_id && that_present_id))
531
        return false;
532
      if (this.id != that.id)
533
        return false;
534
    }
535
 
536
    boolean this_present_name = true && this.isSetName();
537
    boolean that_present_name = true && that.isSetName();
538
    if (this_present_name || that_present_name) {
539
      if (!(this_present_name && that_present_name))
540
        return false;
541
      if (!this.name.equals(that.name))
542
        return false;
543
    }
544
 
3044 chandransh 545
    boolean this_present_details = true && this.isSetDetails();
546
    boolean that_present_details = true && that.isSetDetails();
547
    if (this_present_details || that_present_details) {
548
      if (!(this_present_details && that_present_details))
668 chandransh 549
        return false;
3044 chandransh 550
      if (!this.details.equals(that.details))
668 chandransh 551
        return false;
552
    }
553
 
5527 anupam.sin 554
    boolean this_present_pickup = true && this.isSetPickup();
555
    boolean that_present_pickup = true && that.isSetPickup();
556
    if (this_present_pickup || that_present_pickup) {
557
      if (!(this_present_pickup && that_present_pickup))
558
        return false;
559
      if (!this.pickup.equals(that.pickup))
560
        return false;
561
    }
562
 
13146 manish.sha 563
    boolean this_present_bundleWeightLimit = true;
564
    boolean that_present_bundleWeightLimit = true;
565
    if (this_present_bundleWeightLimit || that_present_bundleWeightLimit) {
566
      if (!(this_present_bundleWeightLimit && that_present_bundleWeightLimit))
567
        return false;
568
      if (this.bundleWeightLimit != that.bundleWeightLimit)
569
        return false;
570
    }
571
 
572
    boolean this_present_groupShipmentAllowed = true;
573
    boolean that_present_groupShipmentAllowed = true;
574
    if (this_present_groupShipmentAllowed || that_present_groupShipmentAllowed) {
575
      if (!(this_present_groupShipmentAllowed && that_present_groupShipmentAllowed))
576
        return false;
577
      if (this.groupShipmentAllowed != that.groupShipmentAllowed)
578
        return false;
579
    }
580
 
581
    boolean this_present_maxCodLimit = true;
582
    boolean that_present_maxCodLimit = true;
583
    if (this_present_maxCodLimit || that_present_maxCodLimit) {
584
      if (!(this_present_maxCodLimit && that_present_maxCodLimit))
585
        return false;
586
      if (this.maxCodLimit != that.maxCodLimit)
587
        return false;
588
    }
589
 
412 ashish 590
    return true;
591
  }
592
 
593
  @Override
594
  public int hashCode() {
595
    return 0;
596
  }
597
 
3430 rajveer 598
  public int compareTo(Provider other) {
599
    if (!getClass().equals(other.getClass())) {
600
      return getClass().getName().compareTo(other.getClass().getName());
601
    }
602
 
603
    int lastComparison = 0;
604
    Provider typedOther = (Provider)other;
605
 
606
    lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
607
    if (lastComparison != 0) {
608
      return lastComparison;
609
    }
610
    if (isSetId()) {
611
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
612
      if (lastComparison != 0) {
613
        return lastComparison;
614
      }
615
    }
616
    lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName());
617
    if (lastComparison != 0) {
618
      return lastComparison;
619
    }
620
    if (isSetName()) {
621
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name);
622
      if (lastComparison != 0) {
623
        return lastComparison;
624
      }
625
    }
626
    lastComparison = Boolean.valueOf(isSetDetails()).compareTo(typedOther.isSetDetails());
627
    if (lastComparison != 0) {
628
      return lastComparison;
629
    }
630
    if (isSetDetails()) {
631
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.details, typedOther.details);
632
      if (lastComparison != 0) {
633
        return lastComparison;
634
      }
635
    }
5527 anupam.sin 636
    lastComparison = Boolean.valueOf(isSetPickup()).compareTo(typedOther.isSetPickup());
637
    if (lastComparison != 0) {
638
      return lastComparison;
639
    }
640
    if (isSetPickup()) {
641
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pickup, typedOther.pickup);
642
      if (lastComparison != 0) {
643
        return lastComparison;
644
      }
645
    }
13146 manish.sha 646
    lastComparison = Boolean.valueOf(isSetBundleWeightLimit()).compareTo(typedOther.isSetBundleWeightLimit());
647
    if (lastComparison != 0) {
648
      return lastComparison;
649
    }
650
    if (isSetBundleWeightLimit()) {
651
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bundleWeightLimit, typedOther.bundleWeightLimit);
652
      if (lastComparison != 0) {
653
        return lastComparison;
654
      }
655
    }
656
    lastComparison = Boolean.valueOf(isSetGroupShipmentAllowed()).compareTo(typedOther.isSetGroupShipmentAllowed());
657
    if (lastComparison != 0) {
658
      return lastComparison;
659
    }
660
    if (isSetGroupShipmentAllowed()) {
661
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.groupShipmentAllowed, typedOther.groupShipmentAllowed);
662
      if (lastComparison != 0) {
663
        return lastComparison;
664
      }
665
    }
666
    lastComparison = Boolean.valueOf(isSetMaxCodLimit()).compareTo(typedOther.isSetMaxCodLimit());
667
    if (lastComparison != 0) {
668
      return lastComparison;
669
    }
670
    if (isSetMaxCodLimit()) {
671
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxCodLimit, typedOther.maxCodLimit);
672
      if (lastComparison != 0) {
673
        return lastComparison;
674
      }
675
    }
3430 rajveer 676
    return 0;
677
  }
678
 
679
  public _Fields fieldForId(int fieldId) {
680
    return _Fields.findByThriftId(fieldId);
681
  }
682
 
683
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
684
    org.apache.thrift.protocol.TField field;
412 ashish 685
    iprot.readStructBegin();
686
    while (true)
687
    {
688
      field = iprot.readFieldBegin();
3430 rajveer 689
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
412 ashish 690
        break;
691
      }
3430 rajveer 692
      switch (field.id) {
693
        case 1: // ID
694
          if (field.type == org.apache.thrift.protocol.TType.I64) {
695
            this.id = iprot.readI64();
696
            setIdIsSet(true);
697
          } else { 
698
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
699
          }
700
          break;
701
        case 2: // NAME
702
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
703
            this.name = iprot.readString();
704
          } else { 
705
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
706
          }
707
          break;
708
        case 3: // DETAILS
7792 anupam.sin 709
          if (field.type == org.apache.thrift.protocol.TType.LIST) {
3430 rajveer 710
            {
7792 anupam.sin 711
              org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
712
              this.details = new ArrayList<ProviderDetails>(_list0.size);
713
              for (int _i1 = 0; _i1 < _list0.size; ++_i1)
3044 chandransh 714
              {
7792 anupam.sin 715
                ProviderDetails _elem2; // required
716
                _elem2 = new ProviderDetails();
717
                _elem2.read(iprot);
718
                this.details.add(_elem2);
3044 chandransh 719
              }
7792 anupam.sin 720
              iprot.readListEnd();
668 chandransh 721
            }
3430 rajveer 722
          } else { 
723
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
724
          }
725
          break;
5527 anupam.sin 726
        case 4: // PICKUP
727
          if (field.type == org.apache.thrift.protocol.TType.I32) {
728
            this.pickup = PickUpType.findByValue(iprot.readI32());
729
          } else { 
730
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
731
          }
732
          break;
13146 manish.sha 733
        case 5: // BUNDLE_WEIGHT_LIMIT
734
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
735
            this.bundleWeightLimit = iprot.readDouble();
736
            setBundleWeightLimitIsSet(true);
737
          } else { 
738
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
739
          }
740
          break;
741
        case 6: // GROUP_SHIPMENT_ALLOWED
742
          if (field.type == org.apache.thrift.protocol.TType.BOOL) {
743
            this.groupShipmentAllowed = iprot.readBool();
744
            setGroupShipmentAllowedIsSet(true);
745
          } else { 
746
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
747
          }
748
          break;
749
        case 7: // MAX_COD_LIMIT
750
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
751
            this.maxCodLimit = iprot.readDouble();
752
            setMaxCodLimitIsSet(true);
753
          } else { 
754
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
755
          }
756
          break;
3430 rajveer 757
        default:
758
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
412 ashish 759
      }
3430 rajveer 760
      iprot.readFieldEnd();
412 ashish 761
    }
762
    iprot.readStructEnd();
763
    validate();
764
  }
765
 
3430 rajveer 766
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
412 ashish 767
    validate();
768
 
769
    oprot.writeStructBegin(STRUCT_DESC);
770
    oprot.writeFieldBegin(ID_FIELD_DESC);
771
    oprot.writeI64(this.id);
772
    oprot.writeFieldEnd();
773
    if (this.name != null) {
774
      oprot.writeFieldBegin(NAME_FIELD_DESC);
775
      oprot.writeString(this.name);
776
      oprot.writeFieldEnd();
777
    }
3044 chandransh 778
    if (this.details != null) {
779
      oprot.writeFieldBegin(DETAILS_FIELD_DESC);
780
      {
7792 anupam.sin 781
        oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.details.size()));
782
        for (ProviderDetails _iter3 : this.details)
3044 chandransh 783
        {
7792 anupam.sin 784
          _iter3.write(oprot);
3044 chandransh 785
        }
7792 anupam.sin 786
        oprot.writeListEnd();
3044 chandransh 787
      }
668 chandransh 788
      oprot.writeFieldEnd();
789
    }
5527 anupam.sin 790
    if (this.pickup != null) {
791
      oprot.writeFieldBegin(PICKUP_FIELD_DESC);
792
      oprot.writeI32(this.pickup.getValue());
793
      oprot.writeFieldEnd();
794
    }
13146 manish.sha 795
    oprot.writeFieldBegin(BUNDLE_WEIGHT_LIMIT_FIELD_DESC);
796
    oprot.writeDouble(this.bundleWeightLimit);
797
    oprot.writeFieldEnd();
798
    oprot.writeFieldBegin(GROUP_SHIPMENT_ALLOWED_FIELD_DESC);
799
    oprot.writeBool(this.groupShipmentAllowed);
800
    oprot.writeFieldEnd();
801
    oprot.writeFieldBegin(MAX_COD_LIMIT_FIELD_DESC);
802
    oprot.writeDouble(this.maxCodLimit);
803
    oprot.writeFieldEnd();
412 ashish 804
    oprot.writeFieldStop();
805
    oprot.writeStructEnd();
806
  }
807
 
808
  @Override
809
  public String toString() {
810
    StringBuilder sb = new StringBuilder("Provider(");
811
    boolean first = true;
812
 
813
    sb.append("id:");
814
    sb.append(this.id);
815
    first = false;
816
    if (!first) sb.append(", ");
817
    sb.append("name:");
818
    if (this.name == null) {
819
      sb.append("null");
820
    } else {
821
      sb.append(this.name);
822
    }
823
    first = false;
668 chandransh 824
    if (!first) sb.append(", ");
3044 chandransh 825
    sb.append("details:");
826
    if (this.details == null) {
668 chandransh 827
      sb.append("null");
828
    } else {
3044 chandransh 829
      sb.append(this.details);
668 chandransh 830
    }
831
    first = false;
5527 anupam.sin 832
    if (!first) sb.append(", ");
833
    sb.append("pickup:");
834
    if (this.pickup == null) {
835
      sb.append("null");
836
    } else {
837
      sb.append(this.pickup);
838
    }
839
    first = false;
13146 manish.sha 840
    if (!first) sb.append(", ");
841
    sb.append("bundleWeightLimit:");
842
    sb.append(this.bundleWeightLimit);
843
    first = false;
844
    if (!first) sb.append(", ");
845
    sb.append("groupShipmentAllowed:");
846
    sb.append(this.groupShipmentAllowed);
847
    first = false;
848
    if (!first) sb.append(", ");
849
    sb.append("maxCodLimit:");
850
    sb.append(this.maxCodLimit);
851
    first = false;
412 ashish 852
    sb.append(")");
853
    return sb.toString();
854
  }
855
 
3430 rajveer 856
  public void validate() throws org.apache.thrift.TException {
412 ashish 857
    // check for required fields
858
  }
859
 
3430 rajveer 860
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
861
    try {
862
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
863
    } catch (org.apache.thrift.TException te) {
864
      throw new java.io.IOException(te);
865
    }
866
  }
867
 
868
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
869
    try {
870
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
871
      __isset_bit_vector = new BitSet(1);
872
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
873
    } catch (org.apache.thrift.TException te) {
874
      throw new java.io.IOException(te);
875
    }
876
  }
877
 
412 ashish 878
}
879