TypeProtoConverters
This package is part of the
Android support library which
is no longer maintained.
The support library has been superseded by AndroidX
which is part of Jetpack .
We recommend using the AndroidX libraries in all new projects. You should also consider
migrating existing projects to AndroidX.
To find the AndroidX class that maps to this deprecated class, see the AndroidX
support library class
mappings .
public
final
class
TypeProtoConverters
extends Object
Converters from Any
proto messages to their unwrapped target types.
Summary
Inherited methods
From
class
java.lang.Object
Object
clone()
boolean
equals(Object arg0)
void
finalize()
final
Class <?>
getClass()
int
hashCode()
final
void
notify()
final
void
notifyAll()
String
toString()
final
void
wait(long arg0, int arg1)
final
void
wait(long arg0)
final
void
wait()
Public methods
anyToType
T anyToType (Any any)
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
byteStringToType
T byteStringToType (ByteString byteString)
Performs a ByteString
to type T conversion.
Parameters
byteString
ByteString
: the ByteString
to convert into T
Returns
T
instance of type T
typeToAny
Any typeToAny (T type)
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
ByteString typeToByteString (Object object)
Performs an object to ByteString
conversion.
Parameters
object
Object
: object to convert to a ByteString
Returns
ByteString
ByteString
representation of the passed object
Interfaces
Classes
Enums
Exceptions
Content and code samples on this page are subject to the licenses described in the Content License . Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[]]