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.internal   
org.junit.internal.matchers   
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.
 

Methods in org.hamcrest that return Matcher
static
<T> Matcher<T>
CoreMatchers.allOf(Iterable<Matcher<? extends T>> matchers)
          Evaluates to true only if ALL of the passed in matchers evaluate to true.
static
<T> Matcher<T>
CoreMatchers.allOf(Matcher<? extends T>... matchers)
          Evaluates to true only if ALL of the passed in matchers evaluate to true.
static
<T> Matcher<T>
CoreMatchers.any(Class<T> type)
          This matcher always evaluates to true.
static
<T> Matcher<T>
CoreMatchers.anyOf(Iterable<Matcher<? extends T>> matchers)
          Evaluates to true if ANY of the passed in matchers evaluate to true.
static
<T> Matcher<T>
CoreMatchers.anyOf(Matcher<? extends T>... matchers)
          Evaluates to true if ANY of the passed in matchers evaluate to true.
static
<T> Matcher<T>
CoreMatchers.anything()
          This matcher always evaluates to true.
static
<T> Matcher<T>
CoreMatchers.anything(String description)
          This matcher always evaluates to true.
static
<T> Matcher<T>
CoreMatchers.describedAs(String description, Matcher<T> matcher, Object... values)
          Wraps an existing matcher and overrides the description when it fails.
static
<T> Matcher<T>
CoreMatchers.equalTo(T operand)
          Is the value equal to another value, as tested by the Object.equals(java.lang.Object) invokedMethod?
static Matcher<Object> CoreMatchers.instanceOf(Class<?> type)
          Is the value an instance of a particular type?
static Matcher<Object> CoreMatchers.is(Class<?> type)
          This is a shortcut to the frequently used is(instanceOf(SomeClass.class)).
static
<T> Matcher<T>
CoreMatchers.is(Matcher<T> matcher)
          Decorates another Matcher, retaining the behavior but allowing tests to be slightly more expressive.
static
<T> Matcher<T>
CoreMatchers.is(T value)
          This is a shortcut to the frequently used is(equalTo(x)).
static
<T> Matcher<T>
CoreMatchers.not(Matcher<T> matcher)
          Inverts the rule.
static
<T> Matcher<T>
CoreMatchers.not(T value)
          This is a shortcut to the frequently used not(equalTo(x)).
static
<T> Matcher<T>
CoreMatchers.notNullValue()
          Matches if value is not null.
static
<T> Matcher<T>
CoreMatchers.notNullValue(Class<T> type)
          Matches if value is not null.
static
<T> Matcher<T>
CoreMatchers.nullValue()
          Matches if value is null.
static
<T> Matcher<T>
CoreMatchers.nullValue(Class<T> type)
          Matches if value is null.
static
<T> Matcher<T>
CoreMatchers.sameInstance(T object)
          Creates a new instance of IsSame
 

Methods in org.hamcrest with parameters of type Matcher
static
<T> Matcher<T>
CoreMatchers.allOf(Matcher<? extends T>... matchers)
          Evaluates to true only if ALL of the passed in matchers evaluate to true.
static
<T> Matcher<T>
CoreMatchers.anyOf(Matcher<? extends T>... matchers)
          Evaluates to true if ANY of the passed in matchers evaluate to true.
static
<T> Matcher<T>
CoreMatchers.describedAs(String description, Matcher<T> matcher, Object... values)
          Wraps an existing matcher and overrides the description when it fails.
static
<T> Matcher<T>
CoreMatchers.is(Matcher<T> matcher)
          Decorates another Matcher, retaining the behavior but allowing tests to be slightly more expressive.
static
<T> Matcher<T>
CoreMatchers.not(Matcher<T> matcher)
          Inverts the rule.
 

Method parameters in org.hamcrest with type arguments of type Matcher
static
<T> Matcher<T>
CoreMatchers.allOf(Iterable<Matcher<? extends T>> matchers)
          Evaluates to true only if ALL of the passed in matchers evaluate to true.
static
<T> Matcher<T>
CoreMatchers.anyOf(Iterable<Matcher<? extends T>> matchers)
          Evaluates to true if ANY of the passed in matchers evaluate to true.
 

Uses of Matcher in org.hamcrest.core
 

Classes in org.hamcrest.core that implement Matcher
 class AllOf<T>
          Calculates the logical conjunction of two matchers.
 class AnyOf<T>
          Calculates the logical disjunction of two matchers.
 class DescribedAs<T>
          Provides a custom description to another matcher.
 class Is<T>
          Decorates another Matcher, retaining the behavior but allowing tests to be slightly more expressive.
 class IsAnything<T>
          A matcher that always returns true.
 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?
 

Methods in org.hamcrest.core that return Matcher
static
<T> Matcher<T>
AllOf.allOf(Iterable<Matcher<? extends T>> matchers)
          Evaluates to true only if ALL of the passed in matchers evaluate to true.
static
<T> Matcher<T>
AllOf.allOf(Matcher<? extends T>... matchers)
          Evaluates to true only if ALL of the passed in matchers evaluate to true.
static
<T> Matcher<T>
IsAnything.any(Class<T> type)
          This matcher always evaluates to true.
static
<T> Matcher<T>
AnyOf.anyOf(Iterable<Matcher<? extends T>> matchers)
          Evaluates to true if ANY of the passed in matchers evaluate to true.
static
<T> Matcher<T>
AnyOf.anyOf(Matcher<? extends T>... matchers)
          Evaluates to true if ANY of the passed in matchers evaluate to true.
static
<T> Matcher<T>
IsAnything.anything()
          This matcher always evaluates to true.
static
<T> Matcher<T>
IsAnything.anything(String description)
          This matcher always evaluates to true.
static
<T> Matcher<T>
DescribedAs.describedAs(String description, Matcher<T> matcher, Object... values)
          Wraps an existing matcher and overrides the description when it fails.
static
<T> Matcher<T>
IsEqual.equalTo(T operand)
          Is the value equal to another value, as tested by the Object.equals(java.lang.Object) invokedMethod?
static Matcher<Object> IsInstanceOf.instanceOf(Class<?> type)
          Is the value an instance of a particular type?
static Matcher<Object> Is.is(Class<?> type)
          This is a shortcut to the frequently used is(instanceOf(SomeClass.class)).
static
<T> Matcher<T>
Is.is(Matcher<T> matcher)
          Decorates another Matcher, retaining the behavior but allowing tests to be slightly more expressive.
static
<T> Matcher<T>
Is.is(T value)
          This is a shortcut to the frequently used is(equalTo(x)).
static
<T> Matcher<T>
IsNot.not(Matcher<T> matcher)
          Inverts the rule.
static
<T> Matcher<T>
IsNot.not(T value)
          This is a shortcut to the frequently used not(equalTo(x)).
static
<T> Matcher<T>
IsNull.notNullValue()
          Matches if value is not null.
static
<T> Matcher<T>
IsNull.notNullValue(Class<T> type)
          Matches if value is not null.
static
<T> Matcher<T>
IsNull.nullValue()
          Matches if value is null.
static
<T> Matcher<T>
IsNull.nullValue(Class<T> type)
          Matches if value is null.
static
<T> Matcher<T>
IsSame.sameInstance(T object)
          Creates a new instance of IsSame
 

Methods in org.hamcrest.core with parameters of type Matcher
static
<T> Matcher<T>
AllOf.allOf(Matcher<? extends T>... matchers)
          Evaluates to true only if ALL of the passed in matchers evaluate to true.
static
<T> Matcher<T>
AnyOf.anyOf(Matcher<? extends T>... matchers)
          Evaluates to true if ANY of the passed in matchers evaluate to true.
static
<T> Matcher<T>
DescribedAs.describedAs(String description, Matcher<T> matcher, Object... values)
          Wraps an existing matcher and overrides the description when it fails.
static
<T> Matcher<T>
Is.is(Matcher<T> matcher)
          Decorates another Matcher, retaining the behavior but allowing tests to be slightly more expressive.
static
<T> Matcher<T>
IsNot.not(Matcher<T> matcher)
          Inverts the rule.
 

Method parameters in org.hamcrest.core with type arguments of type Matcher
static
<T> Matcher<T>
AllOf.allOf(Iterable<Matcher<? extends T>> matchers)
          Evaluates to true only if ALL of the passed in matchers evaluate to true.
static
<T> Matcher<T>
AnyOf.anyOf(Iterable<Matcher<? extends T>> matchers)
          Evaluates to true if ANY of the passed in matchers evaluate to true.
 

Constructors in org.hamcrest.core with parameters of type Matcher
DescribedAs(String descriptionTemplate, Matcher<T> matcher, Object[] values)
           
Is(Matcher<T> matcher)
           
IsNot(Matcher<T> matcher)
           
 

Constructor parameters in org.hamcrest.core with type arguments of type Matcher
AllOf(Iterable<Matcher<? extends T>> matchers)
           
AnyOf(Iterable<Matcher<? extends 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<T> matcher)
          Asserts that actual satisfies the condition specified by matcher.
static
<T> void
Assert.assertThat(T actual, Matcher<T> matcher)
          Asserts 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.
 

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.isSuccessful()
          Matches if the tests are all successful
 

Uses of Matcher in org.junit.internal
 

Constructors in org.junit.internal with parameters of type Matcher
AssumptionViolatedException(Object value, Matcher<?> matcher)
           
 

Uses of Matcher in org.junit.internal.matchers
 

Classes in org.junit.internal.matchers that implement Matcher
 class CombinableMatcher<T>
           
 class IsCollectionContaining<T>
           
 class StringContains
          Tests if the argument is a string that contains a substring.
 class SubstringMatcher
           
 class TypeSafeMatcher<T>
          Convenient base class for Matchers that require a non-null value of a specific type.
 

Methods in org.junit.internal.matchers that return Matcher
static Matcher<String> StringContains.containsString(String substring)
           
static
<T> Matcher<Iterable<T>>
Each.each(Matcher<T> individual)
           
static
<T> Matcher<Iterable<T>>
IsCollectionContaining.hasItem(Matcher<? extends T> elementMatcher)
           
static
<T> Matcher<Iterable<T>>
IsCollectionContaining.hasItem(T element)
           
static
<T> Matcher<Iterable<T>>
IsCollectionContaining.hasItems(Matcher<? extends T>... elementMatchers)
           
static
<T> Matcher<Iterable<T>>
IsCollectionContaining.hasItems(T... elements)
           
 

Methods in org.junit.internal.matchers with parameters of type Matcher
 CombinableMatcher<T> CombinableMatcher.and(Matcher<? extends T> matcher)
           
static
<T> Matcher<Iterable<T>>
Each.each(Matcher<T> individual)
           
static
<T> Matcher<Iterable<T>>
IsCollectionContaining.hasItem(Matcher<? extends T> elementMatcher)
           
static
<T> Matcher<Iterable<T>>
IsCollectionContaining.hasItems(Matcher<? extends T>... elementMatchers)
           
 CombinableMatcher<T> CombinableMatcher.or(Matcher<? extends T> matcher)
           
 

Constructors in org.junit.internal.matchers with parameters of type Matcher
CombinableMatcher(Matcher<? extends T> matcher)
           
IsCollectionContaining(Matcher<? extends T> elementMatcher)
           
 

Uses of Matcher in org.junit.matchers
 

Methods in org.junit.matchers that return Matcher
static Matcher<String> JUnitMatchers.containsString(String substring)
           
static
<T> Matcher<Iterable<T>>
JUnitMatchers.everyItem(Matcher<T> elementMatcher)
           
static
<T> Matcher<Iterable<T>>
JUnitMatchers.hasItem(Matcher<? extends T> elementMatcher)
           
static
<T> Matcher<Iterable<T>>
JUnitMatchers.hasItem(T element)
           
static
<T> Matcher<Iterable<T>>
JUnitMatchers.hasItems(Matcher<? extends T>... elementMatchers)
           
static
<T> Matcher<Iterable<T>>
JUnitMatchers.hasItems(T... elements)
           
 

Methods in org.junit.matchers with parameters of type Matcher
static
<T> CombinableMatcher<T>
JUnitMatchers.both(Matcher<T> matcher)
          This is useful for fluently combining matchers that must both pass.
static
<T> CombinableMatcher<T>
JUnitMatchers.either(Matcher<T> matcher)
          This is useful for fluently combining matchers where either may pass, for example:
static
<T> Matcher<Iterable<T>>
JUnitMatchers.everyItem(Matcher<T> elementMatcher)
           
static
<T> Matcher<Iterable<T>>
JUnitMatchers.hasItem(Matcher<? extends T> elementMatcher)
           
static
<T> Matcher<Iterable<T>>
JUnitMatchers.hasItems(Matcher<? extends T>... elementMatchers)
           
 

Uses of Matcher in org.junit.rules
 

Methods in org.junit.rules with parameters of type Matcher
<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)
          Adds matcher to the list of requirements for any thrown exception.
 void ExpectedException.expectMessage(Matcher<String> matcher)
          Adds matcher to the list of requirements for the message returned from any thrown exception.