TypeProtoConverters
public final class TypeProtoConverters
Converters from Any proto messages to their unwrapped target types.
Summary
Public methods |
|
|---|---|
static T |
Performs an |
static Parcelable |
byteStringToParcelable(Performs a |
static T |
<T> byteStringToType(@NonNull ByteString byteString)Performs a |
static ByteString |
parcelableToByteString(@NonNull Parcelable parcelable)Performs |
static Any |
Performs a type T to |
static ByteString |
typeToByteString(@NonNull Object object)Performs an object to |
Public methods
anyToType
public static T <T> anyToType(@NonNull Any any)
Performs an Any proto message to type T conversion.
| Returns | |
|---|---|
T |
unwrapped target type T |
byteStringToParcelable
public static Parcelable byteStringToParcelable(
@NonNull ByteString byteString,
@NonNull Class<Parcelable> parcelableClass
)
Performs a ByteString to Parcelable conversion.
| Parameters | |
|---|---|
@NonNull ByteString byteString |
the |
@NonNull Class<Parcelable> parcelableClass |
the class type to create |
| Returns | |
|---|---|
Parcelable |
instance of |
byteStringToType
public static T <T> byteStringToType(@NonNull ByteString byteString)
Performs a ByteString to type T conversion.
| Parameters | |
|---|---|
@NonNull ByteString byteString |
the |
| Returns | |
|---|---|
T |
instance of type T |
parcelableToByteString
public static ByteString parcelableToByteString(@NonNull Parcelable parcelable)
Performs Parcelable to ByteString conversion.
| Parameters | |
|---|---|
@NonNull Parcelable parcelable |
|
| Returns | |
|---|---|
ByteString |
|
typeToAny
public static Any <T> typeToAny(@NonNull T type)
Performs a type T to Any proto message conversion.
typeToByteString
public static ByteString typeToByteString(@NonNull Object object)
Performs an object to ByteString conversion.
| Parameters | |
|---|---|
@NonNull Object object |
object to convert to a |
| Returns | |
|---|---|
ByteString |
|