Interface JsonSupporting<T>
- Type Parameters:
T
- Value type, same as inValueEngineer
public interface JsonSupporting<T>
Specialized
JsonHandler
interface for ValueEngineer
s providing means to transform the related value to JSON
.- Since:
- 5.2.191206
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ValueEngineerAspectType<JsonSupporting<?>>
Aspect forValueEngineer
s providing means to transform the related value toJSON
. -
Method Summary
Modifier and TypeMethodDescriptionThis method should return the value type for which thissupporting
is 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 forValueEngineer
s 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
- TheJsonGenerationContext
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
This method should return the value type for which thissupporting
is responsible - same as inValueEngineer
.- Returns:
- The value type for which this
supporting
is responsible. - Since:
- 5.2.191206
-