Subversion Repositories SmartDukaan

Rev

Blame | Last modification | View Log | RSS feed

/**
 * Autogenerated by Thrift Compiler (0.7.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 */
package in.shop2020.alert;

import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class SearchFilter implements org.apache.thrift.TBase<SearchFilter, SearchFilter._Fields>, java.io.Serializable, Cloneable {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SearchFilter");

  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);
  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)2);
  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)3);
  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)4);
  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)5);
  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)6);

  private EntityType entityType; // required
  private int eventType; // required
  private String entityIdentifier; // required
  private long warnExpiryTime; // required
  private long criticalExpiryTime; // required
  private EntityProcessedState entityProcessedState; // required

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    /**
     * 
     * @see EntityType
     */
    ENTITY_TYPE((short)1, "entityType"),
    EVENT_TYPE((short)2, "eventType"),
    ENTITY_IDENTIFIER((short)3, "entityIdentifier"),
    WARN_EXPIRY_TIME((short)4, "warnExpiryTime"),
    CRITICAL_EXPIRY_TIME((short)5, "criticalExpiryTime"),
    /**
     * 
     * @see EntityProcessedState
     */
    ENTITY_PROCESSED_STATE((short)6, "entityProcessedState");

    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

    static {
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
        byName.put(field.getFieldName(), field);
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // ENTITY_TYPE
          return ENTITY_TYPE;
        case 2: // EVENT_TYPE
          return EVENT_TYPE;
        case 3: // ENTITY_IDENTIFIER
          return ENTITY_IDENTIFIER;
        case 4: // WARN_EXPIRY_TIME
          return WARN_EXPIRY_TIME;
        case 5: // CRITICAL_EXPIRY_TIME
          return CRITICAL_EXPIRY_TIME;
        case 6: // ENTITY_PROCESSED_STATE
          return ENTITY_PROCESSED_STATE;
        default:
          return null;
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, throwing an exception
     * if it is not found.
     */
    public static _Fields findByThriftIdOrThrow(int fieldId) {
      _Fields fields = findByThriftId(fieldId);
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
      return fields;
    }

    /**
     * Find the _Fields constant that matches name, or null if its not found.
     */
    public static _Fields findByName(String name) {
      return byName.get(name);
    }

    private final short _thriftId;
    private final String _fieldName;

    _Fields(short thriftId, String fieldName) {
      _thriftId = thriftId;
      _fieldName = fieldName;
    }

    public short getThriftFieldId() {
      return _thriftId;
    }

    public String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final int __EVENTTYPE_ISSET_ID = 0;
  private static final int __WARNEXPIRYTIME_ISSET_ID = 1;
  private static final int __CRITICALEXPIRYTIME_ISSET_ID = 2;
  private BitSet __isset_bit_vector = new BitSet(3);

  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.ENTITY_TYPE, new org.apache.thrift.meta_data.FieldMetaData("entityType", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, EntityType.class)));
    tmpMap.put(_Fields.EVENT_TYPE, new org.apache.thrift.meta_data.FieldMetaData("eventType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.ENTITY_IDENTIFIER, new org.apache.thrift.meta_data.FieldMetaData("entityIdentifier", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.WARN_EXPIRY_TIME, new org.apache.thrift.meta_data.FieldMetaData("warnExpiryTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.CRITICAL_EXPIRY_TIME, new org.apache.thrift.meta_data.FieldMetaData("criticalExpiryTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.ENTITY_PROCESSED_STATE, new org.apache.thrift.meta_data.FieldMetaData("entityProcessedState", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, EntityProcessedState.class)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SearchFilter.class, metaDataMap);
  }

  public SearchFilter() {
  }

  public SearchFilter(
    int eventType)
  {
    this();
    this.eventType = eventType;
    setEventTypeIsSet(true);
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public SearchFilter(SearchFilter other) {
    __isset_bit_vector.clear();
    __isset_bit_vector.or(other.__isset_bit_vector);
    if (other.isSetEntityType()) {
      this.entityType = other.entityType;
    }
    this.eventType = other.eventType;
    if (other.isSetEntityIdentifier()) {
      this.entityIdentifier = other.entityIdentifier;
    }
    this.warnExpiryTime = other.warnExpiryTime;
    this.criticalExpiryTime = other.criticalExpiryTime;
    if (other.isSetEntityProcessedState()) {
      this.entityProcessedState = other.entityProcessedState;
    }
  }

  public SearchFilter deepCopy() {
    return new SearchFilter(this);
  }

  @Override
  public void clear() {
    this.entityType = null;
    setEventTypeIsSet(false);
    this.eventType = 0;
    this.entityIdentifier = null;
    setWarnExpiryTimeIsSet(false);
    this.warnExpiryTime = 0;
    setCriticalExpiryTimeIsSet(false);
    this.criticalExpiryTime = 0;
    this.entityProcessedState = null;
  }

  /**
   * 
   * @see EntityType
   */
  public EntityType getEntityType() {
    return this.entityType;
  }

  /**
   * 
   * @see EntityType
   */
  public void setEntityType(EntityType entityType) {
    this.entityType = entityType;
  }

  public void unsetEntityType() {
    this.entityType = null;
  }

  /** Returns true if field entityType is set (has been assigned a value) and false otherwise */
  public boolean isSetEntityType() {
    return this.entityType != null;
  }

  public void setEntityTypeIsSet(boolean value) {
    if (!value) {
      this.entityType = null;
    }
  }

  public int getEventType() {
    return this.eventType;
  }

  public void setEventType(int eventType) {
    this.eventType = eventType;
    setEventTypeIsSet(true);
  }

  public void unsetEventType() {
    __isset_bit_vector.clear(__EVENTTYPE_ISSET_ID);
  }

  /** Returns true if field eventType is set (has been assigned a value) and false otherwise */
  public boolean isSetEventType() {
    return __isset_bit_vector.get(__EVENTTYPE_ISSET_ID);
  }

  public void setEventTypeIsSet(boolean value) {
    __isset_bit_vector.set(__EVENTTYPE_ISSET_ID, value);
  }

  public String getEntityIdentifier() {
    return this.entityIdentifier;
  }

  public void setEntityIdentifier(String entityIdentifier) {
    this.entityIdentifier = entityIdentifier;
  }

  public void unsetEntityIdentifier() {
    this.entityIdentifier = null;
  }

  /** Returns true if field entityIdentifier is set (has been assigned a value) and false otherwise */
  public boolean isSetEntityIdentifier() {
    return this.entityIdentifier != null;
  }

  public void setEntityIdentifierIsSet(boolean value) {
    if (!value) {
      this.entityIdentifier = null;
    }
  }

  public long getWarnExpiryTime() {
    return this.warnExpiryTime;
  }

  public void setWarnExpiryTime(long warnExpiryTime) {
    this.warnExpiryTime = warnExpiryTime;
    setWarnExpiryTimeIsSet(true);
  }

  public void unsetWarnExpiryTime() {
    __isset_bit_vector.clear(__WARNEXPIRYTIME_ISSET_ID);
  }

  /** Returns true if field warnExpiryTime is set (has been assigned a value) and false otherwise */
  public boolean isSetWarnExpiryTime() {
    return __isset_bit_vector.get(__WARNEXPIRYTIME_ISSET_ID);
  }

  public void setWarnExpiryTimeIsSet(boolean value) {
    __isset_bit_vector.set(__WARNEXPIRYTIME_ISSET_ID, value);
  }

  public long getCriticalExpiryTime() {
    return this.criticalExpiryTime;
  }

  public void setCriticalExpiryTime(long criticalExpiryTime) {
    this.criticalExpiryTime = criticalExpiryTime;
    setCriticalExpiryTimeIsSet(true);
  }

  public void unsetCriticalExpiryTime() {
    __isset_bit_vector.clear(__CRITICALEXPIRYTIME_ISSET_ID);
  }

  /** Returns true if field criticalExpiryTime is set (has been assigned a value) and false otherwise */
  public boolean isSetCriticalExpiryTime() {
    return __isset_bit_vector.get(__CRITICALEXPIRYTIME_ISSET_ID);
  }

  public void setCriticalExpiryTimeIsSet(boolean value) {
    __isset_bit_vector.set(__CRITICALEXPIRYTIME_ISSET_ID, value);
  }

  /**
   * 
   * @see EntityProcessedState
   */
  public EntityProcessedState getEntityProcessedState() {
    return this.entityProcessedState;
  }

  /**
   * 
   * @see EntityProcessedState
   */
  public void setEntityProcessedState(EntityProcessedState entityProcessedState) {
    this.entityProcessedState = entityProcessedState;
  }

  public void unsetEntityProcessedState() {
    this.entityProcessedState = null;
  }

  /** Returns true if field entityProcessedState is set (has been assigned a value) and false otherwise */
  public boolean isSetEntityProcessedState() {
    return this.entityProcessedState != null;
  }

  public void setEntityProcessedStateIsSet(boolean value) {
    if (!value) {
      this.entityProcessedState = null;
    }
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case ENTITY_TYPE:
      if (value == null) {
        unsetEntityType();
      } else {
        setEntityType((EntityType)value);
      }
      break;

    case EVENT_TYPE:
      if (value == null) {
        unsetEventType();
      } else {
        setEventType((Integer)value);
      }
      break;

    case ENTITY_IDENTIFIER:
      if (value == null) {
        unsetEntityIdentifier();
      } else {
        setEntityIdentifier((String)value);
      }
      break;

    case WARN_EXPIRY_TIME:
      if (value == null) {
        unsetWarnExpiryTime();
      } else {
        setWarnExpiryTime((Long)value);
      }
      break;

    case CRITICAL_EXPIRY_TIME:
      if (value == null) {
        unsetCriticalExpiryTime();
      } else {
        setCriticalExpiryTime((Long)value);
      }
      break;

    case ENTITY_PROCESSED_STATE:
      if (value == null) {
        unsetEntityProcessedState();
      } else {
        setEntityProcessedState((EntityProcessedState)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case ENTITY_TYPE:
      return getEntityType();

    case EVENT_TYPE:
      return Integer.valueOf(getEventType());

    case ENTITY_IDENTIFIER:
      return getEntityIdentifier();

    case WARN_EXPIRY_TIME:
      return Long.valueOf(getWarnExpiryTime());

    case CRITICAL_EXPIRY_TIME:
      return Long.valueOf(getCriticalExpiryTime());

    case ENTITY_PROCESSED_STATE:
      return getEntityProcessedState();

    }
    throw new IllegalStateException();
  }

  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
  public boolean isSet(_Fields field) {
    if (field == null) {
      throw new IllegalArgumentException();
    }

    switch (field) {
    case ENTITY_TYPE:
      return isSetEntityType();
    case EVENT_TYPE:
      return isSetEventType();
    case ENTITY_IDENTIFIER:
      return isSetEntityIdentifier();
    case WARN_EXPIRY_TIME:
      return isSetWarnExpiryTime();
    case CRITICAL_EXPIRY_TIME:
      return isSetCriticalExpiryTime();
    case ENTITY_PROCESSED_STATE:
      return isSetEntityProcessedState();
    }
    throw new IllegalStateException();
  }

  @Override
  public boolean equals(Object that) {
    if (that == null)
      return false;
    if (that instanceof SearchFilter)
      return this.equals((SearchFilter)that);
    return false;
  }

  public boolean equals(SearchFilter that) {
    if (that == null)
      return false;

    boolean this_present_entityType = true && this.isSetEntityType();
    boolean that_present_entityType = true && that.isSetEntityType();
    if (this_present_entityType || that_present_entityType) {
      if (!(this_present_entityType && that_present_entityType))
        return false;
      if (!this.entityType.equals(that.entityType))
        return false;
    }

    boolean this_present_eventType = true;
    boolean that_present_eventType = true;
    if (this_present_eventType || that_present_eventType) {
      if (!(this_present_eventType && that_present_eventType))
        return false;
      if (this.eventType != that.eventType)
        return false;
    }

    boolean this_present_entityIdentifier = true && this.isSetEntityIdentifier();
    boolean that_present_entityIdentifier = true && that.isSetEntityIdentifier();
    if (this_present_entityIdentifier || that_present_entityIdentifier) {
      if (!(this_present_entityIdentifier && that_present_entityIdentifier))
        return false;
      if (!this.entityIdentifier.equals(that.entityIdentifier))
        return false;
    }

    boolean this_present_warnExpiryTime = true && this.isSetWarnExpiryTime();
    boolean that_present_warnExpiryTime = true && that.isSetWarnExpiryTime();
    if (this_present_warnExpiryTime || that_present_warnExpiryTime) {
      if (!(this_present_warnExpiryTime && that_present_warnExpiryTime))
        return false;
      if (this.warnExpiryTime != that.warnExpiryTime)
        return false;
    }

    boolean this_present_criticalExpiryTime = true && this.isSetCriticalExpiryTime();
    boolean that_present_criticalExpiryTime = true && that.isSetCriticalExpiryTime();
    if (this_present_criticalExpiryTime || that_present_criticalExpiryTime) {
      if (!(this_present_criticalExpiryTime && that_present_criticalExpiryTime))
        return false;
      if (this.criticalExpiryTime != that.criticalExpiryTime)
        return false;
    }

    boolean this_present_entityProcessedState = true && this.isSetEntityProcessedState();
    boolean that_present_entityProcessedState = true && that.isSetEntityProcessedState();
    if (this_present_entityProcessedState || that_present_entityProcessedState) {
      if (!(this_present_entityProcessedState && that_present_entityProcessedState))
        return false;
      if (!this.entityProcessedState.equals(that.entityProcessedState))
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    return 0;
  }

  public int compareTo(SearchFilter other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;
    SearchFilter typedOther = (SearchFilter)other;

    lastComparison = Boolean.valueOf(isSetEntityType()).compareTo(typedOther.isSetEntityType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetEntityType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityType, typedOther.entityType);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetEventType()).compareTo(typedOther.isSetEventType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetEventType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eventType, typedOther.eventType);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetEntityIdentifier()).compareTo(typedOther.isSetEntityIdentifier());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetEntityIdentifier()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityIdentifier, typedOther.entityIdentifier);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetWarnExpiryTime()).compareTo(typedOther.isSetWarnExpiryTime());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetWarnExpiryTime()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.warnExpiryTime, typedOther.warnExpiryTime);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCriticalExpiryTime()).compareTo(typedOther.isSetCriticalExpiryTime());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCriticalExpiryTime()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.criticalExpiryTime, typedOther.criticalExpiryTime);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetEntityProcessedState()).compareTo(typedOther.isSetEntityProcessedState());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetEntityProcessedState()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityProcessedState, typedOther.entityProcessedState);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  public _Fields fieldForId(int fieldId) {
    return _Fields.findByThriftId(fieldId);
  }

  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    org.apache.thrift.protocol.TField field;
    iprot.readStructBegin();
    while (true)
    {
      field = iprot.readFieldBegin();
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
        break;
      }
      switch (field.id) {
        case 1: // ENTITY_TYPE
          if (field.type == org.apache.thrift.protocol.TType.I32) {
            this.entityType = EntityType.findByValue(iprot.readI32());
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 2: // EVENT_TYPE
          if (field.type == org.apache.thrift.protocol.TType.I32) {
            this.eventType = iprot.readI32();
            setEventTypeIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 3: // ENTITY_IDENTIFIER
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.entityIdentifier = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 4: // WARN_EXPIRY_TIME
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.warnExpiryTime = iprot.readI64();
            setWarnExpiryTimeIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 5: // CRITICAL_EXPIRY_TIME
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.criticalExpiryTime = iprot.readI64();
            setCriticalExpiryTimeIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 6: // ENTITY_PROCESSED_STATE
          if (field.type == org.apache.thrift.protocol.TType.I32) {
            this.entityProcessedState = EntityProcessedState.findByValue(iprot.readI32());
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        default:
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
      }
      iprot.readFieldEnd();
    }
    iprot.readStructEnd();
    validate();
  }

  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    validate();

    oprot.writeStructBegin(STRUCT_DESC);
    if (this.entityType != null) {
      if (isSetEntityType()) {
        oprot.writeFieldBegin(ENTITY_TYPE_FIELD_DESC);
        oprot.writeI32(this.entityType.getValue());
        oprot.writeFieldEnd();
      }
    }
    oprot.writeFieldBegin(EVENT_TYPE_FIELD_DESC);
    oprot.writeI32(this.eventType);
    oprot.writeFieldEnd();
    if (this.entityIdentifier != null) {
      if (isSetEntityIdentifier()) {
        oprot.writeFieldBegin(ENTITY_IDENTIFIER_FIELD_DESC);
        oprot.writeString(this.entityIdentifier);
        oprot.writeFieldEnd();
      }
    }
    if (isSetWarnExpiryTime()) {
      oprot.writeFieldBegin(WARN_EXPIRY_TIME_FIELD_DESC);
      oprot.writeI64(this.warnExpiryTime);
      oprot.writeFieldEnd();
    }
    if (isSetCriticalExpiryTime()) {
      oprot.writeFieldBegin(CRITICAL_EXPIRY_TIME_FIELD_DESC);
      oprot.writeI64(this.criticalExpiryTime);
      oprot.writeFieldEnd();
    }
    if (this.entityProcessedState != null) {
      if (isSetEntityProcessedState()) {
        oprot.writeFieldBegin(ENTITY_PROCESSED_STATE_FIELD_DESC);
        oprot.writeI32(this.entityProcessedState.getValue());
        oprot.writeFieldEnd();
      }
    }
    oprot.writeFieldStop();
    oprot.writeStructEnd();
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder("SearchFilter(");
    boolean first = true;

    if (isSetEntityType()) {
      sb.append("entityType:");
      if (this.entityType == null) {
        sb.append("null");
      } else {
        sb.append(this.entityType);
      }
      first = false;
    }
    if (!first) sb.append(", ");
    sb.append("eventType:");
    sb.append(this.eventType);
    first = false;
    if (isSetEntityIdentifier()) {
      if (!first) sb.append(", ");
      sb.append("entityIdentifier:");
      if (this.entityIdentifier == null) {
        sb.append("null");
      } else {
        sb.append(this.entityIdentifier);
      }
      first = false;
    }
    if (isSetWarnExpiryTime()) {
      if (!first) sb.append(", ");
      sb.append("warnExpiryTime:");
      sb.append(this.warnExpiryTime);
      first = false;
    }
    if (isSetCriticalExpiryTime()) {
      if (!first) sb.append(", ");
      sb.append("criticalExpiryTime:");
      sb.append(this.criticalExpiryTime);
      first = false;
    }
    if (isSetEntityProcessedState()) {
      if (!first) sb.append(", ");
      sb.append("entityProcessedState:");
      if (this.entityProcessedState == null) {
        sb.append("null");
      } else {
        sb.append(this.entityProcessedState);
      }
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
  }

  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
    try {
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
    try {
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
      __isset_bit_vector = new BitSet(1);
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

}