Interface JsonMapper<T>


public interface JsonMapper<T>
Helper used to convert alert details to and from JSON. The framework provides a standard implementation based on the Jackson framework. Custom helpers can be provided when defining new issues if the details need custom conversion.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    Parses the provided JSON and returns an instance of the provided type, or null if parsing failed
    toJson(T value)
    Creates a JSON representation of the provided value
  • Method Details

    • getType

      @Nonnull Class<T> getType()
      Returns:
      the type of the alert details
    • parseJson

      @Nullable T parseJson(@Nullable String json)
      Parses the provided JSON and returns an instance of the provided type, or null if parsing failed
      Parameters:
      json - the JSON string to parse
      Returns:
      the parsed instance, or null if json was blank or parsing failed
    • toJson

      @Nullable String toJson(@Nullable T value)
      Creates a JSON representation of the provided value
      Parameters:
      value - the value
      Returns:
      the JSON representation of the provided value, or null if value was null or conversion to JSON failed.