Class JavaArraySchema
-
- All Implemented Interfaces:
-
dev.drtheo.autojson.schema.base.ArraySchema,dev.drtheo.autojson.schema.base.Schema
public class JavaArraySchema<T, E> implements ArraySchema<T, Intermediary>
-
-
Constructor Summary
Constructors Constructor Description JavaArraySchema(SchemaHolder holder, Class<E> elementClass)
-
Method Summary
Modifier and Type Method Description static <T, E> JavaArraySchema<T, E>unwrap(SchemaHolder holder, Class<T> clazz)<To> voidserialize(JsonAdapter<Object, To> auto, JsonSerializationContext.Array c, T ts)List<E>instantiate()<To> List<E>deserialize(JsonAdapter<Object, To> auto, JsonDeserializationContext c, List<E> ts, int index)Tpack(List<E> l)Converts the Intermediary type into the built T type. -
Methods inherited from class dev.drtheo.autojson.schema.base.ArraySchema
serialize, type -
Methods inherited from class dev.drtheo.autojson.schema.base.Schema
asArray, asObject, asPrimitive, asWrapper, createInstance -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
JavaArraySchema
JavaArraySchema(SchemaHolder holder, Class<E> elementClass)
-
-
Method Detail
-
unwrap
static <T, E> JavaArraySchema<T, E> unwrap(SchemaHolder holder, Class<T> clazz)
-
serialize
<To> void serialize(JsonAdapter<Object, To> auto, JsonSerializationContext.Array c, T ts)
-
instantiate
List<E> instantiate()
- Returns:
a new instance of the Intermediary type.
-
deserialize
<To> List<E> deserialize(JsonAdapter<Object, To> auto, JsonDeserializationContext c, List<E> ts, int index)
- Parameters:
index- the index of the element, maintaining the order used for serialization in serialize.- Returns:
the new Intermediary value.
-
-
-
-