@ExperimentalApi(value="https://github.com/grpc/grpc-java/issues/8022")
public final class ParcelableUtils
extends java.lang.Object
This class models the same pattern as the ProtoLiteUtils class.
| Modifier and Type | Method and Description |
|---|---|
static <P extends android.os.Parcelable> |
metadataKey(java.lang.String name,
android.os.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 android.os.Parcelable> |
metadataKeyForImmutableType(java.lang.String name,
android.os.Parcelable.Creator<P> creator)
Create a
Metadata.Key for passing a Parcelable object in the metadata of an RPC,
treating instances as immutable. |
public static <P extends android.os.Parcelable> io.grpc.Metadata.Key<P> metadataKey(java.lang.String name,
android.os.Parcelable.Creator<P> creator)
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.
public static <P extends android.os.Parcelable> io.grpc.Metadata.Key<P> metadataKeyForImmutableType(java.lang.String name,
android.os.Parcelable.Creator<P> creator)
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. Not
copying for in-process calls).
Note:Parcelables can only be sent across in-process and binder channels.