Interface GrpcMessageDecoder<T>


  • public interface GrpcMessageDecoder<T>
    • Method Detail

      • decoder

        static <T> GrpcMessageDecoder<T> decoder​(com.google.protobuf.Parser<T> parser)
        Create a decoder for a given protobuf Parser.
        Parameters:
        parser - the parser that returns decoded messages of type <T>
        Returns:
        the message decoder
      • json

        static <T> GrpcMessageDecoder<T> json​(java.util.function.Supplier<com.google.protobuf.Message.Builder> builder)
        Create a decoder for a given protobuf Parser.
        Parameters:
        builder - the supplier of a message builder
        Returns:
        the message decoder
      • json

        static <T> GrpcMessageDecoder<T> json​(Class<T> clazz)
        Create a decoder in JSON format decoding to instances of the clazz using Json.decodeValue(Buffer, Class) (Jackson Databind is required).
        Parameters:
        clazz - the java type to decode
        Returns:
        a decoder that decodes messages to instance of clazz in JSON format.