# CursorMatchers.CursorMatcher

Summary:[Methods](https://developer.android.com/reference/android/support/test/espresso/matcher/CursorMatchers.CursorMatcher#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/test/espresso/matcher/CursorMatchers.CursorMatcher#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/test/espresso/matcher/CursorMatchers.CursorMatcher#)  

# CursorMatchers.CursorMatcher

| 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
static


class
CursorMatchers.CursorMatcher
`  
`


``


``

extends `[BoundedMatcher](https://developer.android.com/reference/android/support/test/espresso/matcher/BoundedMatcher)`<`[Object](https://developer.android.com/reference/java/lang/Object.html)`, `[Cursor](https://developer.android.com/reference/android/database/Cursor.html)`>


``


`

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

<br />

*** ** * ** ***

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.

## Summary

|                                                                                                                                                                                                                                                                            ### Public methods                                                                                                                                                                                                                                                                            ||
|-----------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` void`                                                                                                                                       | ` `[describeTo](https://developer.android.com/reference/android/support/test/espresso/matcher/CursorMatchers.CursorMatcher#describeTo(org.hamcrest.Description))`(Description description) `                                                                                                                                                                                                                              |
| ` boolean`                                                                                                                                    | ` `[matchesSafely](https://developer.android.com/reference/android/support/test/espresso/matcher/CursorMatchers.CursorMatcher#matchesSafely(android.database.Cursor))`(`[Cursor](https://developer.android.com/reference/android/database/Cursor.html)` cursor) `                                                                                                                                                         |
| ` `[CursorMatchers.CursorMatcher](https://developer.android.com/reference/android/support/test/espresso/matcher/CursorMatchers.CursorMatcher) | ` `[withStrictColumnChecks](https://developer.android.com/reference/android/support/test/espresso/matcher/CursorMatchers.CursorMatcher#withStrictColumnChecks(boolean))`(boolean checkColumns) ` Allows test authors to override whether the the matcher should throw an[IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException.html)if the column name/count is not valid. |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/test/espresso/matcher/CursorMatchers.CursorMatcher#)From class` `[android.support.test.espresso.matcher.BoundedMatcher](https://developer.android.com/reference/android/support/test/espresso/matcher/BoundedMatcher)` ` |---------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` 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) ` | | ` abstract boolean` | ` `[matchesSafely](https://developer.android.com/reference/android/support/test/espresso/matcher/BoundedMatcher#matchesSafely(S))`(S item) `                                                                            | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/test/espresso/matcher/CursorMatchers.CursorMatcher#)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/CursorMatchers.CursorMatcher#)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/CursorMatchers.CursorMatcher#)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/CursorMatchers.CursorMatcher#)From interface` org.hamcrest.SelfDescribing ` |------------------|----------------------------------| | ` abstract void` | ` describeTo(Description arg0) ` | ||

## Public methods

### describeTo

```
void describeTo (Description description)
```

<br />

<br />

|             Parameters              ||
|---------------|----------------------|
| `description` | `Description` <br /> |

### matchesSafely

```
boolean matchesSafely (Cursor cursor)
```

<br />

<br />

|        Parameters         ||
|----------|-----------------|
| `cursor` | `Cursor` <br /> |

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

### withStrictColumnChecks

```
CursorMatchers.CursorMatcher withStrictColumnChecks (boolean checkColumns)
```

Allows test authors to override whether the the matcher should throw an[IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException.html)if the column name/count is not valid. This is useful in the case where a cursor may iterates over a data set with variable columns. By default, the checks are on.

<br />

|            Parameters            ||
|----------------|------------------|
| `checkColumns` | `boolean` <br /> |

|                                                                      Returns                                                                       ||
|--------------------------------------------------------------------------------------------------------------------------------------------|--------|
| [CursorMatchers.CursorMatcher](https://developer.android.com/reference/android/support/test/espresso/matcher/CursorMatchers.CursorMatcher) | <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)