BoundedMatcher


public abstract class BoundedMatcher<T, S extends T> extends BaseMatcher

Known direct subclasses
CursorMatchers.CursorMatcher

A Matcher that matches Cursors based on values in their columns.


Some matcher sugar that lets you create a matcher for a given type but only process items of a specific subtype of that matcher.

Use BoundedDiagnosingMatcher for better diagnostic messages when a mismatch happens.

Parameters
<T>

The desired type of the Matcher.

<S extends T>

the subtype of T that your matcher applies safely to.

Summary

Public constructors

BoundedMatcher(Class<S> expectedType)
BoundedMatcher(
    Class<Object> expectedType,
    Class<Object> interfaceType1,
    Class[] otherInterfaces
)

Public methods

void
describeMismatch(Object item, Description description)
final boolean

Protected methods

abstract boolean
matchesSafely(S item)

Inherited methods

From org.hamcrest.BaseMatcher
final void

This method is deprecated.

String
From org.hamcrest.SelfDescribing
abstract void

Public constructors

BoundedMatcher

public BoundedMatcher(Class<S> expectedType)

BoundedMatcher

public BoundedMatcher(
    Class<Object> expectedType,
    Class<Object> interfaceType1,
    Class[] otherInterfaces
)

Public methods

describeMismatch

public void describeMismatch(Object item, Description description)

matches

public final boolean matches(Object item)

Protected methods

matchesSafely

protected abstract boolean matchesSafely(S item)