java.lang.Object
org.refcodes.matcher.MatcherSugar
Declarative syntactic sugar which may be statically imported in order to
allow declarative definitions for the
Matcher elements.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <M> Matcher<M>static <M> Matcher<M>any()Import static ANY implementation of aMatcherwhich always returnstrue.static <M> Matcher<M>equalWith(M aMatchee) Import static EQUAL WITHMatcher, comparing its matchee with the matchee provided to theMatchable.isMatching(Object)method for equality.static <M extends Comparable<M>>
Matcher<M>greaterOrEqualThan(M aMatchee) Import static GREATER OR EQUAL THANMatcher, comparing its matchee with the matchee provided to theMatchable.isMatching(Object)method using theComparable.compareTo(Object)method to be implemented by the matchees.static <M extends Comparable<M>>
Matcher<M>greaterThan(M aMatchee) Import static GREATER THANMatcher, comparing its matchee with the matchee provided to theMatchable.isMatching(Object)method using theComparable.compareTo(Object)method to be implemented by the matchees.static <M> Matcher<M>isAssignableFrom(Class<?> aMatcheeType) Static import IS ASSIGNABLE FROMMatcherusing the type of the matchees being the criteria to determine a match.static <M extends Comparable<M>>
Matcher<M>lessOrEqualThan(M aMatchee) Import static LESS OR EQUAL THANMatcher, comparing its matchee with the matchee provided to theMatchable.isMatching(Object)method using theComparable.compareTo(Object)method to be implemented by the matchees.static <M extends Comparable<M>>
Matcher<M>lessThan(M aMatchee) Import static LESS THANMatcher, comparing its matchee with the matchee provided to theMatchable.isMatching(Object)method using theComparable.compareTo(Object)method to be implemented by the matchees.static <M> Matcher<M>none()Import static NONE implementation of aMatcherwhich always returnsfalse.static <M> Matcher<M>Import static NOTMatcherwhoseMatchable.isMatching(Object)method inverts (NOT) theMatchable.isMatching(Object)result of the encapsulatedMatcher.static <M> Matcher<M>notEqualWith(M aMatchee) Import static NOT EQUAL WITHMatcher, comparing its matchee with the matchee provided to theMatchable.isMatching(Object)method for equality.static <M> Matcher<M>
-
Constructor Details
-
MatcherSugar
protected MatcherSugar()Instantiates a new matcher sugar.
-
-
Method Details
-
isAssignableFrom
Static import IS ASSIGNABLE FROMMatcherusing the type of the matchees being the criteria to determine a match.- Type Parameters:
M- The type of the matchee to be matched- Parameters:
aMatcheeType- The type of the matchee to match.- Returns:
- A
Matcherby type.
-
or
-
and
-
not
Import static NOTMatcherwhoseMatchable.isMatching(Object)method inverts (NOT) theMatchable.isMatching(Object)result of the encapsulatedMatcher. -
any
Import static ANY implementation of aMatcherwhich always returnstrue.- Type Parameters:
M- The matchee type.- Returns:
- An ANY
Matcher.
-
none
Import static NONE implementation of aMatcherwhich always returnsfalse.- Type Parameters:
M- The matchee type.- Returns:
- A NONE
Matcher.
-
equalWith
Import static EQUAL WITHMatcher, comparing its matchee with the matchee provided to theMatchable.isMatching(Object)method for equality.- Type Parameters:
M- The matchee type.- Parameters:
aMatchee- The matchee with which to match.- Returns:
- An EQUAL WITH
Matcher.
-
notEqualWith
Import static NOT EQUAL WITHMatcher, comparing its matchee with the matchee provided to theMatchable.isMatching(Object)method for equality.- Type Parameters:
M- The matchee type.- Parameters:
aMatchee- The matchee with which to match.- Returns:
- An NOT EQUAL WITH
Matcher.
-
greaterOrEqualThan
Import static GREATER OR EQUAL THANMatcher, comparing its matchee with the matchee provided to theMatchable.isMatching(Object)method using theComparable.compareTo(Object)method to be implemented by the matchees.- Type Parameters:
M- The matchee type.- Parameters:
aMatchee- The matchee with which to match.- Returns:
- A NOT EQUAL WITH
Matcher.
-
greaterThan
Import static GREATER THANMatcher, comparing its matchee with the matchee provided to theMatchable.isMatching(Object)method using theComparable.compareTo(Object)method to be implemented by the matchees.- Type Parameters:
M- The matchee type.- Parameters:
aMatchee- The matchee with which to match.- Returns:
- A GREATER THAN
Matcher.
-
lessOrEqualThan
Import static LESS OR EQUAL THANMatcher, comparing its matchee with the matchee provided to theMatchable.isMatching(Object)method using theComparable.compareTo(Object)method to be implemented by the matchees.- Type Parameters:
M- The matchee type.- Parameters:
aMatchee- The matchee with which to match.- Returns:
- An LESS OR EQUAL THAN
Matcher.
-
lessThan
Import static LESS THANMatcher, comparing its matchee with the matchee provided to theMatchable.isMatching(Object)method using theComparable.compareTo(Object)method to be implemented by the matchees.- Type Parameters:
M- The matchee type.- Parameters:
aMatchee- The matchee with which to match.- Returns:
- An LESS THAN
Matcher.
-