Subversion Repositories SmartDukaan

Rev

Rev 3044 | Go to most recent revision | 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);
3044 chandransh 28
 
3430 rajveer 29
  private String accountNo; // required
30
  private String email; // required
3044 chandransh 31
 
32
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 33
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3044 chandransh 34
    ACCOUNT_NO((short)1, "accountNo"),
35
    EMAIL((short)2, "email");
36
 
37
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
38
 
39
    static {
40
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
41
        byName.put(field.getFieldName(), field);
42
      }
43
    }
44
 
45
    /**
46
     * Find the _Fields constant that matches fieldId, or null if its not found.
47
     */
48
    public static _Fields findByThriftId(int fieldId) {
3430 rajveer 49
      switch(fieldId) {
50
        case 1: // ACCOUNT_NO
51
          return ACCOUNT_NO;
52
        case 2: // EMAIL
53
          return EMAIL;
54
        default:
55
          return null;
56
      }
3044 chandransh 57
    }
58
 
59
    /**
60
     * Find the _Fields constant that matches fieldId, throwing an exception
61
     * if it is not found.
62
     */
63
    public static _Fields findByThriftIdOrThrow(int fieldId) {
64
      _Fields fields = findByThriftId(fieldId);
65
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
66
      return fields;
67
    }
68
 
69
    /**
70
     * Find the _Fields constant that matches name, or null if its not found.
71
     */
72
    public static _Fields findByName(String name) {
73
      return byName.get(name);
74
    }
75
 
76
    private final short _thriftId;
77
    private final String _fieldName;
78
 
79
    _Fields(short thriftId, String fieldName) {
80
      _thriftId = thriftId;
81
      _fieldName = fieldName;
82
    }
83
 
84
    public short getThriftFieldId() {
85
      return _thriftId;
86
    }
87
 
88
    public String getFieldName() {
89
      return _fieldName;
90
    }
91
  }
92
 
93
  // isset id assignments
94
 
3430 rajveer 95
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3044 chandransh 96
  static {
3430 rajveer 97
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
98
    tmpMap.put(_Fields.ACCOUNT_NO, new org.apache.thrift.meta_data.FieldMetaData("accountNo", org.apache.thrift.TFieldRequirementType.DEFAULT, 
99
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
100
    tmpMap.put(_Fields.EMAIL, new org.apache.thrift.meta_data.FieldMetaData("email", org.apache.thrift.TFieldRequirementType.DEFAULT, 
101
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
102
    metaDataMap = Collections.unmodifiableMap(tmpMap);
103
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ProviderDetails.class, metaDataMap);
3044 chandransh 104
  }
105
 
106
  public ProviderDetails() {
107
  }
108
 
109
  public ProviderDetails(
110
    String accountNo,
111
    String email)
112
  {
113
    this();
114
    this.accountNo = accountNo;
115
    this.email = email;
116
  }
117
 
118
  /**
119
   * Performs a deep copy on <i>other</i>.
120
   */
121
  public ProviderDetails(ProviderDetails other) {
122
    if (other.isSetAccountNo()) {
123
      this.accountNo = other.accountNo;
124
    }
125
    if (other.isSetEmail()) {
126
      this.email = other.email;
127
    }
128
  }
129
 
130
  public ProviderDetails deepCopy() {
131
    return new ProviderDetails(this);
132
  }
133
 
3430 rajveer 134
  @Override
135
  public void clear() {
136
    this.accountNo = null;
137
    this.email = null;
3044 chandransh 138
  }
139
 
140
  public String getAccountNo() {
141
    return this.accountNo;
142
  }
143
 
3430 rajveer 144
  public void setAccountNo(String accountNo) {
3044 chandransh 145
    this.accountNo = accountNo;
146
  }
147
 
148
  public void unsetAccountNo() {
149
    this.accountNo = null;
150
  }
151
 
3430 rajveer 152
  /** Returns true if field accountNo is set (has been assigned a value) and false otherwise */
3044 chandransh 153
  public boolean isSetAccountNo() {
154
    return this.accountNo != null;
155
  }
156
 
157
  public void setAccountNoIsSet(boolean value) {
158
    if (!value) {
159
      this.accountNo = null;
160
    }
161
  }
162
 
163
  public String getEmail() {
164
    return this.email;
165
  }
166
 
3430 rajveer 167
  public void setEmail(String email) {
3044 chandransh 168
    this.email = email;
169
  }
170
 
171
  public void unsetEmail() {
172
    this.email = null;
173
  }
174
 
3430 rajveer 175
  /** Returns true if field email is set (has been assigned a value) and false otherwise */
3044 chandransh 176
  public boolean isSetEmail() {
177
    return this.email != null;
178
  }
179
 
180
  public void setEmailIsSet(boolean value) {
181
    if (!value) {
182
      this.email = null;
183
    }
184
  }
185
 
186
  public void setFieldValue(_Fields field, Object value) {
187
    switch (field) {
188
    case ACCOUNT_NO:
189
      if (value == null) {
190
        unsetAccountNo();
191
      } else {
192
        setAccountNo((String)value);
193
      }
194
      break;
195
 
196
    case EMAIL:
197
      if (value == null) {
198
        unsetEmail();
199
      } else {
200
        setEmail((String)value);
201
      }
202
      break;
203
 
204
    }
205
  }
206
 
207
  public Object getFieldValue(_Fields field) {
208
    switch (field) {
209
    case ACCOUNT_NO:
210
      return getAccountNo();
211
 
212
    case EMAIL:
213
      return getEmail();
214
 
215
    }
216
    throw new IllegalStateException();
217
  }
218
 
3430 rajveer 219
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
220
  public boolean isSet(_Fields field) {
221
    if (field == null) {
222
      throw new IllegalArgumentException();
223
    }
3044 chandransh 224
 
225
    switch (field) {
226
    case ACCOUNT_NO:
227
      return isSetAccountNo();
228
    case EMAIL:
229
      return isSetEmail();
230
    }
231
    throw new IllegalStateException();
232
  }
233
 
234
  @Override
235
  public boolean equals(Object that) {
236
    if (that == null)
237
      return false;
238
    if (that instanceof ProviderDetails)
239
      return this.equals((ProviderDetails)that);
240
    return false;
241
  }
242
 
243
  public boolean equals(ProviderDetails that) {
244
    if (that == null)
245
      return false;
246
 
247
    boolean this_present_accountNo = true && this.isSetAccountNo();
248
    boolean that_present_accountNo = true && that.isSetAccountNo();
249
    if (this_present_accountNo || that_present_accountNo) {
250
      if (!(this_present_accountNo && that_present_accountNo))
251
        return false;
252
      if (!this.accountNo.equals(that.accountNo))
253
        return false;
254
    }
255
 
256
    boolean this_present_email = true && this.isSetEmail();
257
    boolean that_present_email = true && that.isSetEmail();
258
    if (this_present_email || that_present_email) {
259
      if (!(this_present_email && that_present_email))
260
        return false;
261
      if (!this.email.equals(that.email))
262
        return false;
263
    }
264
 
265
    return true;
266
  }
267
 
268
  @Override
269
  public int hashCode() {
270
    return 0;
271
  }
272
 
273
  public int compareTo(ProviderDetails other) {
274
    if (!getClass().equals(other.getClass())) {
275
      return getClass().getName().compareTo(other.getClass().getName());
276
    }
277
 
278
    int lastComparison = 0;
279
    ProviderDetails typedOther = (ProviderDetails)other;
280
 
3430 rajveer 281
    lastComparison = Boolean.valueOf(isSetAccountNo()).compareTo(typedOther.isSetAccountNo());
3044 chandransh 282
    if (lastComparison != 0) {
283
      return lastComparison;
284
    }
3430 rajveer 285
    if (isSetAccountNo()) {
286
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.accountNo, typedOther.accountNo);
287
      if (lastComparison != 0) {
288
        return lastComparison;
289
      }
3044 chandransh 290
    }
3430 rajveer 291
    lastComparison = Boolean.valueOf(isSetEmail()).compareTo(typedOther.isSetEmail());
3044 chandransh 292
    if (lastComparison != 0) {
293
      return lastComparison;
294
    }
3430 rajveer 295
    if (isSetEmail()) {
296
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.email, typedOther.email);
297
      if (lastComparison != 0) {
298
        return lastComparison;
299
      }
3044 chandransh 300
    }
301
    return 0;
302
  }
303
 
3430 rajveer 304
  public _Fields fieldForId(int fieldId) {
305
    return _Fields.findByThriftId(fieldId);
306
  }
307
 
308
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
309
    org.apache.thrift.protocol.TField field;
3044 chandransh 310
    iprot.readStructBegin();
311
    while (true)
312
    {
313
      field = iprot.readFieldBegin();
3430 rajveer 314
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3044 chandransh 315
        break;
316
      }
3430 rajveer 317
      switch (field.id) {
318
        case 1: // ACCOUNT_NO
319
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
320
            this.accountNo = iprot.readString();
321
          } else { 
322
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
323
          }
324
          break;
325
        case 2: // EMAIL
326
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
327
            this.email = iprot.readString();
328
          } else { 
329
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
330
          }
331
          break;
332
        default:
333
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3044 chandransh 334
      }
3430 rajveer 335
      iprot.readFieldEnd();
3044 chandransh 336
    }
337
    iprot.readStructEnd();
338
    validate();
339
  }
340
 
3430 rajveer 341
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3044 chandransh 342
    validate();
343
 
344
    oprot.writeStructBegin(STRUCT_DESC);
345
    if (this.accountNo != null) {
346
      oprot.writeFieldBegin(ACCOUNT_NO_FIELD_DESC);
347
      oprot.writeString(this.accountNo);
348
      oprot.writeFieldEnd();
349
    }
350
    if (this.email != null) {
351
      oprot.writeFieldBegin(EMAIL_FIELD_DESC);
352
      oprot.writeString(this.email);
353
      oprot.writeFieldEnd();
354
    }
355
    oprot.writeFieldStop();
356
    oprot.writeStructEnd();
357
  }
358
 
359
  @Override
360
  public String toString() {
361
    StringBuilder sb = new StringBuilder("ProviderDetails(");
362
    boolean first = true;
363
 
364
    sb.append("accountNo:");
365
    if (this.accountNo == null) {
366
      sb.append("null");
367
    } else {
368
      sb.append(this.accountNo);
369
    }
370
    first = false;
371
    if (!first) sb.append(", ");
372
    sb.append("email:");
373
    if (this.email == null) {
374
      sb.append("null");
375
    } else {
376
      sb.append(this.email);
377
    }
378
    first = false;
379
    sb.append(")");
380
    return sb.toString();
381
  }
382
 
3430 rajveer 383
  public void validate() throws org.apache.thrift.TException {
3044 chandransh 384
    // check for required fields
385
  }
386
 
3430 rajveer 387
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
388
    try {
389
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
390
    } catch (org.apache.thrift.TException te) {
391
      throw new java.io.IOException(te);
392
    }
393
  }
394
 
395
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
396
    try {
397
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
398
    } catch (org.apache.thrift.TException te) {
399
      throw new java.io.IOException(te);
400
    }
401
  }
402
 
3044 chandransh 403
}
404