|
||||||||||
PREV NEXT | FRAMES NO FRAMES |
Packages that use Matcher | |
---|---|
org.hamcrest | The stable API defining Matcher and its associated interfaces and classes. |
org.hamcrest.core | Fundamental matchers of objects and values, and composite matchers. |
Uses of Matcher in org.hamcrest |
---|
Classes in org.hamcrest that implement Matcher | |
---|---|
class |
BaseMatcher<T>
BaseClass for all Matcher implementations. |
class |
CustomMatcher<T>
Utility class for writing one off matchers. |
class |
CustomTypeSafeMatcher<T>
Utility class for writing one off matchers. |
class |
DiagnosingMatcher<T>
TODO(ngd): Document. |
class |
FeatureMatcher<T,U>
Supporting class for matching a feature of an object. |
class |
TypeSafeDiagnosingMatcher<T>
Convenient base class for Matchers that require a non-null value of a specific type and that will report why the received value has been rejected. |
class |
TypeSafeMatcher<T>
Convenient base class for Matchers that require a non-null value of a specific type. |
Methods in org.hamcrest that return Matcher | ||
---|---|---|
static
|
CoreMatchers.allOf(java.lang.Iterable<Matcher<? super T>> matchers)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T>... matchers)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.any(java.lang.Class<T> type)
Creates a matcher that matches when the examined object is an instance of the specified type ,
as determined by calling the Class.isInstance(Object) method on that type, passing the
the examined object. |
|
static Matcher<java.lang.Object> |
CoreMatchers.anything()
Creates a matcher that always matches, regardless of the examined object. |
|
static Matcher<java.lang.Object> |
CoreMatchers.anything(java.lang.String description)
Creates a matcher that always matches, regardless of the examined object, but describes itself with the specified String . |
|
static Matcher<java.lang.String> |
CoreMatchers.containsString(java.lang.String substring)
Creates a matcher that matches if the examined String contains the specified
String anywhere. |
|
static
|
CoreMatchers.describedAs(java.lang.String description,
Matcher<T> matcher,
java.lang.Object... values)
Wraps an existing matcher, overriding its description with that specified. |
|
static Matcher<java.lang.String> |
CoreMatchers.endsWith(java.lang.String suffix)
Creates a matcher that matches if the examined String ends with the specified
String . |
|
static
|
CoreMatchers.equalTo(T operand)
Creates a matcher that matches when the examined object is logically equal to the specified operand , as determined by calling the Object.equals(java.lang.Object) method on
the examined object. |
|
static
|
CoreMatchers.everyItem(Matcher<U> itemMatcher)
Creates a matcher for Iterable s that only matches when a single pass over the
examined Iterable yields items that are all matched by the specified
itemMatcher . |
|
static
|
CoreMatchers.hasItem(Matcher<? super T> itemMatcher)
Creates a matcher for Iterable s that only matches when a single pass over the
examined Iterable yields at least one item that is matched by the specified
itemMatcher . |
|
static
|
CoreMatchers.hasItem(T item)
Creates a matcher for Iterable s that only matches when a single pass over the
examined Iterable yields at least one item that is equal to the specified
item . |
|
static
|
CoreMatchers.hasItems(Matcher<? super T>... itemMatchers)
Creates a matcher for Iterable s that matches when consecutive passes over the
examined Iterable yield at least one item that is matched by the corresponding
matcher from the specified itemMatchers . |
|
static
|
CoreMatchers.hasItems(T... items)
Creates a matcher for Iterable s that matches when consecutive passes over the
examined Iterable yield at least one item that is equal to the corresponding
item from the specified items . |
|
static
|
CoreMatchers.instanceOf(java.lang.Class<?> type)
Creates a matcher that matches when the examined object is an instance of the specified type ,
as determined by calling the Class.isInstance(Object) method on that type, passing the
the examined object. |
|
static
|
CoreMatchers.is(java.lang.Class<T> type)
Deprecated. use isA(Class |
|
static
|
CoreMatchers.is(Matcher<T> matcher)
Decorates another Matcher, retaining its behaviour, but allowing tests to be slightly more expressive. |
|
static
|
CoreMatchers.is(T value)
A shortcut to the frequently used is(equalTo(x)) . |
|
static
|
CoreMatchers.isA(java.lang.Class<T> type)
A shortcut to the frequently used is(instanceOf(SomeClass.class)) . |
|
static
|
CoreMatchers.not(Matcher<T> matcher)
Creates a matcher that wraps an existing matcher, but inverts the logic by which it will match. |
|
static
|
CoreMatchers.not(T value)
A shortcut to the frequently used not(equalTo(x)) . |
|
static Matcher<java.lang.Object> |
CoreMatchers.notNullValue()
A shortcut to the frequently used not(nullValue()) . |
|
static
|
CoreMatchers.notNullValue(java.lang.Class<T> type)
A shortcut to the frequently used not(nullValue(X.class)). |
|
static Matcher<java.lang.Object> |
CoreMatchers.nullValue()
Creates a matcher that matches if examined object is null . |
|
static
|
CoreMatchers.nullValue(java.lang.Class<T> type)
Creates a matcher that matches if examined object is null . |
|
static
|
CoreMatchers.sameInstance(T target)
Creates a matcher that matches only when the examined object is the same instance as the specified target object. |
|
static Matcher<java.lang.String> |
CoreMatchers.startsWith(java.lang.String prefix)
Creates a matcher that matches if the examined String starts with the specified
String . |
|
static
|
CoreMatchers.theInstance(T target)
Creates a matcher that matches only when the examined object is the same instance as the specified target object. |
Methods in org.hamcrest with parameters of type Matcher | ||
---|---|---|
static
|
CoreMatchers.allOf(Matcher<? super T>... matchers)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<? super T>... matchers)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<T> first,
Matcher<? super T> second)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<T> first,
Matcher<? super T> second)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
MatcherAssert.assertThat(java.lang.String reason,
T actual,
Matcher<? super T> matcher)
|
|
static
|
MatcherAssert.assertThat(T actual,
Matcher<? super T> matcher)
|
|
static
|
CoreMatchers.both(Matcher<? super LHS> matcher)
Creates a matcher that matches when both of the specified matchers match the examined object. |
|
static
|
CoreMatchers.describedAs(java.lang.String description,
Matcher<T> matcher,
java.lang.Object... values)
Wraps an existing matcher, overriding its description with that specified. |
|
static
|
CoreMatchers.either(Matcher<? super LHS> matcher)
Creates a matcher that matches when either of the specified matchers match the examined object. |
|
static
|
CoreMatchers.everyItem(Matcher<U> itemMatcher)
Creates a matcher for Iterable s that only matches when a single pass over the
examined Iterable yields items that are all matched by the specified
itemMatcher . |
|
static
|
CoreMatchers.hasItem(Matcher<? super T> itemMatcher)
Creates a matcher for Iterable s that only matches when a single pass over the
examined Iterable yields at least one item that is matched by the specified
itemMatcher . |
|
static
|
CoreMatchers.hasItems(Matcher<? super T>... itemMatchers)
Creates a matcher for Iterable s that matches when consecutive passes over the
examined Iterable yield at least one item that is matched by the corresponding
matcher from the specified itemMatchers . |
|
static
|
CoreMatchers.is(Matcher<T> matcher)
Decorates another Matcher, retaining its behaviour, but allowing tests to be slightly more expressive. |
|
boolean |
Condition.matching(Matcher<T> match)
|
|
abstract boolean |
Condition.matching(Matcher<T> match,
java.lang.String message)
|
|
static
|
CoreMatchers.not(Matcher<T> matcher)
Creates a matcher that wraps an existing matcher, but inverts the logic by which it will match. |
Method parameters in org.hamcrest with type arguments of type Matcher | ||
---|---|---|
static
|
CoreMatchers.allOf(java.lang.Iterable<Matcher<? super T>> matchers)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.anyOf(java.lang.Iterable<Matcher<? super T>> matchers)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
Constructors in org.hamcrest with parameters of type Matcher | |
---|---|
FeatureMatcher(Matcher<? super U> subMatcher,
java.lang.String featureDescription,
java.lang.String featureName)
Constructor |
Uses of Matcher in org.hamcrest.core |
---|
Classes in org.hamcrest.core that implement Matcher | |
---|---|
class |
AllOf<T>
Calculates the logical conjunction of multiple matchers. |
class |
AnyOf<T>
Calculates the logical disjunction of multiple matchers. |
class |
CombinableMatcher<T>
|
class |
DescribedAs<T>
Provides a custom description to another matcher. |
class |
Every<T>
|
class |
Is<T>
Decorates another Matcher, retaining the behaviour but allowing tests to be slightly more expressive. |
class |
IsAnything<T>
A matcher that always returns true . |
class |
IsCollectionContaining<T>
|
class |
IsEqual<T>
Is the value equal to another value, as tested by the Object.equals(java.lang.Object) invokedMethod? |
class |
IsInstanceOf
Tests whether the value is an instance of a class. |
class |
IsNot<T>
Calculates the logical negation of a matcher. |
class |
IsNull<T>
Is the value null? |
class |
IsSame<T>
Is the value the same object as another value? |
class |
StringContains
Tests if the argument is a string that contains a substring. |
class |
StringEndsWith
Tests if the argument is a string that contains a substring. |
class |
StringStartsWith
Tests if the argument is a string that contains a substring. |
class |
SubstringMatcher
|
Methods in org.hamcrest.core that return Matcher | ||
---|---|---|
static
|
AllOf.allOf(java.lang.Iterable<Matcher<? super T>> matchers)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T>... matchers)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
IsInstanceOf.any(java.lang.Class<T> type)
Creates a matcher that matches when the examined object is an instance of the specified type ,
as determined by calling the Class.isInstance(Object) method on that type, passing the
the examined object. |
|
static Matcher<java.lang.Object> |
IsAnything.anything()
Creates a matcher that always matches, regardless of the examined object. |
|
static Matcher<java.lang.Object> |
IsAnything.anything(java.lang.String description)
Creates a matcher that always matches, regardless of the examined object, but describes itself with the specified String . |
|
static Matcher<java.lang.String> |
StringContains.containsString(java.lang.String substring)
Creates a matcher that matches if the examined String contains the specified
String anywhere. |
|
static
|
DescribedAs.describedAs(java.lang.String description,
Matcher<T> matcher,
java.lang.Object... values)
Wraps an existing matcher, overriding its description with that specified. |
|
static Matcher<java.lang.String> |
StringEndsWith.endsWith(java.lang.String suffix)
Creates a matcher that matches if the examined String ends with the specified
String . |
|
static
|
IsEqual.equalTo(T operand)
Creates a matcher that matches when the examined object is logically equal to the specified operand , as determined by calling the Object.equals(java.lang.Object) method on
the examined object. |
|
static
|
Every.everyItem(Matcher<U> itemMatcher)
Creates a matcher for Iterable s that only matches when a single pass over the
examined Iterable yields items that are all matched by the specified
itemMatcher . |
|
static
|
IsCollectionContaining.hasItem(Matcher<? super T> itemMatcher)
Creates a matcher for Iterable s that only matches when a single pass over the
examined Iterable yields at least one item that is matched by the specified
itemMatcher . |
|
static
|
IsCollectionContaining.hasItem(T item)
Creates a matcher for Iterable s that only matches when a single pass over the
examined Iterable yields at least one item that is equal to the specified
item . |
|
static
|
IsCollectionContaining.hasItems(Matcher<? super T>... itemMatchers)
Creates a matcher for Iterable s that matches when consecutive passes over the
examined Iterable yield at least one item that is matched by the corresponding
matcher from the specified itemMatchers . |
|
static
|
IsCollectionContaining.hasItems(T... items)
Creates a matcher for Iterable s that matches when consecutive passes over the
examined Iterable yield at least one item that is equal to the corresponding
item from the specified items . |
|
static
|
IsInstanceOf.instanceOf(java.lang.Class<?> type)
Creates a matcher that matches when the examined object is an instance of the specified type ,
as determined by calling the Class.isInstance(Object) method on that type, passing the
the examined object. |
|
static
|
Is.is(java.lang.Class<T> type)
Deprecated. use isA(Class |
|
static
|
Is.is(Matcher<T> matcher)
Decorates another Matcher, retaining its behaviour, but allowing tests to be slightly more expressive. |
|
static
|
Is.is(T value)
A shortcut to the frequently used is(equalTo(x)) . |
|
static
|
Is.isA(java.lang.Class<T> type)
A shortcut to the frequently used is(instanceOf(SomeClass.class)) . |
|
static
|
IsNot.not(Matcher<T> matcher)
Creates a matcher that wraps an existing matcher, but inverts the logic by which it will match. |
|
static
|
IsNot.not(T value)
A shortcut to the frequently used not(equalTo(x)) . |
|
static Matcher<java.lang.Object> |
IsNull.notNullValue()
A shortcut to the frequently used not(nullValue()) . |
|
static
|
IsNull.notNullValue(java.lang.Class<T> type)
A shortcut to the frequently used not(nullValue(X.class)). |
|
static Matcher<java.lang.Object> |
IsNull.nullValue()
Creates a matcher that matches if examined object is null . |
|
static
|
IsNull.nullValue(java.lang.Class<T> type)
Creates a matcher that matches if examined object is null . |
|
static
|
IsSame.sameInstance(T target)
Creates a matcher that matches only when the examined object is the same instance as the specified target object. |
|
static Matcher<java.lang.String> |
StringStartsWith.startsWith(java.lang.String prefix)
Creates a matcher that matches if the examined String starts with the specified
String . |
|
static
|
IsSame.theInstance(T target)
Creates a matcher that matches only when the examined object is the same instance as the specified target object. |
Methods in org.hamcrest.core with parameters of type Matcher | ||
---|---|---|
static
|
AllOf.allOf(Matcher<? super T>... matchers)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
CombinableMatcher<T> |
CombinableMatcher.and(Matcher<? super T> other)
|
|
CombinableMatcher<X> |
CombinableMatcher.CombinableBothMatcher.and(Matcher<? super X> other)
|
|
static
|
AnyOf.anyOf(Matcher<? super T>... matchers)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
AnyOf.anyOf(Matcher<T> first,
Matcher<? super T> second)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
AnyOf.anyOf(Matcher<T> first,
Matcher<? super T> second)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
AnyOf.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
AnyOf.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
AnyOf.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
AnyOf.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
AnyOf.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
AnyOf.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
AnyOf.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
AnyOf.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
AnyOf.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
AnyOf.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
AnyOf.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
AnyOf.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
AnyOf.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
AnyOf.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
AnyOf.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
AnyOf.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
AnyOf.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
AnyOf.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CombinableMatcher.both(Matcher<? super LHS> matcher)
Creates a matcher that matches when both of the specified matchers match the examined object. |
|
static
|
DescribedAs.describedAs(java.lang.String description,
Matcher<T> matcher,
java.lang.Object... values)
Wraps an existing matcher, overriding its description with that specified. |
|
static
|
CombinableMatcher.either(Matcher<? super LHS> matcher)
Creates a matcher that matches when either of the specified matchers match the examined object. |
|
static
|
Every.everyItem(Matcher<U> itemMatcher)
Creates a matcher for Iterable s that only matches when a single pass over the
examined Iterable yields items that are all matched by the specified
itemMatcher . |
|
static
|
IsCollectionContaining.hasItem(Matcher<? super T> itemMatcher)
Creates a matcher for Iterable s that only matches when a single pass over the
examined Iterable yields at least one item that is matched by the specified
itemMatcher . |
|
static
|
IsCollectionContaining.hasItems(Matcher<? super T>... itemMatchers)
Creates a matcher for Iterable s that matches when consecutive passes over the
examined Iterable yield at least one item that is matched by the corresponding
matcher from the specified itemMatchers . |
|
static
|
Is.is(Matcher<T> matcher)
Decorates another Matcher, retaining its behaviour, but allowing tests to be slightly more expressive. |
|
static
|
IsNot.not(Matcher<T> matcher)
Creates a matcher that wraps an existing matcher, but inverts the logic by which it will match. |
|
CombinableMatcher<T> |
CombinableMatcher.or(Matcher<? super T> other)
|
|
CombinableMatcher<X> |
CombinableMatcher.CombinableEitherMatcher.or(Matcher<? super X> other)
|
Method parameters in org.hamcrest.core with type arguments of type Matcher | ||
---|---|---|
static
|
AllOf.allOf(java.lang.Iterable<Matcher<? super T>> matchers)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AnyOf.anyOf(java.lang.Iterable<Matcher<? super T>> matchers)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
Constructors in org.hamcrest.core with parameters of type Matcher | |
---|---|
CombinableMatcher.CombinableBothMatcher(Matcher<? super X> matcher)
|
|
CombinableMatcher.CombinableEitherMatcher(Matcher<? super X> matcher)
|
|
CombinableMatcher(Matcher<? super T> matcher)
|
|
DescribedAs(java.lang.String descriptionTemplate,
Matcher<T> matcher,
java.lang.Object[] values)
|
|
Every(Matcher<? super T> matcher)
|
|
Is(Matcher<T> matcher)
|
|
IsCollectionContaining(Matcher<? super T> elementMatcher)
|
|
IsNot(Matcher<T> matcher)
|
Constructor parameters in org.hamcrest.core with type arguments of type Matcher | |
---|---|
AllOf(java.lang.Iterable<Matcher<? super T>> matchers)
|
|
AnyOf(java.lang.Iterable<Matcher<? super T>> matchers)
|
|
||||||||||
PREV NEXT | FRAMES NO FRAMES |