Interface JsonSupporting<T>
- Type Parameters:
T- Value type, same as inValueEngineer
public interface JsonSupporting<T>
Specialized
JsonHandler interface for ValueEngineers providing means to transform the related value to JSON.- Since:
- 5.2.191206
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ValueEngineerAspectType<JsonSupporting<?>>Aspect forValueEngineers providing means to transform the related value toJSON. -
Method Summary
Modifier and TypeMethodDescriptionThis method should return the value type for which thissupportingis responsible - same as inValueEngineer.@NotNull JsonElement<?>handle(@NotNull JsonGenerationContext context, T value) This method transforms the given value to a validJsonElement.
-
Field Details
-
TYPE
Aspect forValueEngineers providing means to transform the related value toJSON.- Since:
- 5.2.191206
-
-
Method Details
-
handle
@NotNull @NotNull JsonElement<?> handle(@NotNull @NotNull JsonGenerationContext context, @NotNull T value) This method transforms the given value to a validJsonElement. 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- TheJsonGenerationContextfor rendering this value.value- The value that needs handling.- Returns:
- A
JsonElementrepresenting the given value in json. - Since:
- 5.2.191206
- See Also:
-
getSupportedClass
This method should return the value type for which thissupportingis responsible - same as inValueEngineer.- Returns:
- The value type for which this
supportingis responsible. - Since:
- 5.2.191206
-