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 aConsumerthat can customize theJsonFormat.Parserused when deserializing a JSON payload into aMessage.jsonPrinterCustomizer(Consumer<? super JsonFormat.Printer> jsonPrinterCustomizer) Adds aConsumerthat can customize theJsonFormat.Printerused when serializing aMessageinto a JSON payload.
-
Method Details
-
jsonParserCustomizer
public GsonGrpcJsonMarshallerBuilder jsonParserCustomizer(Consumer<? super JsonFormat.Parser> jsonParserCustomizer) Adds aConsumerthat can customize theJsonFormat.Parserused when deserializing a JSON payload into aMessage. -
jsonPrinterCustomizer
public GsonGrpcJsonMarshallerBuilder jsonPrinterCustomizer(Consumer<? super JsonFormat.Printer> jsonPrinterCustomizer) Adds aConsumerthat can customize theJsonFormat.Printerused when serializing aMessageinto a JSON payload. -
build
Returns a newly-createdGrpcJsonMarshaller.
-