Class JsonFormatter


  • public class JsonFormatter
    extends Object
    Formats objects to JSON strings according to the configured ObjectMapper and output parameters.
    • Constructor Detail

      • JsonFormatter

        public JsonFormatter​(com.fasterxml.jackson.databind.ObjectMapper objectMapper,
                             boolean prettyPrint,
                             boolean doesAppendLineSeparator,
                             int bufferSize)
      • JsonFormatter

        public JsonFormatter​(com.fasterxml.jackson.databind.ObjectMapper objectMapper,
                             boolean prettyPrint,
                             boolean doesAppendLineSeparator)
    • Method Detail

      • toJson

        public @Nullable String toJson​(@Nullable Map<String,​Object> map)
        Converts the provided map as a JSON object according to the configured JSON mapper.
        Parameters:
        map - the provided map
        Returns:
        the JSON as a string