org.hamcrest
Interface Matcher<T>

All Superinterfaces:
SelfDescribing
All Known Implementing Classes:
AllOf, AnyOf, BaseMatcher, DescribedAs, HasProperty, HasPropertyWithValue, HasToString, HasXPath, Is, IsAnything, IsArray, IsArrayContaining, IsCloseTo, IsCollectionContaining, IsCompatibleType, IsEqual, IsEqualIgnoringCase, IsEqualIgnoringWhiteSpace, IsEventFrom, IsGreaterThan, IsInstanceOf, IsMapContaining, IsNot, IsNull, IsSame, StringContains, StringEndsWith, StringStartsWith, SubstringMatcher, TypeSafeMatcher

public interface Matcher<T>
extends SelfDescribing

A matcher over acceptable values. A matcher is able to describe itself to give feedback when it fails.

Matcher implementations should NOT directly implement this interface. Instead, extend the BaseMatcher abstract class, which will ensure that the Matcher API can grow to support new features and remain compatible with all Matcher implementations.

See Also:
BaseMatcher

Method Summary
 void _dont_implement_Matcher___instead_extend_BaseMatcher_()
          This method simply acts a friendly reminder not to implement Matcher directly and instead extend BaseMatcher.
 boolean matches(Object item)
          Evaluates the matcher for argument item.
 
Methods inherited from interface org.hamcrest.SelfDescribing
describeTo
 

Method Detail

matches

boolean matches(Object item)
Evaluates the matcher for argument item.

Parameters:
item - the object against which the matcher is evaluated.
Returns:
true if item matches, otherwise false.

_dont_implement_Matcher___instead_extend_BaseMatcher_

void _dont_implement_Matcher___instead_extend_BaseMatcher_()
This method simply acts a friendly reminder not to implement Matcher directly and instead extend BaseMatcher. It's easy to ignore JavaDoc, but a bit harder to ignore compile errors :).

See Also:
for reasons why.