Record Class JsonArray<T,U>

java.lang.Object
java.lang.Record
net.tangly.gleam.model.JsonArray<T,U>
Type Parameters:
T - type of the entity owning the field
U - type of the common ancestor for the entities stored in the array
Record Components:
key - name of the property containing the JSON array
getter - getter of the property - returns a collection of items
setter - setter used to add an item to the collection mapping the JSON array
importSelector - selector to identify the type of the collection item based on any discriminator in the JSON array
exportSelector - selector to identify the type of the collection item based on any discriminator of the Java object
All Implemented Interfaces:
JsonField<T,U>

public record JsonArray<T,U>(@NotNull String key, @NotNull Function<T,Collection<U>> getter, @NotNull BiConsumer<T,U> setter, Function<org.json.JSONObject,JsonEntity<?>> importSelector, Function<Object,JsonEntity<?>> exportSelector) extends Record implements JsonField<T,U>
Define a field containing an array of entities. The entities can be of different types but must have a common ancestor.