Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
5535 amar.kumar 1
/**
2
 * Autogenerated by Thrift Compiler (0.7.0)
3
 *
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
 */
6
package in.shop2020.alert;
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;
18
import java.nio.ByteBuffer;
19
import java.util.Arrays;
20
import org.slf4j.Logger;
21
import org.slf4j.LoggerFactory;
22
 
23
public class EntityMonitoringStatus implements org.apache.thrift.TBase<EntityMonitoringStatus, EntityMonitoringStatus._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("EntityMonitoringStatus");
25
 
26
  private static final org.apache.thrift.protocol.TField ENTITY_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("entityType", org.apache.thrift.protocol.TType.I32, (short)1);
27
  private static final org.apache.thrift.protocol.TField IS_ACTIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("isActive", org.apache.thrift.protocol.TType.BOOL, (short)2);
28
  private static final org.apache.thrift.protocol.TField USER_IDS_FIELD_DESC = new org.apache.thrift.protocol.TField("userIds", org.apache.thrift.protocol.TType.STRING, (short)3);
29
 
30
  private EntityType entityType; // required
31
  private boolean isActive; // required
32
  private String userIds; // required
33
 
34
  /** 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 {
36
    /**
37
     * 
38
     * @see EntityType
39
     */
40
    ENTITY_TYPE((short)1, "entityType"),
41
    IS_ACTIVE((short)2, "isActive"),
42
    USER_IDS((short)3, "userIds");
43
 
44
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
45
 
46
    static {
47
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
48
        byName.put(field.getFieldName(), field);
49
      }
50
    }
51
 
52
    /**
53
     * Find the _Fields constant that matches fieldId, or null if its not found.
54
     */
55
    public static _Fields findByThriftId(int fieldId) {
56
      switch(fieldId) {
57
        case 1: // ENTITY_TYPE
58
          return ENTITY_TYPE;
59
        case 2: // IS_ACTIVE
60
          return IS_ACTIVE;
61
        case 3: // USER_IDS
62
          return USER_IDS;
63
        default:
64
          return null;
65
      }
66
    }
67
 
68
    /**
69
     * Find the _Fields constant that matches fieldId, throwing an exception
70
     * if it is not found.
71
     */
72
    public static _Fields findByThriftIdOrThrow(int fieldId) {
73
      _Fields fields = findByThriftId(fieldId);
74
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
75
      return fields;
76
    }
77
 
78
    /**
79
     * Find the _Fields constant that matches name, or null if its not found.
80
     */
81
    public static _Fields findByName(String name) {
82
      return byName.get(name);
83
    }
84
 
85
    private final short _thriftId;
86
    private final String _fieldName;
87
 
88
    _Fields(short thriftId, String fieldName) {
89
      _thriftId = thriftId;
90
      _fieldName = fieldName;
91
    }
92
 
93
    public short getThriftFieldId() {
94
      return _thriftId;
95
    }
96
 
97
    public String getFieldName() {
98
      return _fieldName;
99
    }
100
  }
101
 
102
  // isset id assignments
103
  private static final int __ISACTIVE_ISSET_ID = 0;
104
  private BitSet __isset_bit_vector = new BitSet(1);
105
 
106
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
107
  static {
108
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
109
    tmpMap.put(_Fields.ENTITY_TYPE, new org.apache.thrift.meta_data.FieldMetaData("entityType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
110
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, EntityType.class)));
111
    tmpMap.put(_Fields.IS_ACTIVE, new org.apache.thrift.meta_data.FieldMetaData("isActive", org.apache.thrift.TFieldRequirementType.DEFAULT, 
112
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
113
    tmpMap.put(_Fields.USER_IDS, new org.apache.thrift.meta_data.FieldMetaData("userIds", org.apache.thrift.TFieldRequirementType.DEFAULT, 
114
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
115
    metaDataMap = Collections.unmodifiableMap(tmpMap);
116
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(EntityMonitoringStatus.class, metaDataMap);
117
  }
118
 
119
  public EntityMonitoringStatus() {
120
  }
121
 
122
  public EntityMonitoringStatus(
123
    EntityType entityType,
124
    boolean isActive,
125
    String userIds)
126
  {
127
    this();
128
    this.entityType = entityType;
129
    this.isActive = isActive;
130
    setIsActiveIsSet(true);
131
    this.userIds = userIds;
132
  }
133
 
134
  /**
135
   * Performs a deep copy on <i>other</i>.
136
   */
137
  public EntityMonitoringStatus(EntityMonitoringStatus other) {
138
    __isset_bit_vector.clear();
139
    __isset_bit_vector.or(other.__isset_bit_vector);
140
    if (other.isSetEntityType()) {
141
      this.entityType = other.entityType;
142
    }
143
    this.isActive = other.isActive;
144
    if (other.isSetUserIds()) {
145
      this.userIds = other.userIds;
146
    }
147
  }
148
 
149
  public EntityMonitoringStatus deepCopy() {
150
    return new EntityMonitoringStatus(this);
151
  }
152
 
153
  @Override
154
  public void clear() {
155
    this.entityType = null;
156
    setIsActiveIsSet(false);
157
    this.isActive = false;
158
    this.userIds = null;
159
  }
160
 
161
  /**
162
   * 
163
   * @see EntityType
164
   */
165
  public EntityType getEntityType() {
166
    return this.entityType;
167
  }
168
 
169
  /**
170
   * 
171
   * @see EntityType
172
   */
173
  public void setEntityType(EntityType entityType) {
174
    this.entityType = entityType;
175
  }
176
 
177
  public void unsetEntityType() {
178
    this.entityType = null;
179
  }
180
 
181
  /** Returns true if field entityType is set (has been assigned a value) and false otherwise */
182
  public boolean isSetEntityType() {
183
    return this.entityType != null;
184
  }
185
 
186
  public void setEntityTypeIsSet(boolean value) {
187
    if (!value) {
188
      this.entityType = null;
189
    }
190
  }
191
 
192
  public boolean isIsActive() {
193
    return this.isActive;
194
  }
195
 
196
  public void setIsActive(boolean isActive) {
197
    this.isActive = isActive;
198
    setIsActiveIsSet(true);
199
  }
200
 
201
  public void unsetIsActive() {
202
    __isset_bit_vector.clear(__ISACTIVE_ISSET_ID);
203
  }
204
 
205
  /** Returns true if field isActive is set (has been assigned a value) and false otherwise */
206
  public boolean isSetIsActive() {
207
    return __isset_bit_vector.get(__ISACTIVE_ISSET_ID);
208
  }
209
 
210
  public void setIsActiveIsSet(boolean value) {
211
    __isset_bit_vector.set(__ISACTIVE_ISSET_ID, value);
212
  }
213
 
214
  public String getUserIds() {
215
    return this.userIds;
216
  }
217
 
218
  public void setUserIds(String userIds) {
219
    this.userIds = userIds;
220
  }
221
 
222
  public void unsetUserIds() {
223
    this.userIds = null;
224
  }
225
 
226
  /** Returns true if field userIds is set (has been assigned a value) and false otherwise */
227
  public boolean isSetUserIds() {
228
    return this.userIds != null;
229
  }
230
 
231
  public void setUserIdsIsSet(boolean value) {
232
    if (!value) {
233
      this.userIds = null;
234
    }
235
  }
236
 
237
  public void setFieldValue(_Fields field, Object value) {
238
    switch (field) {
239
    case ENTITY_TYPE:
240
      if (value == null) {
241
        unsetEntityType();
242
      } else {
243
        setEntityType((EntityType)value);
244
      }
245
      break;
246
 
247
    case IS_ACTIVE:
248
      if (value == null) {
249
        unsetIsActive();
250
      } else {
251
        setIsActive((Boolean)value);
252
      }
253
      break;
254
 
255
    case USER_IDS:
256
      if (value == null) {
257
        unsetUserIds();
258
      } else {
259
        setUserIds((String)value);
260
      }
261
      break;
262
 
263
    }
264
  }
265
 
266
  public Object getFieldValue(_Fields field) {
267
    switch (field) {
268
    case ENTITY_TYPE:
269
      return getEntityType();
270
 
271
    case IS_ACTIVE:
272
      return Boolean.valueOf(isIsActive());
273
 
274
    case USER_IDS:
275
      return getUserIds();
276
 
277
    }
278
    throw new IllegalStateException();
279
  }
280
 
281
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
282
  public boolean isSet(_Fields field) {
283
    if (field == null) {
284
      throw new IllegalArgumentException();
285
    }
286
 
287
    switch (field) {
288
    case ENTITY_TYPE:
289
      return isSetEntityType();
290
    case IS_ACTIVE:
291
      return isSetIsActive();
292
    case USER_IDS:
293
      return isSetUserIds();
294
    }
295
    throw new IllegalStateException();
296
  }
297
 
298
  @Override
299
  public boolean equals(Object that) {
300
    if (that == null)
301
      return false;
302
    if (that instanceof EntityMonitoringStatus)
303
      return this.equals((EntityMonitoringStatus)that);
304
    return false;
305
  }
306
 
307
  public boolean equals(EntityMonitoringStatus that) {
308
    if (that == null)
309
      return false;
310
 
311
    boolean this_present_entityType = true && this.isSetEntityType();
312
    boolean that_present_entityType = true && that.isSetEntityType();
313
    if (this_present_entityType || that_present_entityType) {
314
      if (!(this_present_entityType && that_present_entityType))
315
        return false;
316
      if (!this.entityType.equals(that.entityType))
317
        return false;
318
    }
319
 
320
    boolean this_present_isActive = true;
321
    boolean that_present_isActive = true;
322
    if (this_present_isActive || that_present_isActive) {
323
      if (!(this_present_isActive && that_present_isActive))
324
        return false;
325
      if (this.isActive != that.isActive)
326
        return false;
327
    }
328
 
329
    boolean this_present_userIds = true && this.isSetUserIds();
330
    boolean that_present_userIds = true && that.isSetUserIds();
331
    if (this_present_userIds || that_present_userIds) {
332
      if (!(this_present_userIds && that_present_userIds))
333
        return false;
334
      if (!this.userIds.equals(that.userIds))
335
        return false;
336
    }
337
 
338
    return true;
339
  }
340
 
341
  @Override
342
  public int hashCode() {
343
    return 0;
344
  }
345
 
346
  public int compareTo(EntityMonitoringStatus other) {
347
    if (!getClass().equals(other.getClass())) {
348
      return getClass().getName().compareTo(other.getClass().getName());
349
    }
350
 
351
    int lastComparison = 0;
352
    EntityMonitoringStatus typedOther = (EntityMonitoringStatus)other;
353
 
354
    lastComparison = Boolean.valueOf(isSetEntityType()).compareTo(typedOther.isSetEntityType());
355
    if (lastComparison != 0) {
356
      return lastComparison;
357
    }
358
    if (isSetEntityType()) {
359
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityType, typedOther.entityType);
360
      if (lastComparison != 0) {
361
        return lastComparison;
362
      }
363
    }
364
    lastComparison = Boolean.valueOf(isSetIsActive()).compareTo(typedOther.isSetIsActive());
365
    if (lastComparison != 0) {
366
      return lastComparison;
367
    }
368
    if (isSetIsActive()) {
369
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isActive, typedOther.isActive);
370
      if (lastComparison != 0) {
371
        return lastComparison;
372
      }
373
    }
374
    lastComparison = Boolean.valueOf(isSetUserIds()).compareTo(typedOther.isSetUserIds());
375
    if (lastComparison != 0) {
376
      return lastComparison;
377
    }
378
    if (isSetUserIds()) {
379
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userIds, typedOther.userIds);
380
      if (lastComparison != 0) {
381
        return lastComparison;
382
      }
383
    }
384
    return 0;
385
  }
386
 
387
  public _Fields fieldForId(int fieldId) {
388
    return _Fields.findByThriftId(fieldId);
389
  }
390
 
391
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
392
    org.apache.thrift.protocol.TField field;
393
    iprot.readStructBegin();
394
    while (true)
395
    {
396
      field = iprot.readFieldBegin();
397
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
398
        break;
399
      }
400
      switch (field.id) {
401
        case 1: // ENTITY_TYPE
402
          if (field.type == org.apache.thrift.protocol.TType.I32) {
403
            this.entityType = EntityType.findByValue(iprot.readI32());
404
          } else { 
405
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
406
          }
407
          break;
408
        case 2: // IS_ACTIVE
409
          if (field.type == org.apache.thrift.protocol.TType.BOOL) {
410
            this.isActive = iprot.readBool();
411
            setIsActiveIsSet(true);
412
          } else { 
413
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
414
          }
415
          break;
416
        case 3: // USER_IDS
417
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
418
            this.userIds = iprot.readString();
419
          } else { 
420
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
421
          }
422
          break;
423
        default:
424
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
425
      }
426
      iprot.readFieldEnd();
427
    }
428
    iprot.readStructEnd();
429
    validate();
430
  }
431
 
432
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
433
    validate();
434
 
435
    oprot.writeStructBegin(STRUCT_DESC);
436
    if (this.entityType != null) {
437
      oprot.writeFieldBegin(ENTITY_TYPE_FIELD_DESC);
438
      oprot.writeI32(this.entityType.getValue());
439
      oprot.writeFieldEnd();
440
    }
441
    oprot.writeFieldBegin(IS_ACTIVE_FIELD_DESC);
442
    oprot.writeBool(this.isActive);
443
    oprot.writeFieldEnd();
444
    if (this.userIds != null) {
445
      oprot.writeFieldBegin(USER_IDS_FIELD_DESC);
446
      oprot.writeString(this.userIds);
447
      oprot.writeFieldEnd();
448
    }
449
    oprot.writeFieldStop();
450
    oprot.writeStructEnd();
451
  }
452
 
453
  @Override
454
  public String toString() {
455
    StringBuilder sb = new StringBuilder("EntityMonitoringStatus(");
456
    boolean first = true;
457
 
458
    sb.append("entityType:");
459
    if (this.entityType == null) {
460
      sb.append("null");
461
    } else {
462
      sb.append(this.entityType);
463
    }
464
    first = false;
465
    if (!first) sb.append(", ");
466
    sb.append("isActive:");
467
    sb.append(this.isActive);
468
    first = false;
469
    if (!first) sb.append(", ");
470
    sb.append("userIds:");
471
    if (this.userIds == null) {
472
      sb.append("null");
473
    } else {
474
      sb.append(this.userIds);
475
    }
476
    first = false;
477
    sb.append(")");
478
    return sb.toString();
479
  }
480
 
481
  public void validate() throws org.apache.thrift.TException {
482
    // check for required fields
483
  }
484
 
485
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
486
    try {
487
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
488
    } catch (org.apache.thrift.TException te) {
489
      throw new java.io.IOException(te);
490
    }
491
  }
492
 
493
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
494
    try {
495
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
496
      __isset_bit_vector = new BitSet(1);
497
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
498
    } catch (org.apache.thrift.TException te) {
499
      throw new java.io.IOException(te);
500
    }
501
  }
502
 
503
}
504