public class Matchers
extends java.lang.Object
TupleMatcher
and ValueMatcher
classes.Constructor and Description |
---|
Matchers() |
Modifier and Type | Method and Description |
---|---|
static TupleMatcher |
allOf(TupleMatcher m,
TupleMatcher... matchers)
create a
TupleMatcher that will match if and only if all
of the argument TupleMatcher s does. |
static ValueMatcher |
allOf(ValueMatcher m,
ValueMatcher... matchers)
create a
ValueMatcher that will match if and only if all
of the argument ValueMatcher s does. |
static TupleMatcher |
anyOf(TupleMatcher m,
TupleMatcher... matchers)
create a
TupleMatcher that will match if and only if at
least one of the argument TupleMatcher s does. |
static ValueMatcher |
anyOf(ValueMatcher m,
ValueMatcher... matchers)
create a
ValueMatcher that will match if and only if at
least one of the argument ValueMatcher s does. |
static AnythingMatcher |
anything()
create an
AnythingMatcher that will always match |
static FieldBasedTupleMatcher |
emptyFieldMatcher()
create a
FieldBasedTupleMatcher that will match any Tuple. |
static NonNullValueMatcher |
isNonNull()
create a
ValueMatcher that will match anything non-null |
static NullValueMatcher |
isNull()
create a
ValueMatcher that will only match null values |
static ListValueMatcher |
list(java.util.List<? extends ValueMatcher> matchers)
create a
ListValueMatcher that will match a list of values
which match each matcher |
static ListValueMatcher |
list(java.lang.Object... values)
create a
ListValueMatcher that will match a list of values
which match each value |
static ListValueMatcher |
list(ValueMatcher... matchers)
create a
ListValueMatcher that will match a list of values
which match each matcher |
static ValueMatcher |
literal(java.lang.Object o)
a
ValueMatcher that will match the object. |
static FieldBasedTupleMatcher |
literal(com.streambase.sb.Tuple t)
create a
FieldBasedTupleMatcher that will match the Tuple exactly. |
static TupleMatcher |
not(TupleMatcher m)
create a
TupleMatcher that will match if and only if the
argument TupleMatcher does not. |
static ValueMatcher |
not(ValueMatcher m)
create a
ValueMatcher that will match if and only if the
argument ValueMatcher does not. |
static NothingMatcher |
nothing()
create a
NothingMatcher that will never match |
public static TupleMatcher anyOf(TupleMatcher m, TupleMatcher... matchers)
TupleMatcher
that will match if and only if at
least one of the argument TupleMatcher
s does.public static TupleMatcher allOf(TupleMatcher m, TupleMatcher... matchers)
TupleMatcher
that will match if and only if all
of the argument TupleMatcher
s does.public static ValueMatcher anyOf(ValueMatcher m, ValueMatcher... matchers)
ValueMatcher
that will match if and only if at
least one of the argument ValueMatcher
s does.public static ValueMatcher allOf(ValueMatcher m, ValueMatcher... matchers)
ValueMatcher
that will match if and only if all
of the argument ValueMatcher
s does.public static TupleMatcher not(TupleMatcher m)
TupleMatcher
that will match if and only if the
argument TupleMatcher
does not.public static ValueMatcher not(ValueMatcher m)
ValueMatcher
that will match if and only if the
argument ValueMatcher
does not.public static AnythingMatcher anything()
AnythingMatcher
that will always matchpublic static NothingMatcher nothing()
NothingMatcher
that will never matchpublic static NonNullValueMatcher isNonNull()
ValueMatcher
that will match anything non-nullpublic static NullValueMatcher isNull()
ValueMatcher
that will only match null valuespublic static ListValueMatcher list(java.util.List<? extends ValueMatcher> matchers)
ListValueMatcher
that will match a list of values
which match each matcherpublic static ListValueMatcher list(ValueMatcher... matchers)
ListValueMatcher
that will match a list of values
which match each matcherpublic static ListValueMatcher list(java.lang.Object... values)
ListValueMatcher
that will match a list of values
which match each valuepublic static ValueMatcher literal(java.lang.Object o)
ValueMatcher
that will match the object.
NOTE: This method will attempt to do the correct thing, returning
RatioTestDoubleValueMatcher
for doubles and properly trawling
the hierarchy of the provided Object to create a suitably composed
ValueMatcher
public static FieldBasedTupleMatcher literal(com.streambase.sb.Tuple t)
FieldBasedTupleMatcher
that will match the Tuple exactly.
NOTE: This method will attempt to do the correct thing, returning
RatioTestDoubleValueMatcher
for doubles and properly trawling
the hierarchy of the provided Tuple
to create a suitably
composed FieldBasedTupleMatcher
public static FieldBasedTupleMatcher emptyFieldMatcher()
FieldBasedTupleMatcher
that will match any Tuple.
This is usually used as a base for more complicated matchers.