-
public final class ParcelableUtils
Utility methods for using Android Parcelable objects with gRPC.
This class models the same pattern as the
{@code ProtoLiteUtils}
class.
-
-
Method Summary
Modifier and Type Method Description static <P extends Parcelable> Metadata.Key<P>
metadataKey(String name, Parcelable.Creator<P> creator)
Create a Metadata.Key for passing a Parcelable object in the metadata of an RPC,treating instances as mutable. static <P extends Parcelable> Metadata.Key<P>
metadataKeyForImmutableType(String name, Parcelable.Creator<P> creator)
Create a Metadata.Key for passing a Parcelable object in the metadata of an RPC,treating instances as immutable. -
-
Method Detail
-
metadataKey
static <P extends Parcelable> Metadata.Key<P> metadataKey(String name, Parcelable.Creator<P> creator)
Create a Metadata.Key for passing a Parcelable object in the metadata of an RPC,treating instances as mutable.
Note:Parcelables can only be sent across in-process and binder channels.
-
metadataKeyForImmutableType
static <P extends Parcelable> Metadata.Key<P> metadataKeyForImmutableType(String name, Parcelable.Creator<P> creator)
Create a Metadata.Key for passing a Parcelable object in the metadata of an RPC,treating instances as immutable. Immutability may be used for optimization purposes (e.g. Notcopying for in-process calls).
Note:Parcelables can only be sent across in-process and binder channels.
-
-
-
-