public final class

TypeProtoConverters

extends Object
java.lang.Object
   ↳ androidx.test.espresso.remote.TypeProtoConverters

Class Overview

Converters from ERROR(/Any) proto messages to their unwrapped target types.

Summary

Public Methods
static <T> T anyToType(Any any)
Performs an ERROR(/Any) proto message to type T conversion.
static Parcelable byteStringToParcelable(ByteString byteString, Class<Parcelable> parcelableClass)
Performs a ERROR(/ByteString) to Parcelable conversion.
static <T> T byteStringToType(ByteString byteString)
Performs a ERROR(/ByteString) to type T conversion.
static ByteString parcelableToByteString(Parcelable parcelable)
Performs Parcelable to ERROR(/ByteString) conversion.
static <T> Any typeToAny(T type)
Performs a type T to ERROR(/Any) proto message conversion.
static ByteString typeToByteString(Object object)
Performs an object to ERROR(/ByteString) conversion.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static T anyToType (Any any)

Performs an ERROR(/Any) proto message to type T conversion.

Parameters
any Any: type to unwrap into its target type T representation
Returns
T unwrapped target type T

public static Parcelable byteStringToParcelable (ByteString byteString, Class<Parcelable> parcelableClass)

Performs a ERROR(/ByteString) to Parcelable conversion.

Parameters
byteString ByteString: the ERROR(/ByteString) to convert to a Parcelable
parcelableClass Class
Returns
Parcelable instance of Parcelable

public static T byteStringToType (ByteString byteString)

Performs a ERROR(/ByteString) to type T conversion.

Parameters
byteString ByteString: the ERROR(/ByteString) to convert into T
Returns
T instance of type T

public static ByteString parcelableToByteString (Parcelable parcelable)

Performs Parcelable to ERROR(/ByteString) conversion.

Parameters
parcelable Parcelable: Parcelable to convert to a ERROR(/ByteString)
Returns
ByteString ERROR(/ByteString) representation of the passed object

public static Any typeToAny (T type)

Performs a type T to ERROR(/Any) proto message conversion.

Parameters
type T: target type to wrap into its ERROR(/Any) representation
Returns
Any ERROR(/Any) proto message which contains the wrapped proto representation of T

public static ByteString typeToByteString (Object object)

Performs an object to ERROR(/ByteString) conversion.

Parameters
object Object: object to convert to a ERROR(/ByteString)
Returns
ByteString ERROR(/ByteString) representation of the passed object