Package com.linecorp.armeria.common.grpc
Class GrpcJsonMarshallerBuilder
java.lang.Object
com.linecorp.armeria.common.grpc.GrpcJsonMarshallerBuilder
A builder for creating a new
GrpcJsonMarshaller that serializes and deserializes a Message
to and from JSON.-
Method Summary
Modifier and TypeMethodDescriptionbuild(ServiceDescriptor serviceDescriptor) Returns a newly-createdGrpcJsonMarshallerwith the specifiedServiceDescriptor.jsonMarshallerCustomizer(Consumer<? super MessageMarshaller.Builder> jsonMarshallerCustomizer)
-
Method Details
-
jsonMarshallerCustomizer
public GrpcJsonMarshallerBuilder jsonMarshallerCustomizer(Consumer<? super MessageMarshaller.Builder> jsonMarshallerCustomizer) Sets aConsumerthat can customize the JSON marshaller forMessageused when handling JSON payloads in the service. This is commonly used to switch from the default of using lowerCamelCase for field names to using the field name from the proto definition, by settingMessageMarshaller.Builder.preservingProtoFieldNames(boolean). -
build
Returns a newly-createdGrpcJsonMarshallerwith the specifiedServiceDescriptor.
-