TypeProtoConverters
class TypeProtoConverters
Converters from Any proto messages to their unwrapped target types.
Summary
Public functions |
|
|---|---|
java-static T! |
<T> anyToType(any: Any)Performs an Any proto message to type T conversion. |
java-static Parcelable! |
byteStringToParcelable(Performs a |
java-static T! |
<T> byteStringToType(byteString: ByteString)Performs a |
java-static ByteString! |
parcelableToByteString(parcelable: Parcelable)Performs |
java-static Any! |
<T> typeToAny(type: T)Performs a type T to Any proto message conversion. |
java-static ByteString! |
typeToByteString(object: Any)Performs an object to |
Public functions
anyToType
java-static fun <T> anyToType(any: Any): T!
Performs an 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 |
byteStringToParcelable
java-static fun byteStringToParcelable(
byteString: ByteString,
parcelableClass: Class<Parcelable!>
): Parcelable!
Performs a ByteString to Parcelable conversion.
| Parameters | |
|---|---|
byteString: ByteString |
the |
parcelableClass: Class<Parcelable!> |
the class type to create |
| Returns | |
|---|---|
Parcelable! |
instance of |
byteStringToType
java-static fun <T> byteStringToType(byteString: ByteString): T!
Performs a ByteString to type T conversion.
| Parameters | |
|---|---|
byteString: ByteString |
the |
| Returns | |
|---|---|
T! |
instance of type T |
parcelableToByteString
java-static fun parcelableToByteString(parcelable: Parcelable): ByteString!
Performs Parcelable to ByteString conversion.
| Parameters | |
|---|---|
parcelable: Parcelable |
|
| Returns | |
|---|---|
ByteString! |
|
typeToAny
java-static fun <T> typeToAny(type: T): Any!
Performs a type T to Any proto message conversion.
| Parameters | |
|---|---|
type: T |
target type to wrap into its Any representation |
| Returns | |
|---|---|
Any! |
Any proto message which contains the wrapped proto representation of T |
typeToByteString
java-static fun typeToByteString(object: Any): ByteString!
Performs an object to ByteString conversion.
| Parameters | |
|---|---|
object: Any |
object to convert to a |
| Returns | |
|---|---|
ByteString! |
|