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 MonitoredEntity implements org.apache.thrift.TBase<MonitoredEntity, MonitoredEntity._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("MonitoredEntity");
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);
27
  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)2);
28
  private static final org.apache.thrift.protocol.TField EVENT_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("eventType", org.apache.thrift.protocol.TType.I32, (short)3);
29
  private static final org.apache.thrift.protocol.TField ENTITY_IDENTIFIER_FIELD_DESC = new org.apache.thrift.protocol.TField("entityIdentifier", org.apache.thrift.protocol.TType.STRING, (short)4);
30
  private static final org.apache.thrift.protocol.TField WARN_EXPIRY_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("warnExpiryTime", org.apache.thrift.protocol.TType.I64, (short)5);
31
  private static final org.apache.thrift.protocol.TField CRITICAL_EXPIRY_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("criticalExpiryTime", org.apache.thrift.protocol.TType.I64, (short)6);
32
  private static final org.apache.thrift.protocol.TField DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("description", org.apache.thrift.protocol.TType.STRING, (short)7);
33
  private static final org.apache.thrift.protocol.TField ENTITY_PROCESSED_STATE_FIELD_DESC = new org.apache.thrift.protocol.TField("entityProcessedState", org.apache.thrift.protocol.TType.I32, (short)8);
34
 
35
  private long id; // required
36
  private EntityType entityType; // required
37
  private int eventType; // required
38
  private String entityIdentifier; // required
39
  private long warnExpiryTime; // required
40
  private long criticalExpiryTime; // required
41
  private String description; // required
42
  private EntityProcessedState entityProcessedState; // required
43
 
44
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
45
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
46
    ID((short)1, "id"),
47
    /**
48
     * 
49
     * @see EntityType
50
     */
51
    ENTITY_TYPE((short)2, "entityType"),
52
    EVENT_TYPE((short)3, "eventType"),
53
    ENTITY_IDENTIFIER((short)4, "entityIdentifier"),
54
    WARN_EXPIRY_TIME((short)5, "warnExpiryTime"),
55
    CRITICAL_EXPIRY_TIME((short)6, "criticalExpiryTime"),
56
    DESCRIPTION((short)7, "description"),
57
    /**
58
     * 
59
     * @see EntityProcessedState
60
     */
61
    ENTITY_PROCESSED_STATE((short)8, "entityProcessedState");
62
 
63
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
64
 
65
    static {
66
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
67
        byName.put(field.getFieldName(), field);
68
      }
69
    }
70
 
71
    /**
72
     * Find the _Fields constant that matches fieldId, or null if its not found.
73
     */
74
    public static _Fields findByThriftId(int fieldId) {
75
      switch(fieldId) {
76
        case 1: // ID
77
          return ID;
78
        case 2: // ENTITY_TYPE
79
          return ENTITY_TYPE;
80
        case 3: // EVENT_TYPE
81
          return EVENT_TYPE;
82
        case 4: // ENTITY_IDENTIFIER
83
          return ENTITY_IDENTIFIER;
84
        case 5: // WARN_EXPIRY_TIME
85
          return WARN_EXPIRY_TIME;
86
        case 6: // CRITICAL_EXPIRY_TIME
87
          return CRITICAL_EXPIRY_TIME;
88
        case 7: // DESCRIPTION
89
          return DESCRIPTION;
90
        case 8: // ENTITY_PROCESSED_STATE
91
          return ENTITY_PROCESSED_STATE;
92
        default:
93
          return null;
94
      }
95
    }
96
 
97
    /**
98
     * Find the _Fields constant that matches fieldId, throwing an exception
99
     * if it is not found.
100
     */
101
    public static _Fields findByThriftIdOrThrow(int fieldId) {
102
      _Fields fields = findByThriftId(fieldId);
103
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
104
      return fields;
105
    }
106
 
107
    /**
108
     * Find the _Fields constant that matches name, or null if its not found.
109
     */
110
    public static _Fields findByName(String name) {
111
      return byName.get(name);
112
    }
113
 
114
    private final short _thriftId;
115
    private final String _fieldName;
116
 
117
    _Fields(short thriftId, String fieldName) {
118
      _thriftId = thriftId;
119
      _fieldName = fieldName;
120
    }
121
 
122
    public short getThriftFieldId() {
123
      return _thriftId;
124
    }
125
 
126
    public String getFieldName() {
127
      return _fieldName;
128
    }
129
  }
130
 
131
  // isset id assignments
132
  private static final int __ID_ISSET_ID = 0;
133
  private static final int __EVENTTYPE_ISSET_ID = 1;
134
  private static final int __WARNEXPIRYTIME_ISSET_ID = 2;
135
  private static final int __CRITICALEXPIRYTIME_ISSET_ID = 3;
136
  private BitSet __isset_bit_vector = new BitSet(4);
137
 
138
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
139
  static {
140
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
141
    tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
142
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
143
    tmpMap.put(_Fields.ENTITY_TYPE, new org.apache.thrift.meta_data.FieldMetaData("entityType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
144
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, EntityType.class)));
145
    tmpMap.put(_Fields.EVENT_TYPE, new org.apache.thrift.meta_data.FieldMetaData("eventType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
146
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
147
    tmpMap.put(_Fields.ENTITY_IDENTIFIER, new org.apache.thrift.meta_data.FieldMetaData("entityIdentifier", org.apache.thrift.TFieldRequirementType.DEFAULT, 
148
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
149
    tmpMap.put(_Fields.WARN_EXPIRY_TIME, new org.apache.thrift.meta_data.FieldMetaData("warnExpiryTime", org.apache.thrift.TFieldRequirementType.DEFAULT, 
150
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
151
    tmpMap.put(_Fields.CRITICAL_EXPIRY_TIME, new org.apache.thrift.meta_data.FieldMetaData("criticalExpiryTime", org.apache.thrift.TFieldRequirementType.DEFAULT, 
152
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
153
    tmpMap.put(_Fields.DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("description", org.apache.thrift.TFieldRequirementType.DEFAULT, 
154
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
155
    tmpMap.put(_Fields.ENTITY_PROCESSED_STATE, new org.apache.thrift.meta_data.FieldMetaData("entityProcessedState", org.apache.thrift.TFieldRequirementType.DEFAULT, 
156
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, EntityProcessedState.class)));
157
    metaDataMap = Collections.unmodifiableMap(tmpMap);
158
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(MonitoredEntity.class, metaDataMap);
159
  }
160
 
161
  public MonitoredEntity() {
162
  }
163
 
164
  public MonitoredEntity(
165
    long id,
166
    EntityType entityType,
167
    int eventType,
168
    String entityIdentifier,
169
    long warnExpiryTime,
170
    long criticalExpiryTime,
171
    String description,
172
    EntityProcessedState entityProcessedState)
173
  {
174
    this();
175
    this.id = id;
176
    setIdIsSet(true);
177
    this.entityType = entityType;
178
    this.eventType = eventType;
179
    setEventTypeIsSet(true);
180
    this.entityIdentifier = entityIdentifier;
181
    this.warnExpiryTime = warnExpiryTime;
182
    setWarnExpiryTimeIsSet(true);
183
    this.criticalExpiryTime = criticalExpiryTime;
184
    setCriticalExpiryTimeIsSet(true);
185
    this.description = description;
186
    this.entityProcessedState = entityProcessedState;
187
  }
188
 
189
  /**
190
   * Performs a deep copy on <i>other</i>.
191
   */
192
  public MonitoredEntity(MonitoredEntity other) {
193
    __isset_bit_vector.clear();
194
    __isset_bit_vector.or(other.__isset_bit_vector);
195
    this.id = other.id;
196
    if (other.isSetEntityType()) {
197
      this.entityType = other.entityType;
198
    }
199
    this.eventType = other.eventType;
200
    if (other.isSetEntityIdentifier()) {
201
      this.entityIdentifier = other.entityIdentifier;
202
    }
203
    this.warnExpiryTime = other.warnExpiryTime;
204
    this.criticalExpiryTime = other.criticalExpiryTime;
205
    if (other.isSetDescription()) {
206
      this.description = other.description;
207
    }
208
    if (other.isSetEntityProcessedState()) {
209
      this.entityProcessedState = other.entityProcessedState;
210
    }
211
  }
212
 
213
  public MonitoredEntity deepCopy() {
214
    return new MonitoredEntity(this);
215
  }
216
 
217
  @Override
218
  public void clear() {
219
    setIdIsSet(false);
220
    this.id = 0;
221
    this.entityType = null;
222
    setEventTypeIsSet(false);
223
    this.eventType = 0;
224
    this.entityIdentifier = null;
225
    setWarnExpiryTimeIsSet(false);
226
    this.warnExpiryTime = 0;
227
    setCriticalExpiryTimeIsSet(false);
228
    this.criticalExpiryTime = 0;
229
    this.description = null;
230
    this.entityProcessedState = null;
231
  }
232
 
233
  public long getId() {
234
    return this.id;
235
  }
236
 
237
  public void setId(long id) {
238
    this.id = id;
239
    setIdIsSet(true);
240
  }
241
 
242
  public void unsetId() {
243
    __isset_bit_vector.clear(__ID_ISSET_ID);
244
  }
245
 
246
  /** Returns true if field id is set (has been assigned a value) and false otherwise */
247
  public boolean isSetId() {
248
    return __isset_bit_vector.get(__ID_ISSET_ID);
249
  }
250
 
251
  public void setIdIsSet(boolean value) {
252
    __isset_bit_vector.set(__ID_ISSET_ID, value);
253
  }
254
 
255
  /**
256
   * 
257
   * @see EntityType
258
   */
259
  public EntityType getEntityType() {
260
    return this.entityType;
261
  }
262
 
263
  /**
264
   * 
265
   * @see EntityType
266
   */
267
  public void setEntityType(EntityType entityType) {
268
    this.entityType = entityType;
269
  }
270
 
271
  public void unsetEntityType() {
272
    this.entityType = null;
273
  }
274
 
275
  /** Returns true if field entityType is set (has been assigned a value) and false otherwise */
276
  public boolean isSetEntityType() {
277
    return this.entityType != null;
278
  }
279
 
280
  public void setEntityTypeIsSet(boolean value) {
281
    if (!value) {
282
      this.entityType = null;
283
    }
284
  }
285
 
286
  public int getEventType() {
287
    return this.eventType;
288
  }
289
 
290
  public void setEventType(int eventType) {
291
    this.eventType = eventType;
292
    setEventTypeIsSet(true);
293
  }
294
 
295
  public void unsetEventType() {
296
    __isset_bit_vector.clear(__EVENTTYPE_ISSET_ID);
297
  }
298
 
299
  /** Returns true if field eventType is set (has been assigned a value) and false otherwise */
300
  public boolean isSetEventType() {
301
    return __isset_bit_vector.get(__EVENTTYPE_ISSET_ID);
302
  }
303
 
304
  public void setEventTypeIsSet(boolean value) {
305
    __isset_bit_vector.set(__EVENTTYPE_ISSET_ID, value);
306
  }
307
 
308
  public String getEntityIdentifier() {
309
    return this.entityIdentifier;
310
  }
311
 
312
  public void setEntityIdentifier(String entityIdentifier) {
313
    this.entityIdentifier = entityIdentifier;
314
  }
315
 
316
  public void unsetEntityIdentifier() {
317
    this.entityIdentifier = null;
318
  }
319
 
320
  /** Returns true if field entityIdentifier is set (has been assigned a value) and false otherwise */
321
  public boolean isSetEntityIdentifier() {
322
    return this.entityIdentifier != null;
323
  }
324
 
325
  public void setEntityIdentifierIsSet(boolean value) {
326
    if (!value) {
327
      this.entityIdentifier = null;
328
    }
329
  }
330
 
331
  public long getWarnExpiryTime() {
332
    return this.warnExpiryTime;
333
  }
334
 
335
  public void setWarnExpiryTime(long warnExpiryTime) {
336
    this.warnExpiryTime = warnExpiryTime;
337
    setWarnExpiryTimeIsSet(true);
338
  }
339
 
340
  public void unsetWarnExpiryTime() {
341
    __isset_bit_vector.clear(__WARNEXPIRYTIME_ISSET_ID);
342
  }
343
 
344
  /** Returns true if field warnExpiryTime is set (has been assigned a value) and false otherwise */
345
  public boolean isSetWarnExpiryTime() {
346
    return __isset_bit_vector.get(__WARNEXPIRYTIME_ISSET_ID);
347
  }
348
 
349
  public void setWarnExpiryTimeIsSet(boolean value) {
350
    __isset_bit_vector.set(__WARNEXPIRYTIME_ISSET_ID, value);
351
  }
352
 
353
  public long getCriticalExpiryTime() {
354
    return this.criticalExpiryTime;
355
  }
356
 
357
  public void setCriticalExpiryTime(long criticalExpiryTime) {
358
    this.criticalExpiryTime = criticalExpiryTime;
359
    setCriticalExpiryTimeIsSet(true);
360
  }
361
 
362
  public void unsetCriticalExpiryTime() {
363
    __isset_bit_vector.clear(__CRITICALEXPIRYTIME_ISSET_ID);
364
  }
365
 
366
  /** Returns true if field criticalExpiryTime is set (has been assigned a value) and false otherwise */
367
  public boolean isSetCriticalExpiryTime() {
368
    return __isset_bit_vector.get(__CRITICALEXPIRYTIME_ISSET_ID);
369
  }
370
 
371
  public void setCriticalExpiryTimeIsSet(boolean value) {
372
    __isset_bit_vector.set(__CRITICALEXPIRYTIME_ISSET_ID, value);
373
  }
374
 
375
  public String getDescription() {
376
    return this.description;
377
  }
378
 
379
  public void setDescription(String description) {
380
    this.description = description;
381
  }
382
 
383
  public void unsetDescription() {
384
    this.description = null;
385
  }
386
 
387
  /** Returns true if field description is set (has been assigned a value) and false otherwise */
388
  public boolean isSetDescription() {
389
    return this.description != null;
390
  }
391
 
392
  public void setDescriptionIsSet(boolean value) {
393
    if (!value) {
394
      this.description = null;
395
    }
396
  }
397
 
398
  /**
399
   * 
400
   * @see EntityProcessedState
401
   */
402
  public EntityProcessedState getEntityProcessedState() {
403
    return this.entityProcessedState;
404
  }
405
 
406
  /**
407
   * 
408
   * @see EntityProcessedState
409
   */
410
  public void setEntityProcessedState(EntityProcessedState entityProcessedState) {
411
    this.entityProcessedState = entityProcessedState;
412
  }
413
 
414
  public void unsetEntityProcessedState() {
415
    this.entityProcessedState = null;
416
  }
417
 
418
  /** Returns true if field entityProcessedState is set (has been assigned a value) and false otherwise */
419
  public boolean isSetEntityProcessedState() {
420
    return this.entityProcessedState != null;
421
  }
422
 
423
  public void setEntityProcessedStateIsSet(boolean value) {
424
    if (!value) {
425
      this.entityProcessedState = null;
426
    }
427
  }
428
 
429
  public void setFieldValue(_Fields field, Object value) {
430
    switch (field) {
431
    case ID:
432
      if (value == null) {
433
        unsetId();
434
      } else {
435
        setId((Long)value);
436
      }
437
      break;
438
 
439
    case ENTITY_TYPE:
440
      if (value == null) {
441
        unsetEntityType();
442
      } else {
443
        setEntityType((EntityType)value);
444
      }
445
      break;
446
 
447
    case EVENT_TYPE:
448
      if (value == null) {
449
        unsetEventType();
450
      } else {
451
        setEventType((Integer)value);
452
      }
453
      break;
454
 
455
    case ENTITY_IDENTIFIER:
456
      if (value == null) {
457
        unsetEntityIdentifier();
458
      } else {
459
        setEntityIdentifier((String)value);
460
      }
461
      break;
462
 
463
    case WARN_EXPIRY_TIME:
464
      if (value == null) {
465
        unsetWarnExpiryTime();
466
      } else {
467
        setWarnExpiryTime((Long)value);
468
      }
469
      break;
470
 
471
    case CRITICAL_EXPIRY_TIME:
472
      if (value == null) {
473
        unsetCriticalExpiryTime();
474
      } else {
475
        setCriticalExpiryTime((Long)value);
476
      }
477
      break;
478
 
479
    case DESCRIPTION:
480
      if (value == null) {
481
        unsetDescription();
482
      } else {
483
        setDescription((String)value);
484
      }
485
      break;
486
 
487
    case ENTITY_PROCESSED_STATE:
488
      if (value == null) {
489
        unsetEntityProcessedState();
490
      } else {
491
        setEntityProcessedState((EntityProcessedState)value);
492
      }
493
      break;
494
 
495
    }
496
  }
497
 
498
  public Object getFieldValue(_Fields field) {
499
    switch (field) {
500
    case ID:
501
      return Long.valueOf(getId());
502
 
503
    case ENTITY_TYPE:
504
      return getEntityType();
505
 
506
    case EVENT_TYPE:
507
      return Integer.valueOf(getEventType());
508
 
509
    case ENTITY_IDENTIFIER:
510
      return getEntityIdentifier();
511
 
512
    case WARN_EXPIRY_TIME:
513
      return Long.valueOf(getWarnExpiryTime());
514
 
515
    case CRITICAL_EXPIRY_TIME:
516
      return Long.valueOf(getCriticalExpiryTime());
517
 
518
    case DESCRIPTION:
519
      return getDescription();
520
 
521
    case ENTITY_PROCESSED_STATE:
522
      return getEntityProcessedState();
523
 
524
    }
525
    throw new IllegalStateException();
526
  }
527
 
528
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
529
  public boolean isSet(_Fields field) {
530
    if (field == null) {
531
      throw new IllegalArgumentException();
532
    }
533
 
534
    switch (field) {
535
    case ID:
536
      return isSetId();
537
    case ENTITY_TYPE:
538
      return isSetEntityType();
539
    case EVENT_TYPE:
540
      return isSetEventType();
541
    case ENTITY_IDENTIFIER:
542
      return isSetEntityIdentifier();
543
    case WARN_EXPIRY_TIME:
544
      return isSetWarnExpiryTime();
545
    case CRITICAL_EXPIRY_TIME:
546
      return isSetCriticalExpiryTime();
547
    case DESCRIPTION:
548
      return isSetDescription();
549
    case ENTITY_PROCESSED_STATE:
550
      return isSetEntityProcessedState();
551
    }
552
    throw new IllegalStateException();
553
  }
554
 
555
  @Override
556
  public boolean equals(Object that) {
557
    if (that == null)
558
      return false;
559
    if (that instanceof MonitoredEntity)
560
      return this.equals((MonitoredEntity)that);
561
    return false;
562
  }
563
 
564
  public boolean equals(MonitoredEntity that) {
565
    if (that == null)
566
      return false;
567
 
568
    boolean this_present_id = true;
569
    boolean that_present_id = true;
570
    if (this_present_id || that_present_id) {
571
      if (!(this_present_id && that_present_id))
572
        return false;
573
      if (this.id != that.id)
574
        return false;
575
    }
576
 
577
    boolean this_present_entityType = true && this.isSetEntityType();
578
    boolean that_present_entityType = true && that.isSetEntityType();
579
    if (this_present_entityType || that_present_entityType) {
580
      if (!(this_present_entityType && that_present_entityType))
581
        return false;
582
      if (!this.entityType.equals(that.entityType))
583
        return false;
584
    }
585
 
586
    boolean this_present_eventType = true;
587
    boolean that_present_eventType = true;
588
    if (this_present_eventType || that_present_eventType) {
589
      if (!(this_present_eventType && that_present_eventType))
590
        return false;
591
      if (this.eventType != that.eventType)
592
        return false;
593
    }
594
 
595
    boolean this_present_entityIdentifier = true && this.isSetEntityIdentifier();
596
    boolean that_present_entityIdentifier = true && that.isSetEntityIdentifier();
597
    if (this_present_entityIdentifier || that_present_entityIdentifier) {
598
      if (!(this_present_entityIdentifier && that_present_entityIdentifier))
599
        return false;
600
      if (!this.entityIdentifier.equals(that.entityIdentifier))
601
        return false;
602
    }
603
 
604
    boolean this_present_warnExpiryTime = true;
605
    boolean that_present_warnExpiryTime = true;
606
    if (this_present_warnExpiryTime || that_present_warnExpiryTime) {
607
      if (!(this_present_warnExpiryTime && that_present_warnExpiryTime))
608
        return false;
609
      if (this.warnExpiryTime != that.warnExpiryTime)
610
        return false;
611
    }
612
 
613
    boolean this_present_criticalExpiryTime = true;
614
    boolean that_present_criticalExpiryTime = true;
615
    if (this_present_criticalExpiryTime || that_present_criticalExpiryTime) {
616
      if (!(this_present_criticalExpiryTime && that_present_criticalExpiryTime))
617
        return false;
618
      if (this.criticalExpiryTime != that.criticalExpiryTime)
619
        return false;
620
    }
621
 
622
    boolean this_present_description = true && this.isSetDescription();
623
    boolean that_present_description = true && that.isSetDescription();
624
    if (this_present_description || that_present_description) {
625
      if (!(this_present_description && that_present_description))
626
        return false;
627
      if (!this.description.equals(that.description))
628
        return false;
629
    }
630
 
631
    boolean this_present_entityProcessedState = true && this.isSetEntityProcessedState();
632
    boolean that_present_entityProcessedState = true && that.isSetEntityProcessedState();
633
    if (this_present_entityProcessedState || that_present_entityProcessedState) {
634
      if (!(this_present_entityProcessedState && that_present_entityProcessedState))
635
        return false;
636
      if (!this.entityProcessedState.equals(that.entityProcessedState))
637
        return false;
638
    }
639
 
640
    return true;
641
  }
642
 
643
  @Override
644
  public int hashCode() {
645
    return 0;
646
  }
647
 
648
  public int compareTo(MonitoredEntity other) {
649
    if (!getClass().equals(other.getClass())) {
650
      return getClass().getName().compareTo(other.getClass().getName());
651
    }
652
 
653
    int lastComparison = 0;
654
    MonitoredEntity typedOther = (MonitoredEntity)other;
655
 
656
    lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
657
    if (lastComparison != 0) {
658
      return lastComparison;
659
    }
660
    if (isSetId()) {
661
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
662
      if (lastComparison != 0) {
663
        return lastComparison;
664
      }
665
    }
666
    lastComparison = Boolean.valueOf(isSetEntityType()).compareTo(typedOther.isSetEntityType());
667
    if (lastComparison != 0) {
668
      return lastComparison;
669
    }
670
    if (isSetEntityType()) {
671
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityType, typedOther.entityType);
672
      if (lastComparison != 0) {
673
        return lastComparison;
674
      }
675
    }
676
    lastComparison = Boolean.valueOf(isSetEventType()).compareTo(typedOther.isSetEventType());
677
    if (lastComparison != 0) {
678
      return lastComparison;
679
    }
680
    if (isSetEventType()) {
681
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eventType, typedOther.eventType);
682
      if (lastComparison != 0) {
683
        return lastComparison;
684
      }
685
    }
686
    lastComparison = Boolean.valueOf(isSetEntityIdentifier()).compareTo(typedOther.isSetEntityIdentifier());
687
    if (lastComparison != 0) {
688
      return lastComparison;
689
    }
690
    if (isSetEntityIdentifier()) {
691
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityIdentifier, typedOther.entityIdentifier);
692
      if (lastComparison != 0) {
693
        return lastComparison;
694
      }
695
    }
696
    lastComparison = Boolean.valueOf(isSetWarnExpiryTime()).compareTo(typedOther.isSetWarnExpiryTime());
697
    if (lastComparison != 0) {
698
      return lastComparison;
699
    }
700
    if (isSetWarnExpiryTime()) {
701
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.warnExpiryTime, typedOther.warnExpiryTime);
702
      if (lastComparison != 0) {
703
        return lastComparison;
704
      }
705
    }
706
    lastComparison = Boolean.valueOf(isSetCriticalExpiryTime()).compareTo(typedOther.isSetCriticalExpiryTime());
707
    if (lastComparison != 0) {
708
      return lastComparison;
709
    }
710
    if (isSetCriticalExpiryTime()) {
711
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.criticalExpiryTime, typedOther.criticalExpiryTime);
712
      if (lastComparison != 0) {
713
        return lastComparison;
714
      }
715
    }
716
    lastComparison = Boolean.valueOf(isSetDescription()).compareTo(typedOther.isSetDescription());
717
    if (lastComparison != 0) {
718
      return lastComparison;
719
    }
720
    if (isSetDescription()) {
721
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.description, typedOther.description);
722
      if (lastComparison != 0) {
723
        return lastComparison;
724
      }
725
    }
726
    lastComparison = Boolean.valueOf(isSetEntityProcessedState()).compareTo(typedOther.isSetEntityProcessedState());
727
    if (lastComparison != 0) {
728
      return lastComparison;
729
    }
730
    if (isSetEntityProcessedState()) {
731
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityProcessedState, typedOther.entityProcessedState);
732
      if (lastComparison != 0) {
733
        return lastComparison;
734
      }
735
    }
736
    return 0;
737
  }
738
 
739
  public _Fields fieldForId(int fieldId) {
740
    return _Fields.findByThriftId(fieldId);
741
  }
742
 
743
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
744
    org.apache.thrift.protocol.TField field;
745
    iprot.readStructBegin();
746
    while (true)
747
    {
748
      field = iprot.readFieldBegin();
749
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
750
        break;
751
      }
752
      switch (field.id) {
753
        case 1: // ID
754
          if (field.type == org.apache.thrift.protocol.TType.I64) {
755
            this.id = iprot.readI64();
756
            setIdIsSet(true);
757
          } else { 
758
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
759
          }
760
          break;
761
        case 2: // ENTITY_TYPE
762
          if (field.type == org.apache.thrift.protocol.TType.I32) {
763
            this.entityType = EntityType.findByValue(iprot.readI32());
764
          } else { 
765
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
766
          }
767
          break;
768
        case 3: // EVENT_TYPE
769
          if (field.type == org.apache.thrift.protocol.TType.I32) {
770
            this.eventType = iprot.readI32();
771
            setEventTypeIsSet(true);
772
          } else { 
773
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
774
          }
775
          break;
776
        case 4: // ENTITY_IDENTIFIER
777
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
778
            this.entityIdentifier = iprot.readString();
779
          } else { 
780
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
781
          }
782
          break;
783
        case 5: // WARN_EXPIRY_TIME
784
          if (field.type == org.apache.thrift.protocol.TType.I64) {
785
            this.warnExpiryTime = iprot.readI64();
786
            setWarnExpiryTimeIsSet(true);
787
          } else { 
788
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
789
          }
790
          break;
791
        case 6: // CRITICAL_EXPIRY_TIME
792
          if (field.type == org.apache.thrift.protocol.TType.I64) {
793
            this.criticalExpiryTime = iprot.readI64();
794
            setCriticalExpiryTimeIsSet(true);
795
          } else { 
796
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
797
          }
798
          break;
799
        case 7: // DESCRIPTION
800
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
801
            this.description = iprot.readString();
802
          } else { 
803
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
804
          }
805
          break;
806
        case 8: // ENTITY_PROCESSED_STATE
807
          if (field.type == org.apache.thrift.protocol.TType.I32) {
808
            this.entityProcessedState = EntityProcessedState.findByValue(iprot.readI32());
809
          } else { 
810
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
811
          }
812
          break;
813
        default:
814
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
815
      }
816
      iprot.readFieldEnd();
817
    }
818
    iprot.readStructEnd();
819
    validate();
820
  }
821
 
822
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
823
    validate();
824
 
825
    oprot.writeStructBegin(STRUCT_DESC);
826
    oprot.writeFieldBegin(ID_FIELD_DESC);
827
    oprot.writeI64(this.id);
828
    oprot.writeFieldEnd();
829
    if (this.entityType != null) {
830
      oprot.writeFieldBegin(ENTITY_TYPE_FIELD_DESC);
831
      oprot.writeI32(this.entityType.getValue());
832
      oprot.writeFieldEnd();
833
    }
834
    oprot.writeFieldBegin(EVENT_TYPE_FIELD_DESC);
835
    oprot.writeI32(this.eventType);
836
    oprot.writeFieldEnd();
837
    if (this.entityIdentifier != null) {
838
      oprot.writeFieldBegin(ENTITY_IDENTIFIER_FIELD_DESC);
839
      oprot.writeString(this.entityIdentifier);
840
      oprot.writeFieldEnd();
841
    }
842
    oprot.writeFieldBegin(WARN_EXPIRY_TIME_FIELD_DESC);
843
    oprot.writeI64(this.warnExpiryTime);
844
    oprot.writeFieldEnd();
845
    oprot.writeFieldBegin(CRITICAL_EXPIRY_TIME_FIELD_DESC);
846
    oprot.writeI64(this.criticalExpiryTime);
847
    oprot.writeFieldEnd();
848
    if (this.description != null) {
849
      oprot.writeFieldBegin(DESCRIPTION_FIELD_DESC);
850
      oprot.writeString(this.description);
851
      oprot.writeFieldEnd();
852
    }
853
    if (this.entityProcessedState != null) {
854
      oprot.writeFieldBegin(ENTITY_PROCESSED_STATE_FIELD_DESC);
855
      oprot.writeI32(this.entityProcessedState.getValue());
856
      oprot.writeFieldEnd();
857
    }
858
    oprot.writeFieldStop();
859
    oprot.writeStructEnd();
860
  }
861
 
862
  @Override
863
  public String toString() {
864
    StringBuilder sb = new StringBuilder("MonitoredEntity(");
865
    boolean first = true;
866
 
867
    sb.append("id:");
868
    sb.append(this.id);
869
    first = false;
870
    if (!first) sb.append(", ");
871
    sb.append("entityType:");
872
    if (this.entityType == null) {
873
      sb.append("null");
874
    } else {
875
      sb.append(this.entityType);
876
    }
877
    first = false;
878
    if (!first) sb.append(", ");
879
    sb.append("eventType:");
880
    sb.append(this.eventType);
881
    first = false;
882
    if (!first) sb.append(", ");
883
    sb.append("entityIdentifier:");
884
    if (this.entityIdentifier == null) {
885
      sb.append("null");
886
    } else {
887
      sb.append(this.entityIdentifier);
888
    }
889
    first = false;
890
    if (!first) sb.append(", ");
891
    sb.append("warnExpiryTime:");
892
    sb.append(this.warnExpiryTime);
893
    first = false;
894
    if (!first) sb.append(", ");
895
    sb.append("criticalExpiryTime:");
896
    sb.append(this.criticalExpiryTime);
897
    first = false;
898
    if (!first) sb.append(", ");
899
    sb.append("description:");
900
    if (this.description == null) {
901
      sb.append("null");
902
    } else {
903
      sb.append(this.description);
904
    }
905
    first = false;
906
    if (!first) sb.append(", ");
907
    sb.append("entityProcessedState:");
908
    if (this.entityProcessedState == null) {
909
      sb.append("null");
910
    } else {
911
      sb.append(this.entityProcessedState);
912
    }
913
    first = false;
914
    sb.append(")");
915
    return sb.toString();
916
  }
917
 
918
  public void validate() throws org.apache.thrift.TException {
919
    // check for required fields
920
  }
921
 
922
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
923
    try {
924
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
925
    } catch (org.apache.thrift.TException te) {
926
      throw new java.io.IOException(te);
927
    }
928
  }
929
 
930
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
931
    try {
932
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
933
      __isset_bit_vector = new BitSet(1);
934
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
935
    } catch (org.apache.thrift.TException te) {
936
      throw new java.io.IOException(te);
937
    }
938
  }
939
 
940
}
941