# DataInteraction.DisplayDataMatcher

Artifact: [androidx.test.espresso:espresso-core](https://developer.android.com/jetpack/androidx/releases/test-espresso) [View Source](https://cs.android.com/search?q=file:androidx/test/espresso/DataInteraction.java+class:androidx.test.espresso.DataInteraction.DisplayDataMatcher)

*** ** * ** ***


```
public final class DataInteraction.DisplayDataMatcher extends TypeSafeMatcher<View>
```

<br />

|---|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) ||||
| ↳ | [org.hamcrest.BaseMatcher](https://junit.org/junit4/javadoc/latest/org/hamcrest/BaseMatcher.html) |||
|   | ↳ | [org.hamcrest.TypeSafeMatcher](https://junit.org/junit4/javadoc/latest/org/hamcrest/TypeSafeMatcher.html)\<[View](https://developer.android.com/reference/android/view/View.html)\> ||
|   |   | ↳ | [androidx.test.espresso.DataInteraction.DisplayDataMatcher](https://developer.android.com/reference/androidx/test/espresso/DataInteraction.DisplayDataMatcher) |

*** ** * ** ***

Internal matcher that is required for `https://developer.android.com/reference/androidx/test/espresso/Espresso#onData(org.hamcrest.Matcher<? extends java.lang.Object>)`.

This matcher is only visible to support proto serialization. Do not use this matcher in any Espresso test code!

## Summary

| ### Public methods |
|---|---|
| `void` | `https://developer.android.com/reference/androidx/test/espresso/DataInteraction.DisplayDataMatcher#describeTo(org.hamcrest.Description)(https://junit.org/junit4/javadoc/latest/org/hamcrest/Description.html description)` |
| `static https://developer.android.com/reference/androidx/test/espresso/DataInteraction.DisplayDataMatcher` | `[displayDataMatcher](https://developer.android.com/reference/androidx/test/espresso/DataInteraction.DisplayDataMatcher#displayDataMatcher(org.hamcrest.Matcher<android.view.View>,org.hamcrest.Matcher<? extends java.lang.Object>,org.hamcrest.Matcher<androidx.test.espresso.Root>,androidx.test.espresso.util.EspressoOptional<java.lang.Integer>,androidx.test.espresso.action.AdapterViewProtocol))( @https://developer.android.com/reference/androidx/annotation/NonNull https://junit.org/junit4/javadoc/latest/org/hamcrest/Matcher.html<https://developer.android.com/reference/android/view/View.html> adapterMatcher, @https://developer.android.com/reference/androidx/annotation/NonNull https://junit.org/junit4/javadoc/latest/org/hamcrest/Matcher.html<https://developer.android.com/reference/java/lang/Object.html> dataMatcher, @https://developer.android.com/reference/androidx/annotation/NonNull https://junit.org/junit4/javadoc/latest/org/hamcrest/Matcher.html<https://developer.android.com/reference/androidx/test/espresso/Root> rootMatcher, https://developer.android.com/reference/androidx/test/espresso/util/EspressoOptional<https://developer.android.com/reference/java/lang/Integer.html> atPosition, @https://developer.android.com/reference/androidx/annotation/NonNull androidx.test.espresso.action.AdapterViewProtocol adapterViewProtocol )` **This method is deprecated.** use `https://developer.android.com/reference/androidx/test/espresso/DataInteraction.DisplayDataMatcher#displayDataMatcher(org.hamcrest.Matcher<android.view.View>,org.hamcrest.Matcher<? extends java.lang.Object>,org.hamcrest.Matcher<androidx.test.espresso.Root>,java.lang.Integer,androidx.test.espresso.action.AdapterViewProtocol)` instead. <br /> |
| `static https://developer.android.com/reference/androidx/test/espresso/DataInteraction.DisplayDataMatcher` | `https://developer.android.com/reference/androidx/test/espresso/DataInteraction.DisplayDataMatcher#displayDataMatcher(org.hamcrest.Matcher<android.view.View>,org.hamcrest.Matcher<? extends java.lang.Object>,org.hamcrest.Matcher<androidx.test.espresso.Root>,java.lang.Integer,androidx.test.espresso.action.AdapterViewProtocol)( @https://developer.android.com/reference/androidx/annotation/NonNull https://junit.org/junit4/javadoc/latest/org/hamcrest/Matcher.html<https://developer.android.com/reference/android/view/View.html> adapterMatcher, @https://developer.android.com/reference/androidx/annotation/NonNull https://junit.org/junit4/javadoc/latest/org/hamcrest/Matcher.html<https://developer.android.com/reference/java/lang/Object.html> dataMatcher, @https://developer.android.com/reference/androidx/annotation/NonNull https://junit.org/junit4/javadoc/latest/org/hamcrest/Matcher.html<https://developer.android.com/reference/androidx/test/espresso/Root> rootMatcher, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/Integer.html atPosition, @https://developer.android.com/reference/androidx/annotation/NonNull androidx.test.espresso.action.AdapterViewProtocol adapterViewProtocol )` Returns an instance of `https://developer.android.com/reference/androidx/test/espresso/DataInteraction.DisplayDataMatcher`. |
| `boolean` | `https://developer.android.com/reference/androidx/test/espresso/DataInteraction.DisplayDataMatcher#matchesSafely(android.view.View)(https://developer.android.com/reference/android/view/View.html view)` |

### Inherited methods

From [org.hamcrest.BaseMatcher](https://junit.org/junit4/javadoc/latest/org/hamcrest/BaseMatcher.html) `final void` `https://junit.org/junit4/javadoc/latest/org/hamcrest/BaseMatcher.html#_dont_implement_Matcher___instead_extend_BaseMatcher_--()`

**This method is deprecated.**
`https://developer.android.com/reference/java/lang/String.html` `https://junit.org/junit4/javadoc/latest/org/hamcrest/BaseMatcher.html#toString--()` From [org.hamcrest.TypeSafeMatcher](https://junit.org/junit4/javadoc/latest/org/hamcrest/TypeSafeMatcher.html) `final void` `https://junit.org/junit4/javadoc/latest/org/hamcrest/TypeSafeMatcher.html#describeMismatch-java.lang.Object-org.hamcrest.Description-(https://developer.android.com/reference/java/lang/Object.html item, https://junit.org/junit4/javadoc/latest/org/hamcrest/Description.html description)` `void` `https://junit.org/junit4/javadoc/latest/org/hamcrest/TypeSafeMatcher.html#describeMismatchSafely-T-org.hamcrest.Description-(T item, https://junit.org/junit4/javadoc/latest/org/hamcrest/Description.html mismatchDescription)` `final boolean` `https://junit.org/junit4/javadoc/latest/org/hamcrest/TypeSafeMatcher.html#matches-java.lang.Object-(https://developer.android.com/reference/java/lang/Object.html item)`

## Public methods

### describeTo

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

### displayDataMatcher

```
public static DataInteraction.DisplayDataMatcher [displayDataMatcher](https://developer.android.com/reference/androidx/test/espresso/DataInteraction.DisplayDataMatcher#displayDataMatcher(org.hamcrest.Matcher<android.view.View>,org.hamcrest.Matcher<? extends java.lang.Object>,org.hamcrest.Matcher<androidx.test.espresso.Root>,androidx.test.espresso.util.EspressoOptional<java.lang.Integer>,androidx.test.espresso.action.AdapterViewProtocol))(
    @NonNull Matcher<View> adapterMatcher,
    @NonNull Matcher<Object> dataMatcher,
    @NonNull Matcher<Root> rootMatcher,
    EspressoOptional<Integer> atPosition,
    @NonNull androidx.test.espresso.action.AdapterViewProtocol adapterViewProtocol
)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> use `https://developer.android.com/reference/androidx/test/espresso/DataInteraction.DisplayDataMatcher#displayDataMatcher(org.hamcrest.Matcher<android.view.View>,org.hamcrest.Matcher<? extends java.lang.Object>,org.hamcrest.Matcher<androidx.test.espresso.Root>,java.lang.Integer,androidx.test.espresso.action.AdapterViewProtocol)` instead.

Returns an instance of `https://developer.android.com/reference/androidx/test/espresso/DataInteraction.DisplayDataMatcher`.

Note: This is an internal method, do not call from test code!

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://junit.org/junit4/javadoc/latest/org/hamcrest/Matcher.html<https://developer.android.com/reference/android/view/View.html> adapterMatcher` | matcher that matches an `https://developer.android.com/reference/android/widget/AdapterView.html` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://junit.org/junit4/javadoc/latest/org/hamcrest/Matcher.html<https://developer.android.com/reference/java/lang/Object.html> dataMatcher` | the data matcher for matching a `https://developer.android.com/reference/android/view/View.html` by it's adapter data |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://junit.org/junit4/javadoc/latest/org/hamcrest/Matcher.html<https://developer.android.com/reference/androidx/test/espresso/Root> rootMatcher` | matcher for view's root |
| `https://developer.android.com/reference/androidx/test/espresso/util/EspressoOptional<https://developer.android.com/reference/java/lang/Integer.html> atPosition` | optional position of the view to match |
| `@https://developer.android.com/reference/androidx/annotation/NonNull androidx.test.espresso.action.AdapterViewProtocol adapterViewProtocol` | the used for this data interaction |

### displayDataMatcher

```
public static DataInteraction.DisplayDataMatcher displayDataMatcher(
    @NonNull Matcher<View> adapterMatcher,
    @NonNull Matcher<Object> dataMatcher,
    @NonNull Matcher<Root> rootMatcher,
    @Nullable Integer atPosition,
    @NonNull androidx.test.espresso.action.AdapterViewProtocol adapterViewProtocol
)
```

Returns an instance of `https://developer.android.com/reference/androidx/test/espresso/DataInteraction.DisplayDataMatcher`.

Note: This is an internal method, do not call from test code!

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://junit.org/junit4/javadoc/latest/org/hamcrest/Matcher.html<https://developer.android.com/reference/android/view/View.html> adapterMatcher` | matcher that matches an `https://developer.android.com/reference/android/widget/AdapterView.html` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://junit.org/junit4/javadoc/latest/org/hamcrest/Matcher.html<https://developer.android.com/reference/java/lang/Object.html> dataMatcher` | the data matcher for matching a `https://developer.android.com/reference/android/view/View.html` by it's adapter data |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://junit.org/junit4/javadoc/latest/org/hamcrest/Matcher.html<https://developer.android.com/reference/androidx/test/espresso/Root> rootMatcher` | matcher for view's root |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/Integer.html atPosition` | optional zero-based position of the data to be matched |
| `@https://developer.android.com/reference/androidx/annotation/NonNull androidx.test.espresso.action.AdapterViewProtocol adapterViewProtocol` | the used for this data interaction |

### matchesSafely

```
public boolean matchesSafely(View view)
```