Interface JsonSupporting<T>

Type Parameters:
T - Value type, same as in ValueEngineer

public interface JsonSupporting<T>
Specialized JsonHandler interface for ValueEngineers providing means to transform the related value to JSON.
Since:
5.2.191206
  • Field Details

  • Method Details

    • handle

      @NotNull @NotNull JsonElement<?> handle(@NotNull @NotNull JsonGenerationContext context, @NotNull T value)
      This method transforms the given value to a valid JsonElement. Use json api to create json structure.
      Attention: This call should return very fast and should not make any calls to remote services. Example:
       JsonObject.create().
                      put(JsonPair.of("myText", JsonStringValue.of(myTextValue))).
                      put(JsonPair.of("myNumber", JsonNumberValue.of(myNumberValue)));
       
      Parameters:
      context - The JsonGenerationContext for rendering this value.
      value - The value that needs handling.
      Returns:
      A JsonElement representing the given value in json.
      Since:
      5.2.191206
      See Also:
    • getSupportedClass

      @NotNull @NotNull Class<T> getSupportedClass()
      This method should return the value type for which this supporting is responsible - same as in ValueEngineer.
      Returns:
      The value type for which this supporting is responsible.
      Since:
      5.2.191206