# BoundedMatcher

Summary:[Ctors](https://developer.android.com/reference/android/support/test/espresso/matcher/BoundedMatcher#pubctors)\|[Methods](https://developer.android.com/reference/android/support/test/espresso/matcher/BoundedMatcher#pubmethods)\|[Protected Methods](https://developer.android.com/reference/android/support/test/espresso/matcher/BoundedMatcher#promethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/test/espresso/matcher/BoundedMatcher#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/test/espresso/matcher/BoundedMatcher#)  

# BoundedMatcher

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public


abstract
class
BoundedMatcher
`  
`


``

extends BaseMatcher<T>


``


`

|---|---|------------------------------------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | org.hamcrest.BaseMatcher\<T\>                                             ||
|   | ↳ | android.support.test.espresso.matcher.BoundedMatcher\<T, S extends T\> |

|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/test/espresso/matcher/BoundedMatcher#)Known Direct Subclasses [CursorMatchers.CursorMatcher](https://developer.android.com/reference/android/support/test/espresso/matcher/CursorMatchers.CursorMatcher) |--------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [CursorMatchers.CursorMatcher](https://developer.android.com/reference/android/support/test/espresso/matcher/CursorMatchers.CursorMatcher) | A[Matcher](https://developer.android.com/reference/org/hamcrest/Matcher)that matches[Cursor](https://developer.android.com/reference/android/database/Cursor.html)s based on values in their columns. | |

<br />

*** ** * ** ***

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

## Summary

|                                                                                                                                                                                                                                 ### Public constructors                                                                                                                                                                                                                                  ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[BoundedMatcher](https://developer.android.com/reference/android/support/test/espresso/matcher/BoundedMatcher#BoundedMatcher(java.lang.Class<? extends S>))`(`[Class](https://developer.android.com/reference/java/lang/Class.html)`<? extends S> expectedType) `                                                                                                                                                                                                                  |
| ` `[BoundedMatcher](https://developer.android.com/reference/android/support/test/espresso/matcher/BoundedMatcher#BoundedMatcher(java.lang.Class<?>, java.lang.Class<?>, java.lang.Class<?>...))`(`[Class](https://developer.android.com/reference/java/lang/Class.html)`<?> expectedType, `[Class](https://developer.android.com/reference/java/lang/Class.html)`<?> interfaceType1, `[Class...](https://developer.android.com/reference/java/lang/Class.html)`<?> otherInterfaces) ` |

|                                                                                                            ### Public methods                                                                                                             ||
|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` final boolean` | ` `[matches](https://developer.android.com/reference/android/support/test/espresso/matcher/BoundedMatcher#matches(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object.html)` item) ` |

|                                                                       ### Protected methods                                                                       ||
|---------------------|----------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract boolean` | ` `[matchesSafely](https://developer.android.com/reference/android/support/test/espresso/matcher/BoundedMatcher#matchesSafely(S))`(S item) ` |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/test/espresso/matcher/BoundedMatcher#)From class` org.hamcrest.BaseMatcher ` |----------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------| | ` final void`                                                              | ` _dont_implement_Matcher___instead_extend_BaseMatcher_() `                                                            | | ` void`                                                                    | ` describeMismatch(`[Object](https://developer.android.com/reference/java/lang/Object.html)` arg0, Description arg1) ` | | ` `[String](https://developer.android.com/reference/java/lang/String.html) | ` toString() `                                                                                                         | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/test/espresso/matcher/BoundedMatcher#)From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object.html)` ` |-------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object.html)          | ` clone() `                                                                                | | ` boolean`                                                                          | ` equals(`[Object](https://developer.android.com/reference/java/lang/Object.html)` arg0) ` | | ` void`                                                                             | ` finalize() `                                                                             | | ` final `[Class](https://developer.android.com/reference/java/lang/Class.html)`<?>` | ` getClass() `                                                                             | | ` int`                                                                              | ` hashCode() `                                                                             | | ` final void`                                                                       | ` notify() `                                                                               | | ` final void`                                                                       | ` notifyAll() `                                                                            | | ` `[String](https://developer.android.com/reference/java/lang/String.html)          | ` toString() `                                                                             | | ` final void`                                                                       | ` wait(long arg0, int arg1) `                                                              | | ` final void`                                                                       | ` wait(long arg0) `                                                                        | | ` final void`                                                                       | ` wait() `                                                                                 | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/test/espresso/matcher/BoundedMatcher#)From interface` org.hamcrest.Matcher ` |---------------------|------------------------------------------------------------------------------------------------------------------------| | ` abstract void`    | ` _dont_implement_Matcher___instead_extend_BaseMatcher_() `                                                            | | ` abstract void`    | ` describeMismatch(`[Object](https://developer.android.com/reference/java/lang/Object.html)` arg0, Description arg1) ` | | ` abstract boolean` | ` matches(`[Object](https://developer.android.com/reference/java/lang/Object.html)` arg0) `                            | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/test/espresso/matcher/BoundedMatcher#)From interface` org.hamcrest.SelfDescribing ` |------------------|----------------------------------| | ` abstract void` | ` describeTo(Description arg0) ` | ||

## Public constructors

### BoundedMatcher

```
BoundedMatcher (Class<? extends S> expectedType)
```

<br />

<br />

|           Parameters           ||
|----------------|----------------|
| `expectedType` | `Class` <br /> |

### BoundedMatcher

```
BoundedMatcher (Class<?> expectedType, 
                Class<?> interfaceType1, 
                Class...<?> otherInterfaces)
```

<br />

<br />

|            Parameters             ||
|-------------------|----------------|
| `expectedType`    | `Class` <br /> |
| `interfaceType1`  | `Class` <br /> |
| `otherInterfaces` | `Class` <br /> |

## Public methods

### matches

```
boolean matches (Object item)
```

<br />

<br />

|       Parameters        ||
|--------|-----------------|
| `item` | `Object` <br /> |

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

## Protected methods

### matchesSafely

```
boolean matchesSafely (S item)
```

<br />

<br />

|     Parameters     ||
|--------|------------|
| `item` | `S` <br /> |

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

-

  ## Classes

  - [BoundedMatcher](https://developer.android.com/reference/android/support/test/espresso/matcher/BoundedMatcher)
  - [CursorMatchers](https://developer.android.com/reference/android/support/test/espresso/matcher/CursorMatchers)
  - [CursorMatchers.CursorMatcher](https://developer.android.com/reference/android/support/test/espresso/matcher/CursorMatchers.CursorMatcher)
  - [HasBackgroundMatcher](https://developer.android.com/reference/android/support/test/espresso/matcher/HasBackgroundMatcher)
  - [LayoutMatchers](https://developer.android.com/reference/android/support/test/espresso/matcher/LayoutMatchers)
  - [PreferenceMatchers](https://developer.android.com/reference/android/support/test/espresso/matcher/PreferenceMatchers)
  - [RootMatchers](https://developer.android.com/reference/android/support/test/espresso/matcher/RootMatchers)
  - [ViewMatchers](https://developer.android.com/reference/android/support/test/espresso/matcher/ViewMatchers)
-

  ## Enums

  - [ViewMatchers.Visibility](https://developer.android.com/reference/android/support/test/espresso/matcher/ViewMatchers.Visibility)