Class OrMatcher<M>

Type Parameters:
M - The matchee type
All Implemented Interfaces:
Matchable<M>, Matcher<M>, org.refcodes.mixin.AliasAccessor, org.refcodes.mixin.Schemable

public class OrMatcher<M> extends AbstractMatcherComposite<M>
A logical OR implementation of a Matcher encapsulating Matcher instances. The OR Matcher matches when any of the provided Matcher instances does match (OR).
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.refcodes.mixin.AliasAccessor

    org.refcodes.mixin.AliasAccessor.AliasBuilder<B extends org.refcodes.mixin.AliasAccessor.AliasBuilder<B>>, org.refcodes.mixin.AliasAccessor.AliasMutator, org.refcodes.mixin.AliasAccessor.AliasProperty
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     

    Fields inherited from class org.refcodes.matcher.AbstractMatcherComposite

    _matchers
  • Constructor Summary

    Constructors
    Constructor
    Description
    OrMatcher(Matcher<M>... aMatchers)
    Constructs an OR Matcher, i.e. any of the provided Matcher instances need to match in order for the OR Matcher to match.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    isMatching(M aMatchee)
    Tests whether the given event is matching the mathcer's criteria.

    Methods inherited from class org.refcodes.matcher.AbstractMatcherComposite

    toSchema

    Methods inherited from class org.refcodes.matcher.AbstractMatcher

    getAlias

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • OrMatcher

      @SafeVarargs public OrMatcher(Matcher<M>... aMatchers)
      Constructs an OR Matcher, i.e. any of the provided Matcher instances need to match in order for the OR Matcher to match.
      Parameters:
      aMatchers - The Matcher instances to be combined with a logical OR.
  • Method Details

    • isMatching

      public boolean isMatching(M aMatchee)
      Tests whether the given event is matching the mathcer's criteria.
      Parameters:
      aMatchee - The matchee used for testing matchability.
      Returns:
      True in case the matchee matches the matcher's criteria, else false.