Interface GrpcMessageEncoder<T>
public interface GrpcMessageEncoder<T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final GrpcMessageEncoder<Buffer> static final GrpcMessageEncoder<JsonObject> An encoder in JSON format encodingJsonObjectinstances. -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccepts(WireFormat format) encode(T msg, WireFormat format) static <T extends com.google.protobuf.MessageLite>
GrpcMessageEncoder<T> encoder()Create an encoder for arbitrary message extendingMessageLite.static <T> GrpcMessageEncoder<T> json()Create and reutrn an encoder in JSON format encoding instances ofMessageOrBuilderusing the protobuf-java-util library otherwise usingJson.encodeToBuffer(Object)(Jackson Databind is required).
-
Field Details
-
IDENTITY
-
JSON_OBJECT
An encoder in JSON format encodingJsonObjectinstances.
-
-
Method Details
-
encoder
Create an encoder for arbitrary message extendingMessageLite.- Returns:
- the message encoder
-
json
Create and reutrn an encoder in JSON format encoding instances ofMessageOrBuilderusing the protobuf-java-util library otherwise usingJson.encodeToBuffer(Object)(Jackson Databind is required).- Returns:
- an encoder in JSON format encoding instances of
<T>.
-
encode
- Throws:
CodecException
-
accepts
-