Uses of Interface
org.hamcrest.Matcher

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. 
org.junit Provides JUnit core classes and annotations. 
org.junit.experimental.results   
org.junit.matchers Provides useful additional Matchers for use with the Assert.assertThat(Object, org.hamcrest.Matcher) statement 
org.junit.rules   
 

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
<T> Matcher<T>
CoreMatchers.allOf(Iterable<Matcher<? super T>> matchers)
          Creates a matcher that matches if the examined object matches ALL of the specified matchers.
static
<T> Matcher<T>
CoreMatchers.allOf(Matcher<? super T>... matchers)
          Creates a matcher that matches if the examined object matches ALL of the specified matchers.
static
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
CoreMatchers.any(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<Object> CoreMatchers.anything()
          Creates a matcher that always matches, regardless of the examined object.
static Matcher<Object> CoreMatchers.anything(String description)
          Creates a matcher that always matches, regardless of the examined object, but describes itself with the specified String.
static Matcher<String> CoreMatchers.containsString(String substring)
          Creates a matcher that matches if the examined String contains the specified String anywhere.
static
<T> Matcher<T>
CoreMatchers.describedAs(String description, Matcher<T> matcher, Object... values)
          Wraps an existing matcher, overriding its description with that specified.
static Matcher<String> CoreMatchers.endsWith(String suffix)
          Creates a matcher that matches if the examined String ends with the specified String.
static
<T> Matcher<T>
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
<U> Matcher<Iterable<U>>
CoreMatchers.everyItem(Matcher<U> itemMatcher)
          Creates a matcher for Iterables that only matches when a single pass over the examined Iterable yields items that are all matched by the specified itemMatcher.
static
<T> Matcher<Iterable<? super T>>
CoreMatchers.hasItem(Matcher<? super T> itemMatcher)
          Creates a matcher for Iterables that only matches when a single pass over the examined Iterable yields at least one item that is matched by the specified itemMatcher.
static
<T> Matcher<Iterable<? super T>>
CoreMatchers.hasItem(T item)
          Creates a matcher for Iterables that only matches when a single pass over the examined Iterable yields at least one item that is equal to the specified item.
static
<T> Matcher<Iterable<T>>
CoreMatchers.hasItems(Matcher<? super T>... itemMatchers)
          Creates a matcher for Iterables 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
<T> Matcher<Iterable<T>>
CoreMatchers.hasItems(T... items)
          Creates a matcher for Iterables 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
<T> Matcher<T>
CoreMatchers.instanceOf(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
<T> Matcher<T>
CoreMatchers.is(Class<T> type)
          Deprecated. use isA(Class type) instead.
static
<T> Matcher<T>
CoreMatchers.is(Matcher<T> matcher)
          Decorates another Matcher, retaining its behaviour, but allowing tests to be slightly more expressive.
static
<T> Matcher<T>
CoreMatchers.is(T value)
          A shortcut to the frequently used is(equalTo(x)).
static
<T> Matcher<T>
CoreMatchers.isA(Class<T> type)
          A shortcut to the frequently used is(instanceOf(SomeClass.class)).
static
<T> Matcher<T>
CoreMatchers.not(Matcher<T> matcher)
          Creates a matcher that wraps an existing matcher, but inverts the logic by which it will match.
static
<T> Matcher<T>
CoreMatchers.not(T value)
          A shortcut to the frequently used not(equalTo(x)).
static Matcher<Object> CoreMatchers.notNullValue()
          A shortcut to the frequently used not(nullValue()).
static
<T> Matcher<T>
CoreMatchers.notNullValue(Class<T> type)
          A shortcut to the frequently used not(nullValue(X.class)).
static Matcher<Object> CoreMatchers.nullValue()
          Creates a matcher that matches if examined object is null.
static
<T> Matcher<T>
CoreMatchers.nullValue(Class<T> type)
          Creates a matcher that matches if examined object is null.
static
<T> Matcher<T>
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<String> CoreMatchers.startsWith(String prefix)
          Creates a matcher that matches if the examined String starts with the specified String.
static
<T> Matcher<T>
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
<T> Matcher<T>
CoreMatchers.allOf(Matcher<? super T>... matchers)
          Creates a matcher that matches if the examined object matches ALL of the specified matchers.
static
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> AnyOf<T>
CoreMatchers.anyOf(Matcher<? super T>... matchers)
          Creates a matcher that matches if the examined object matches ANY of the specified matchers.
static
<T> AnyOf<T>
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
<T> AnyOf<T>
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
<T> AnyOf<T>
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
<T> AnyOf<T>
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
<T> AnyOf<T>
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
<T> AnyOf<T>
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
<T> AnyOf<T>
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
<T> AnyOf<T>
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
<T> AnyOf<T>
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
<T> AnyOf<T>
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
<T> AnyOf<T>
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
<T> AnyOf<T>
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
<T> AnyOf<T>
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
<T> AnyOf<T>
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
<T> AnyOf<T>
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
<T> AnyOf<T>
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
<T> AnyOf<T>
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
<T> AnyOf<T>
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
<T> AnyOf<T>
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
<T> AnyOf<T>
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
<T> void
MatcherAssert.assertThat(String reason, T actual, Matcher<? super T> matcher)
           
static
<T> void
MatcherAssert.assertThat(T actual, Matcher<? super T> matcher)
           
static
<LHS> CombinableMatcher.CombinableBothMatcher<LHS>
CoreMatchers.both(Matcher<? super LHS> matcher)
          Creates a matcher that matches when both of the specified matchers match the examined object.
static
<T> Matcher<T>
CoreMatchers.describedAs(String description, Matcher<T> matcher, Object... values)
          Wraps an existing matcher, overriding its description with that specified.
static
<LHS> CombinableMatcher.CombinableEitherMatcher<LHS>
CoreMatchers.either(Matcher<? super LHS> matcher)
          Creates a matcher that matches when either of the specified matchers match the examined object.
static
<U> Matcher<Iterable<U>>
CoreMatchers.everyItem(Matcher<U> itemMatcher)
          Creates a matcher for Iterables that only matches when a single pass over the examined Iterable yields items that are all matched by the specified itemMatcher.
static
<T> Matcher<Iterable<? super T>>
CoreMatchers.hasItem(Matcher<? super T> itemMatcher)
          Creates a matcher for Iterables that only matches when a single pass over the examined Iterable yields at least one item that is matched by the specified itemMatcher.
static
<T> Matcher<Iterable<T>>
CoreMatchers.hasItems(Matcher<? super T>... itemMatchers)
          Creates a matcher for Iterables 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
<T> Matcher<T>
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, String message)
           
static
<T> Matcher<T>
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
<T> Matcher<T>
CoreMatchers.allOf(Iterable<Matcher<? super T>> matchers)
          Creates a matcher that matches if the examined object matches ALL of the specified matchers.
static
<T> AnyOf<T>
CoreMatchers.anyOf(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, String featureDescription, 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
<T> Matcher<T>
AllOf.allOf(Iterable<Matcher<? super T>> matchers)
          Creates a matcher that matches if the examined object matches ALL of the specified matchers.
static
<T> Matcher<T>
AllOf.allOf(Matcher<? super T>... matchers)
          Creates a matcher that matches if the examined object matches ALL of the specified matchers.
static
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
IsInstanceOf.any(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<Object> IsAnything.anything()
          Creates a matcher that always matches, regardless of the examined object.
static Matcher<Object> IsAnything.anything(String description)
          Creates a matcher that always matches, regardless of the examined object, but describes itself with the specified String.
static Matcher<String> StringContains.containsString(String substring)
          Creates a matcher that matches if the examined String contains the specified String anywhere.
static
<T> Matcher<T>
DescribedAs.describedAs(String description, Matcher<T> matcher, Object... values)
          Wraps an existing matcher, overriding its description with that specified.
static Matcher<String> StringEndsWith.endsWith(String suffix)
          Creates a matcher that matches if the examined String ends with the specified String.
static
<T> Matcher<T>
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
<U> Matcher<Iterable<U>>
Every.everyItem(Matcher<U> itemMatcher)
          Creates a matcher for Iterables that only matches when a single pass over the examined Iterable yields items that are all matched by the specified itemMatcher.
static
<T> Matcher<Iterable<? super T>>
IsCollectionContaining.hasItem(Matcher<? super T> itemMatcher)
          Creates a matcher for Iterables that only matches when a single pass over the examined Iterable yields at least one item that is matched by the specified itemMatcher.
static
<T> Matcher<Iterable<? super T>>
IsCollectionContaining.hasItem(T item)
          Creates a matcher for Iterables that only matches when a single pass over the examined Iterable yields at least one item that is equal to the specified item.
static
<T> Matcher<Iterable<T>>
IsCollectionContaining.hasItems(Matcher<? super T>... itemMatchers)
          Creates a matcher for Iterables 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
<T> Matcher<Iterable<T>>
IsCollectionContaining.hasItems(T... items)
          Creates a matcher for Iterables 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
<T> Matcher<T>
IsInstanceOf.instanceOf(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
<T> Matcher<T>
Is.is(Class<T> type)
          Deprecated. use isA(Class type) instead.
static
<T> Matcher<T>
Is.is(Matcher<T> matcher)
          Decorates another Matcher, retaining its behaviour, but allowing tests to be slightly more expressive.
static
<T> Matcher<T>
Is.is(T value)
          A shortcut to the frequently used is(equalTo(x)).
static
<T> Matcher<T>
Is.isA(Class<T> type)
          A shortcut to the frequently used is(instanceOf(SomeClass.class)).
static
<T> Matcher<T>
IsNot.not(Matcher<T> matcher)
          Creates a matcher that wraps an existing matcher, but inverts the logic by which it will match.
static
<T> Matcher<T>
IsNot.not(T value)
          A shortcut to the frequently used not(equalTo(x)).
static Matcher<Object> IsNull.notNullValue()
          A shortcut to the frequently used not(nullValue()).
static
<T> Matcher<T>
IsNull.notNullValue(Class<T> type)
          A shortcut to the frequently used not(nullValue(X.class)).
static Matcher<Object> IsNull.nullValue()
          Creates a matcher that matches if examined object is null.
static
<T> Matcher<T>
IsNull.nullValue(Class<T> type)
          Creates a matcher that matches if examined object is null.
static
<T> Matcher<T>
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<String> StringStartsWith.startsWith(String prefix)
          Creates a matcher that matches if the examined String starts with the specified String.
static
<T> Matcher<T>
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
<T> Matcher<T>
AllOf.allOf(Matcher<? super T>... matchers)
          Creates a matcher that matches if the examined object matches ALL of the specified matchers.
static
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> Matcher<T>
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
<T> AnyOf<T>
AnyOf.anyOf(Matcher<? super T>... matchers)
          Creates a matcher that matches if the examined object matches ANY of the specified matchers.
static
<T> AnyOf<T>
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
<T> AnyOf<T>
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
<T> AnyOf<T>
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
<T> AnyOf<T>
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
<T> AnyOf<T>
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
<T> AnyOf<T>
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
<T> AnyOf<T>
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
<T> AnyOf<T>
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
<T> AnyOf<T>
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
<T> AnyOf<T>
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
<T> AnyOf<T>
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
<T> AnyOf<T>
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
<T> AnyOf<T>
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
<T> AnyOf<T>
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
<T> AnyOf<T>
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
<T> AnyOf<T>
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
<T> AnyOf<T>
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
<T> AnyOf<T>
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
<T> AnyOf<T>
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
<T> AnyOf<T>
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
<LHS> CombinableMatcher.CombinableBothMatcher<LHS>
CombinableMatcher.both(Matcher<? super LHS> matcher)
          Creates a matcher that matches when both of the specified matchers match the examined object.
static
<T> Matcher<T>
DescribedAs.describedAs(String description, Matcher<T> matcher, Object... values)
          Wraps an existing matcher, overriding its description with that specified.
static
<LHS> CombinableMatcher.CombinableEitherMatcher<LHS>
CombinableMatcher.either(Matcher<? super LHS> matcher)
          Creates a matcher that matches when either of the specified matchers match the examined object.
static
<U> Matcher<Iterable<U>>
Every.everyItem(Matcher<U> itemMatcher)
          Creates a matcher for Iterables that only matches when a single pass over the examined Iterable yields items that are all matched by the specified itemMatcher.
static
<T> Matcher<Iterable<? super T>>
IsCollectionContaining.hasItem(Matcher<? super T> itemMatcher)
          Creates a matcher for Iterables that only matches when a single pass over the examined Iterable yields at least one item that is matched by the specified itemMatcher.
static
<T> Matcher<Iterable<T>>
IsCollectionContaining.hasItems(Matcher<? super T>... itemMatchers)
          Creates a matcher for Iterables 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
<T> Matcher<T>
Is.is(Matcher<T> matcher)
          Decorates another Matcher, retaining its behaviour, but allowing tests to be slightly more expressive.
static
<T> Matcher<T>
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
<T> Matcher<T>
AllOf.allOf(Iterable<Matcher<? super T>> matchers)
          Creates a matcher that matches if the examined object matches ALL of the specified matchers.
static
<T> AnyOf<T>
AnyOf.anyOf(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(String descriptionTemplate, Matcher<T> matcher, 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(Iterable<Matcher<? super T>> matchers)
           
AnyOf(Iterable<Matcher<? super T>> matchers)
           
 

Uses of Matcher in org.junit
 

Methods in org.junit with parameters of type Matcher
static
<T> void
Assert.assertThat(String reason, T actual, Matcher<? super T> matcher)
          Deprecated. use org.hamcrest.MatcherAssert.assertThat()
static
<T> void
Assert.assertThat(T actual, Matcher<? super T> matcher)
          Deprecated. use org.hamcrest.MatcherAssert.assertThat()
static
<T> void
Assume.assumeThat(String message, T actual, Matcher<T> matcher)
          Call to assume that actual satisfies the condition specified by matcher.
static
<T> void
Assume.assumeThat(T actual, Matcher<T> matcher)
          Call to assume that actual satisfies the condition specified by matcher.
 

Constructors in org.junit with parameters of type Matcher
AssumptionViolatedException(String message, T expected, Matcher<T> matcher)
          An assumption exception with a message with the given actual value and a matcher describing the expectation that failed.
AssumptionViolatedException(T actual, Matcher<T> matcher)
          An assumption exception with the given actual value and a matcher describing the expectation that failed.
 

Uses of Matcher in org.junit.experimental.results
 

Methods in org.junit.experimental.results that return Matcher
static Matcher<PrintableResult> ResultMatchers.failureCountIs(int count)
          Matches if there are count failures
static Matcher<PrintableResult> ResultMatchers.hasFailureContaining(String string)
          Matches if the result has one or more failures, and at least one of them contains string
static Matcher<Object> ResultMatchers.hasSingleFailureContaining(String string)
          Matches if the result has exactly one failure, and it contains string
static Matcher<PrintableResult> ResultMatchers.hasSingleFailureMatching(Matcher<Throwable> matcher)
          Matches if the result has exactly one failure matching the given matcher.
static Matcher<PrintableResult> ResultMatchers.isSuccessful()
          Matches if the tests are all successful
 

Methods in org.junit.experimental.results with parameters of type Matcher
static Matcher<PrintableResult> ResultMatchers.hasSingleFailureMatching(Matcher<Throwable> matcher)
          Matches if the result has exactly one failure matching the given matcher.
 

Uses of Matcher in org.junit.matchers
 

Methods in org.junit.matchers that return Matcher
static Matcher<String> JUnitMatchers.containsString(String substring)
          Deprecated. Please use CoreMatchers.containsString(String) instead.
static
<T> Matcher<Iterable<T>>
JUnitMatchers.everyItem(Matcher<T> elementMatcher)
          Deprecated. Please use CoreMatchers.everyItem(Matcher) instead.
static
<T> Matcher<Iterable<? super T>>
JUnitMatchers.hasItem(Matcher<? super T> elementMatcher)
          Deprecated. Please use CoreMatchers.hasItem(Matcher) instead.
static
<T> Matcher<Iterable<? super T>>
JUnitMatchers.hasItem(T element)
          Deprecated. Please use CoreMatchers.hasItem(Object) instead.
static
<T> Matcher<Iterable<T>>
JUnitMatchers.hasItems(Matcher<? super T>... elementMatchers)
          Deprecated. Please use CoreMatchers.hasItems(Matcher...) instead.
static
<T> Matcher<Iterable<T>>
JUnitMatchers.hasItems(T... elements)
          Deprecated. Please use CoreMatchers.hasItems(Object...) instead.
static
<T extends Exception>
Matcher<T>
JUnitMatchers.isException(Matcher<T> exceptionMatcher)
           
static
<T extends Throwable>
Matcher<T>
JUnitMatchers.isThrowable(Matcher<T> throwableMatcher)
           
 

Methods in org.junit.matchers with parameters of type Matcher
static
<T> CombinableMatcher.CombinableBothMatcher<T>
JUnitMatchers.both(Matcher<? super T> matcher)
          Deprecated. Please use CoreMatchers.both(Matcher) instead.
static
<T> CombinableMatcher.CombinableEitherMatcher<T>
JUnitMatchers.either(Matcher<? super T> matcher)
          Deprecated. Please use CoreMatchers.either(Matcher) instead.
static
<T> Matcher<Iterable<T>>
JUnitMatchers.everyItem(Matcher<T> elementMatcher)
          Deprecated. Please use CoreMatchers.everyItem(Matcher) instead.
static
<T> Matcher<Iterable<? super T>>
JUnitMatchers.hasItem(Matcher<? super T> elementMatcher)
          Deprecated. Please use CoreMatchers.hasItem(Matcher) instead.
static
<T> Matcher<Iterable<T>>
JUnitMatchers.hasItems(Matcher<? super T>... elementMatchers)
          Deprecated. Please use CoreMatchers.hasItems(Matcher...) instead.
static
<T extends Exception>
Matcher<T>
JUnitMatchers.isException(Matcher<T> exceptionMatcher)
           
static
<T extends Throwable>
Matcher<T>
JUnitMatchers.isThrowable(Matcher<T> throwableMatcher)
           
 

Uses of Matcher in org.junit.rules
 

Methods in org.junit.rules with parameters of type Matcher
<T> void
ErrorCollector.checkThat(String reason, T value, Matcher<T> matcher)
          Adds a failure with the given reason to the table if matcher does not match value.
<T> void
ErrorCollector.checkThat(T value, Matcher<T> matcher)
          Adds a failure to the table if matcher does not match value.
 void ExpectedException.expect(Matcher<?> matcher)
          Verify that your code throws an exception that is matched by a Hamcrest matcher.
 void ExpectedException.expectCause(Matcher<?> expectedCause)
          Verify that your code throws an exception whose cause is matched by a Hamcrest matcher.
 void ExpectedException.expectMessage(Matcher<String> matcher)
          Verify that your code throws an exception whose message is matched by a Hamcrest matcher.
 



Copyright © 2002–2020 JUnit. All rights reserved.