Subversion Repositories SmartDukaan

Rev

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

Rev 4806 Rev 4996
Line 21... Line 21...
21
import org.slf4j.LoggerFactory;
21
import org.slf4j.LoggerFactory;
22
 
22
 
23
public class QuickLink implements org.apache.thrift.TBase<QuickLink, QuickLink._Fields>, java.io.Serializable, Cloneable {
23
public class QuickLink implements org.apache.thrift.TBase<QuickLink, QuickLink._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("QuickLink");
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("QuickLink");
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 URL_FIELD_DESC = new org.apache.thrift.protocol.TField("url", org.apache.thrift.protocol.TType.STRING, (short)1);
27
  private static final org.apache.thrift.protocol.TField URL_FIELD_DESC = new org.apache.thrift.protocol.TField("url", org.apache.thrift.protocol.TType.STRING, (short)2);
27
  private static final org.apache.thrift.protocol.TField TEXT_FIELD_DESC = new org.apache.thrift.protocol.TField("text", org.apache.thrift.protocol.TType.STRING, (short)2);
28
  private static final org.apache.thrift.protocol.TField TEXT_FIELD_DESC = new org.apache.thrift.protocol.TField("text", org.apache.thrift.protocol.TType.STRING, (short)3);
28
 
29
 
-
 
30
  private long id; // required
29
  private String url; // required
31
  private String url; // required
30
  private String text; // required
32
  private String text; // required
31
 
33
 
32
  /** 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. */
33
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
35
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
-
 
36
    ID((short)1, "id"),
34
    URL((short)1, "url"),
37
    URL((short)2, "url"),
35
    TEXT((short)2, "text");
38
    TEXT((short)3, "text");
36
 
39
 
37
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
40
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
38
 
41
 
39
    static {
42
    static {
40
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
43
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
Line 45... Line 48...
45
    /**
48
    /**
46
     * 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.
47
     */
50
     */
48
    public static _Fields findByThriftId(int fieldId) {
51
    public static _Fields findByThriftId(int fieldId) {
49
      switch(fieldId) {
52
      switch(fieldId) {
-
 
53
        case 1: // ID
-
 
54
          return ID;
50
        case 1: // URL
55
        case 2: // URL
51
          return URL;
56
          return URL;
52
        case 2: // TEXT
57
        case 3: // TEXT
53
          return TEXT;
58
          return TEXT;
54
        default:
59
        default:
55
          return null;
60
          return null;
56
      }
61
      }
57
    }
62
    }
Line 89... Line 94...
89
      return _fieldName;
94
      return _fieldName;
90
    }
95
    }
91
  }
96
  }
92
 
97
 
93
  // isset id assignments
98
  // isset id assignments
-
 
99
  private static final int __ID_ISSET_ID = 0;
-
 
100
  private BitSet __isset_bit_vector = new BitSet(1);
94
 
101
 
95
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
102
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
96
  static {
103
  static {
97
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
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)));
98
    tmpMap.put(_Fields.URL, new org.apache.thrift.meta_data.FieldMetaData("url", org.apache.thrift.TFieldRequirementType.DEFAULT, 
107
    tmpMap.put(_Fields.URL, new org.apache.thrift.meta_data.FieldMetaData("url", org.apache.thrift.TFieldRequirementType.DEFAULT, 
99
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
108
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
100
    tmpMap.put(_Fields.TEXT, new org.apache.thrift.meta_data.FieldMetaData("text", org.apache.thrift.TFieldRequirementType.DEFAULT, 
109
    tmpMap.put(_Fields.TEXT, new org.apache.thrift.meta_data.FieldMetaData("text", org.apache.thrift.TFieldRequirementType.DEFAULT, 
101
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
110
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
102
    metaDataMap = Collections.unmodifiableMap(tmpMap);
111
    metaDataMap = Collections.unmodifiableMap(tmpMap);
Line 105... Line 114...
105
 
114
 
106
  public QuickLink() {
115
  public QuickLink() {
107
  }
116
  }
108
 
117
 
109
  public QuickLink(
118
  public QuickLink(
-
 
119
    long id,
110
    String url,
120
    String url,
111
    String text)
121
    String text)
112
  {
122
  {
113
    this();
123
    this();
-
 
124
    this.id = id;
-
 
125
    setIdIsSet(true);
114
    this.url = url;
126
    this.url = url;
115
    this.text = text;
127
    this.text = text;
116
  }
128
  }
117
 
129
 
118
  /**
130
  /**
119
   * Performs a deep copy on <i>other</i>.
131
   * Performs a deep copy on <i>other</i>.
120
   */
132
   */
121
  public QuickLink(QuickLink other) {
133
  public QuickLink(QuickLink other) {
-
 
134
    __isset_bit_vector.clear();
-
 
135
    __isset_bit_vector.or(other.__isset_bit_vector);
-
 
136
    this.id = other.id;
122
    if (other.isSetUrl()) {
137
    if (other.isSetUrl()) {
123
      this.url = other.url;
138
      this.url = other.url;
124
    }
139
    }
125
    if (other.isSetText()) {
140
    if (other.isSetText()) {
126
      this.text = other.text;
141
      this.text = other.text;
Line 131... Line 146...
131
    return new QuickLink(this);
146
    return new QuickLink(this);
132
  }
147
  }
133
 
148
 
134
  @Override
149
  @Override
135
  public void clear() {
150
  public void clear() {
-
 
151
    setIdIsSet(false);
-
 
152
    this.id = 0;
136
    this.url = null;
153
    this.url = null;
137
    this.text = null;
154
    this.text = null;
138
  }
155
  }
139
 
156
 
-
 
157
  public long getId() {
-
 
158
    return this.id;
-
 
159
  }
-
 
160
 
-
 
161
  public void setId(long id) {
-
 
162
    this.id = id;
-
 
163
    setIdIsSet(true);
-
 
164
  }
-
 
165
 
-
 
166
  public void unsetId() {
-
 
167
    __isset_bit_vector.clear(__ID_ISSET_ID);
-
 
168
  }
-
 
169
 
-
 
170
  /** Returns true if field id is set (has been assigned a value) and false otherwise */
-
 
171
  public boolean isSetId() {
-
 
172
    return __isset_bit_vector.get(__ID_ISSET_ID);
-
 
173
  }
-
 
174
 
-
 
175
  public void setIdIsSet(boolean value) {
-
 
176
    __isset_bit_vector.set(__ID_ISSET_ID, value);
-
 
177
  }
-
 
178
 
140
  public String getUrl() {
179
  public String getUrl() {
141
    return this.url;
180
    return this.url;
142
  }
181
  }
143
 
182
 
144
  public void setUrl(String url) {
183
  public void setUrl(String url) {
Line 183... Line 222...
183
    }
222
    }
184
  }
223
  }
185
 
224
 
186
  public void setFieldValue(_Fields field, Object value) {
225
  public void setFieldValue(_Fields field, Object value) {
187
    switch (field) {
226
    switch (field) {
-
 
227
    case ID:
-
 
228
      if (value == null) {
-
 
229
        unsetId();
-
 
230
      } else {
-
 
231
        setId((Long)value);
-
 
232
      }
-
 
233
      break;
-
 
234
 
188
    case URL:
235
    case URL:
189
      if (value == null) {
236
      if (value == null) {
190
        unsetUrl();
237
        unsetUrl();
191
      } else {
238
      } else {
192
        setUrl((String)value);
239
        setUrl((String)value);
Line 204... Line 251...
204
    }
251
    }
205
  }
252
  }
206
 
253
 
207
  public Object getFieldValue(_Fields field) {
254
  public Object getFieldValue(_Fields field) {
208
    switch (field) {
255
    switch (field) {
-
 
256
    case ID:
-
 
257
      return Long.valueOf(getId());
-
 
258
 
209
    case URL:
259
    case URL:
210
      return getUrl();
260
      return getUrl();
211
 
261
 
212
    case TEXT:
262
    case TEXT:
213
      return getText();
263
      return getText();
Line 221... Line 271...
221
    if (field == null) {
271
    if (field == null) {
222
      throw new IllegalArgumentException();
272
      throw new IllegalArgumentException();
223
    }
273
    }
224
 
274
 
225
    switch (field) {
275
    switch (field) {
-
 
276
    case ID:
-
 
277
      return isSetId();
226
    case URL:
278
    case URL:
227
      return isSetUrl();
279
      return isSetUrl();
228
    case TEXT:
280
    case TEXT:
229
      return isSetText();
281
      return isSetText();
230
    }
282
    }
Line 242... Line 294...
242
 
294
 
243
  public boolean equals(QuickLink that) {
295
  public boolean equals(QuickLink that) {
244
    if (that == null)
296
    if (that == null)
245
      return false;
297
      return false;
246
 
298
 
-
 
299
    boolean this_present_id = true;
-
 
300
    boolean that_present_id = true;
-
 
301
    if (this_present_id || that_present_id) {
-
 
302
      if (!(this_present_id && that_present_id))
-
 
303
        return false;
-
 
304
      if (this.id != that.id)
-
 
305
        return false;
-
 
306
    }
-
 
307
 
247
    boolean this_present_url = true && this.isSetUrl();
308
    boolean this_present_url = true && this.isSetUrl();
248
    boolean that_present_url = true && that.isSetUrl();
309
    boolean that_present_url = true && that.isSetUrl();
249
    if (this_present_url || that_present_url) {
310
    if (this_present_url || that_present_url) {
250
      if (!(this_present_url && that_present_url))
311
      if (!(this_present_url && that_present_url))
251
        return false;
312
        return false;
Line 276... Line 337...
276
    }
337
    }
277
 
338
 
278
    int lastComparison = 0;
339
    int lastComparison = 0;
279
    QuickLink typedOther = (QuickLink)other;
340
    QuickLink typedOther = (QuickLink)other;
280
 
341
 
-
 
342
    lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
-
 
343
    if (lastComparison != 0) {
-
 
344
      return lastComparison;
-
 
345
    }
-
 
346
    if (isSetId()) {
-
 
347
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
-
 
348
      if (lastComparison != 0) {
-
 
349
        return lastComparison;
-
 
350
      }
-
 
351
    }
281
    lastComparison = Boolean.valueOf(isSetUrl()).compareTo(typedOther.isSetUrl());
352
    lastComparison = Boolean.valueOf(isSetUrl()).compareTo(typedOther.isSetUrl());
282
    if (lastComparison != 0) {
353
    if (lastComparison != 0) {
283
      return lastComparison;
354
      return lastComparison;
284
    }
355
    }
285
    if (isSetUrl()) {
356
    if (isSetUrl()) {
Line 313... Line 384...
313
      field = iprot.readFieldBegin();
384
      field = iprot.readFieldBegin();
314
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
385
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
315
        break;
386
        break;
316
      }
387
      }
317
      switch (field.id) {
388
      switch (field.id) {
-
 
389
        case 1: // ID
-
 
390
          if (field.type == org.apache.thrift.protocol.TType.I64) {
-
 
391
            this.id = iprot.readI64();
-
 
392
            setIdIsSet(true);
-
 
393
          } else { 
-
 
394
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
395
          }
-
 
396
          break;
318
        case 1: // URL
397
        case 2: // URL
319
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
398
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
320
            this.url = iprot.readString();
399
            this.url = iprot.readString();
321
          } else { 
400
          } else { 
322
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
401
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
323
          }
402
          }
324
          break;
403
          break;
325
        case 2: // TEXT
404
        case 3: // TEXT
326
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
405
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
327
            this.text = iprot.readString();
406
            this.text = iprot.readString();
328
          } else { 
407
          } else { 
329
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
408
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
330
          }
409
          }
Line 340... Line 419...
340
 
419
 
341
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
420
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
342
    validate();
421
    validate();
343
 
422
 
344
    oprot.writeStructBegin(STRUCT_DESC);
423
    oprot.writeStructBegin(STRUCT_DESC);
-
 
424
    oprot.writeFieldBegin(ID_FIELD_DESC);
-
 
425
    oprot.writeI64(this.id);
-
 
426
    oprot.writeFieldEnd();
345
    if (this.url != null) {
427
    if (this.url != null) {
346
      oprot.writeFieldBegin(URL_FIELD_DESC);
428
      oprot.writeFieldBegin(URL_FIELD_DESC);
347
      oprot.writeString(this.url);
429
      oprot.writeString(this.url);
348
      oprot.writeFieldEnd();
430
      oprot.writeFieldEnd();
349
    }
431
    }
Line 359... Line 441...
359
  @Override
441
  @Override
360
  public String toString() {
442
  public String toString() {
361
    StringBuilder sb = new StringBuilder("QuickLink(");
443
    StringBuilder sb = new StringBuilder("QuickLink(");
362
    boolean first = true;
444
    boolean first = true;
363
 
445
 
-
 
446
    sb.append("id:");
-
 
447
    sb.append(this.id);
-
 
448
    first = false;
-
 
449
    if (!first) sb.append(", ");
364
    sb.append("url:");
450
    sb.append("url:");
365
    if (this.url == null) {
451
    if (this.url == null) {
366
      sb.append("null");
452
      sb.append("null");
367
    } else {
453
    } else {
368
      sb.append(this.url);
454
      sb.append(this.url);
Line 392... Line 478...
392
    }
478
    }
393
  }
479
  }
394
 
480
 
395
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
481
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
396
    try {
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);
397
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
485
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
398
    } catch (org.apache.thrift.TException te) {
486
    } catch (org.apache.thrift.TException te) {
399
      throw new java.io.IOException(te);
487
      throw new java.io.IOException(te);
400
    }
488
    }
401
  }
489
  }