Subversion Repositories SmartDukaan

Rev

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

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