java.lang.Object
com.inductiveautomation.ignition.common.alarming.query.AbstractFilter<T>
Type Parameters:
T - The type of object that gets filtered
All Implemented Interfaces:
Condition<T>, Filter<T>, Serializable
Direct Known Subclasses:
AlarmFilter, TagQuery

public abstract class AbstractFilter<T> extends Object implements Filter<T>
The base implementation of a filter. A filter, simply put, is a group of conditions that operate against a type T. It can answer "does this T value match our conditions".
See Also:
  • Constructor Details

    • AbstractFilter

      public AbstractFilter()
  • Method Details

    • getLogger

      protected abstract LoggerEx getLogger()
    • passes

      public boolean passes(T value)
      Description copied from interface: Condition
      Returns whether the provided value passes the condition.
      Specified by:
      passes in interface Condition<T>
    • hasConditionFor

      public boolean hasConditionFor(Field<T,?,?> field)
      Description copied from interface: Filter
      Returns whether the filter has a condition for the field.
      Specified by:
      hasConditionFor in interface Filter<T>
    • getConditionFor

      @Nullable public <V, C extends Condition<V>> C getConditionFor(Field<T,V,C> field)
      Description copied from interface: Filter
      Returns the condition for the field, or null if it doesn't exist.
      Specified by:
      getConditionFor in interface Filter<T>
    • isOptimized

      public boolean isOptimized(Field<?,?,?> field)
    • resetOptimized

      public void resetOptimized()
    • markOptimized

      public void markOptimized(Field<?,?,?> field)
      If the query implementation knows how to specially optimize the condition for a certain field, it can mark it here and prevent it from being checked again as part of the filter process.
    • and

      public <F extends AbstractFilter<T>, V, C extends Condition<V>> F and(Field<T,V,C> field, C condition)
    • addRawCondition

      protected void addRawCondition(Field<?,?,?> f, Condition<?> condition)
    • getRawConditions

      protected Map<Field<T,?,?>,Condition<?>> getRawConditions()
    • logCondition

      protected void logCondition(Condition<?> c, Object value, boolean passed)
      Can be overridden to log success/failure conditions.
    • removeCondition

      public void removeCondition(Field<T,?,?> field)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object