Class GrpcJsonMarshallerBuilder

java.lang.Object
com.linecorp.armeria.common.grpc.GrpcJsonMarshallerBuilder

public final class GrpcJsonMarshallerBuilder extends Object
A builder for creating a new GrpcJsonMarshaller that serializes and deserializes a Message to and from JSON.
  • Method Details

    • jsonMarshallerCustomizer

      public GrpcJsonMarshallerBuilder jsonMarshallerCustomizer(Consumer<? super org.curioswitch.common.protobuf.json.MessageMarshaller.Builder> jsonMarshallerCustomizer)
      Sets a Consumer that can customize the JSON marshaller for Message used 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 setting MessageMarshaller.Builder.preservingProtoFieldNames(boolean).
    • build

      public GrpcJsonMarshaller build(io.grpc.ServiceDescriptor serviceDescriptor)
      Returns a newly-created GrpcJsonMarshaller with the specified ServiceDescriptor.