# HumanReadables

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/util/HumanReadables.java+class:androidx.test.espresso.util.HumanReadables)

*** ** * ** ***


```
public final class HumanReadables
```

<br />

*** ** * ** ***

Text converters for various Android objects.

## Summary

| ### Public methods |
|---|---|
| `static https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/test/espresso/util/HumanReadables#describe(android.database.Cursor)(https://developer.android.com/reference/android/database/Cursor.html c)` |
| `static https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/test/espresso/util/HumanReadables#describe(android.view.View)(https://developer.android.com/reference/android/view/View.html v)` Transforms an arbitrary view into a string with (hopefully) enough debug info. |
| `static https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/test/espresso/util/HumanReadables#getViewHierarchyErrorMessage(android.view.View,java.util.List<android.view.View>,java.lang.String,java.lang.String)( https://developer.android.com/reference/android/view/View.html rootView, https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/android/view/View.html> problemViews, https://developer.android.com/reference/java/lang/String.html errorHeader, https://developer.android.com/reference/java/lang/String.html problemViewSuffix )` Prints out an error message featuring the view hierarchy starting at the rootView. |
| `static https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/test/espresso/util/HumanReadables#getViewHierarchyErrorMessage(android.view.View,java.util.List<android.view.View>,java.lang.String,java.lang.String,int)( https://developer.android.com/reference/android/view/View.html rootView, https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/android/view/View.html> problemViews, https://developer.android.com/reference/java/lang/String.html errorHeader, https://developer.android.com/reference/java/lang/String.html problemViewSuffix, int maxMsgLen )` Prints out an error message featuring the view hierarchy starting at the rootView. |

## Public methods

### describe

```
public static String describe(Cursor c)
```

### describe

```
public static String describe(View v)
```

Transforms an arbitrary view into a string with (hopefully) enough debug info.

| Parameters |
|---|---|
| `https://developer.android.com/reference/android/view/View.html v` | nullable view |

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html` | a string for human consumption. |

### getViewHierarchyErrorMessage

```
public static String getViewHierarchyErrorMessage(
    View rootView,
    List<View> problemViews,
    String errorHeader,
    String problemViewSuffix
)
```

Prints out an error message featuring the view hierarchy starting at the rootView.

| Parameters |
|---|---|
| `https://developer.android.com/reference/android/view/View.html rootView` | the root of the hierarchy tree to print out. |
| `https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/android/view/View.html> problemViews` | list of the views that you would like to point out are causing the error message or null, if you want to skip this feature. |
| `https://developer.android.com/reference/java/lang/String.html errorHeader` | the header of the error message (should contain the description of why the error is happening). |
| `https://developer.android.com/reference/java/lang/String.html problemViewSuffix` | the message to append to the view description in the tree printout. Required if problemViews is supplied. Otherwise, null is acceptable. |

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html` | a string for human consumption. |

### getViewHierarchyErrorMessage

```
public static String getViewHierarchyErrorMessage(
    View rootView,
    List<View> problemViews,
    String errorHeader,
    String problemViewSuffix,
    int maxMsgLen
)
```

Prints out an error message featuring the view hierarchy starting at the rootView.

| Parameters |
|---|---|
| `https://developer.android.com/reference/android/view/View.html rootView` | the root of the hierarchy tree to print out. |
| `https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/android/view/View.html> problemViews` | list of the views that you would like to point out are causing the error message or null, if you want to skip this feature. |
| `https://developer.android.com/reference/java/lang/String.html errorHeader` | the header of the error message (should contain the description of why the error is happening). |
| `https://developer.android.com/reference/java/lang/String.html problemViewSuffix` | the message to append to the view description in the tree printout. Required if problemViews is supplied. Otherwise, null is acceptable. |
| `int maxMsgLen` | the maximum message length. Use `https://developer.android.com/reference/java/lang/Integer.html#MAX_VALUE` to avoid truncating the message. |

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html` | a string for human consumption. |