Class JacksonProcessing


  • public final class JacksonProcessing
    extends Object
    Utility methods for Jackson integration.
    • Method Detail

      • reader

        public static Reader<Object> reader​(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
        Returns a Reader that converts a Publisher of ByteBuffers to a Java object.

        This method is intended for the derivation of other, more specific readers.

        Parameters:
        objectMapper - the ObjectMapper to use; must not be null
        Returns:
        the byte array content reader that transforms a publisher of byte buffers to a completion stage that might end exceptionally with a RuntimeException in case of I/O error
        Throws:
        NullPointerException - if objectMapper is null
      • writer

        public static Function<Object,​Flow.Publisher<DataChunk>> writer​(com.fasterxml.jackson.databind.ObjectMapper objectMapper,
                                                                              Charset charset)
        Returns a function (writer) converting Objects to Publishers of DataChunks by using the supplied ObjectMapper.
        Parameters:
        objectMapper - the ObjectMapper to use; must not be null
        charset - the charset to use; may be null
        Returns:
        created function
        Throws:
        NullPointerException - if objectMapper is null