public final class ProtoBufSerializationProviderBuilder
extends java.lang.Object
GrpcSerializationProvider
that can serialize and deserialize
pre-registered protocol buffer objects.
registerMessageType(Class, Parser)
is used to add one or more MessageLite
message types. Resulting
GrpcSerializationProvider
from build()
will only serialize and deserialize those message types.Constructor and Description |
---|
ProtoBufSerializationProviderBuilder() |
Modifier and Type | Method and Description |
---|---|
GrpcSerializationProvider |
build()
Builds a new
GrpcSerializationProvider containing all the message types registered with this builder. |
<T extends com.google.protobuf.MessageLite> |
registerMessageType(java.lang.Class<T> messageType,
com.google.protobuf.Parser<T> parser)
Register the passed
messageType with the provided Parser . |
public ProtoBufSerializationProviderBuilder()
public <T extends com.google.protobuf.MessageLite> ProtoBufSerializationProviderBuilder registerMessageType(java.lang.Class<T> messageType, com.google.protobuf.Parser<T> parser)
messageType
with the provided Parser
.T
- Type of MessageLite
to register.messageType
- Class
of the type of message to register.parser
- Parser
for this message type.this
public GrpcSerializationProvider build()
GrpcSerializationProvider
containing all the message types registered with this builder.GrpcSerializationProvider
that will serialize and deserialize message types that were
registered to this builder.