Class And

All Implemented Interfaces:
CompositeCondition, Condition, ConditionBuilder

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

    • all

      public static And all(Condition... conditions)
      Creates a new And condition. If all provided Condition instances return true, this condition returns true. If any provided conditions return false, this condition returns false.
      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