Class Or

All Implemented Interfaces:
CompositeCondition, Condition, ConditionBuilder

public final class Or extends DefaultConditionBuilder implements CompositeCondition
Evaluates all provided Condition instances. If any conditions return true, this condition returns true. If all provided conditions return false, this condition returns false.
Author:
Lincoln Baxter, III
  • Method Details

    • any

      public static Or any(Condition... conditions)
      Creates a new Or condition. If any provided conditions return true, this condition returns true.
      Parameters:
      conditions - the array of conditions to be evaluated
    • evaluate

      public boolean evaluate(Rewrite event, EvaluationContext context)
      Description copied from interface: Condition
      Evaluate this condition against the given Rewrite event. If this condition does not apply to the given event, it must return false. If the condition applies and is satisfied, return true.
      Specified by:
      evaluate in interface Condition
    • getConditions

      public List<Condition> getConditions()
      Description copied from interface: CompositeCondition
      Returns all Condition objects contained within this CompositeCondition; otherwise, returns an empty List.
      Specified by:
      getConditions in interface CompositeCondition
    • toString

      public String toString()
      Overrides:
      toString in class Object