{% setvar book_path %}/reference/kotlin/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

BoundedMatcher

abstract class BoundedMatcher<T, S : T?> : BaseMatcher

kotlin.Any
   ↳ org.hamcrest.BaseMatcher
     ↳ androidx.test.espresso.matcher.BoundedMatcher
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 : T?>

the subtype of T that your matcher applies safely to.

Summary

Public constructors

BoundedMatcher(expectedType: Class<S!>!)
BoundedMatcher(
    expectedType: Class<Any!>!,
    interfaceType1: Class<Any!>!,
    otherInterfaces: Array<Class<Any!>!>!
)

Public functions

Unit
describeMismatch(item: Any!, description: Description!)
Boolean
matches(item: Any!)

Protected functions

abstract Boolean
matchesSafely(item: S!)

Inherited functions

From class org.hamcrest.BaseMatcher
From class org.hamcrest.SelfDescribing
abstract Unit

Public constructors

BoundedMatcher

BoundedMatcher(expectedType: Class<S!>!)

BoundedMatcher

BoundedMatcher(
    expectedType: Class<Any!>!,
    interfaceType1: Class<Any!>!,
    otherInterfaces: Array<Class<Any!>!>!
)

Public functions

describeMismatch

fun describeMismatch(item: Any!, description: Description!): Unit

matches

fun matches(item: Any!): Boolean

Protected functions

matchesSafely

protected abstract fun matchesSafely(item: S!): Boolean