Package org.refcodes.matcher
Class NotMatcherImpl<M>
- java.lang.Object
-
- org.refcodes.matcher.NotMatcherImpl<M>
-
- Type Parameters:
M
- The matchee type.
- All Implemented Interfaces:
Matcher<M>
public class NotMatcherImpl<M> extends java.lang.Object implements Matcher<M>
A logical NOT implementation of aMatcher
encapsulating anotherMatcher
. The NOTMatcher
'sisMatching(Object)
method inverts (NOT) theisMatching(Object)
result of the encapsulatedMatcher
.
-
-
Constructor Summary
Constructors Constructor Description NotMatcherImpl(Matcher<M> aMatcher)
Constructs a NOTMatcher
whoseisMatching(Object)
method inverts (NOT) theisMatching(Object)
result of the encapsulatedMatcher
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isMatching(M aMatchee)
Tests whether the given event is matching the mathcer's criteria.
-
-
-
Constructor Detail
-
NotMatcherImpl
public NotMatcherImpl(Matcher<M> aMatcher)
Constructs a NOTMatcher
whoseisMatching(Object)
method inverts (NOT) theisMatching(Object)
result of the encapsulatedMatcher
.- Parameters:
aMatcher
- TheMatcher
to be wrapped with a NOT.
-
-
Method Detail
-
isMatching
public boolean isMatching(M aMatchee)
Tests whether the given event is matching the mathcer's criteria.- Specified by:
isMatching
in interfaceMatcher<M>
- Parameters:
aMatchee
- The matchee used for testing matchability.- Returns:
- True in case the matchee matches the matcher's criteria, else false.
-
-