Package com.linecorp.armeria.common.grpc
Class GsonGrpcJsonMarshallerBuilder
java.lang.Object
com.linecorp.armeria.common.grpc.GsonGrpcJsonMarshallerBuilder
A builder for creating a new
GrpcJsonMarshaller
that serializes and deserializes a Message
to and from JSON.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Returns a newly-createdGrpcJsonMarshaller
.jsonParserCustomizer
(Consumer<? super JsonFormat.Parser> jsonParserCustomizer) Adds aConsumer
that can customize theJsonFormat.Parser
used when deserializing a JSON payload into aMessage
.jsonPrinterCustomizer
(Consumer<? super JsonFormat.Printer> jsonPrinterCustomizer) Adds aConsumer
that can customize theJsonFormat.Printer
used when serializing aMessage
into a JSON payload.
-
Method Details
-
jsonParserCustomizer
public GsonGrpcJsonMarshallerBuilder jsonParserCustomizer(Consumer<? super JsonFormat.Parser> jsonParserCustomizer) Adds aConsumer
that can customize theJsonFormat.Parser
used when deserializing a JSON payload into aMessage
. -
jsonPrinterCustomizer
public GsonGrpcJsonMarshallerBuilder jsonPrinterCustomizer(Consumer<? super JsonFormat.Printer> jsonPrinterCustomizer) Adds aConsumer
that can customize theJsonFormat.Printer
used when serializing aMessage
into a JSON payload. -
build
Returns a newly-createdGrpcJsonMarshaller
.
-