Class JsonSerializer

  • All Implemented Interfaces:
    Serializer

    public class JsonSerializer
    extends Object
    implements Serializer
    A JSON serializer.
    Since:
    3.9.0
    Author:
    Jerome LELEU
    • Constructor Detail

      • JsonSerializer

        public JsonSerializer​(Class<? extends Object> clazz)
    • Method Detail

      • encode

        public String encode​(Object obj)
        Description copied from interface: Serializer
        Encode an object into a string.
        Specified by:
        encode in interface Serializer
        Parameters:
        obj - the object to encode
        Returns:
        the encoded string
      • decode

        public Object decode​(String encoded)
        Description copied from interface: Serializer
        Decode a string into an object.
        Specified by:
        decode in interface Serializer
        Parameters:
        encoded - the encoded string
        Returns:
        the decoded object
      • getObjectMapper

        public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
      • setObjectMapper

        public void setObjectMapper​(com.fasterxml.jackson.databind.ObjectMapper objectMapper)