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

BoundedMatcher

abstract class BoundedMatcher<T, S : T?>

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!)

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