Package 

Class ObjectMapperDecoder

  • All Implemented Interfaces:
    io.outfoxx.sunday.mediatypes.codecs.MediaTypeDecoder , io.outfoxx.sunday.mediatypes.codecs.StructuredMediaTypeDecoder

    
    public class ObjectMapperDecoder
     implements MediaTypeDecoder, StructuredMediaTypeDecoder
                        

    Common Jackson ObjectMapper decoder that supports decoding from binary data and structured map data.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final ObjectMapper objectMapper
    • Constructor Summary

      Constructors 
      Constructor Description
      ObjectMapperDecoder(ObjectMapper objectMapper)
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final ObjectMapper getObjectMapper()
      <T extends Any> T decode(Source data, KType type) Decodes binary data into a specific Java/Kotlin type.
      <T extends Any> T decode(Map<String, Object> data, KType type) Decodes a structured Map into a specific Java/Kotlin type.
      • Methods inherited from class kotlin.Any

        equals, hashCode, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ObjectMapperDecoder

        ObjectMapperDecoder(ObjectMapper objectMapper)
    • Method Detail

      • decode

         <T extends Any> T decode(Source data, KType type)

        Decodes binary data into a specific Java/Kotlin type.

        Parameters:
        data - Binary data source.
        type - Target Java/Kotlin type.
      • decode

         <T extends Any> T decode(Map<String, Object> data, KType type)

        Decodes a structured Map into a specific Java/Kotlin type.

        Parameters:
        data - Structured map to decode.
        type - Target Java/Kotlin type.