Class JavaListSchema<T>
java.lang.Object
dev.drtheo.autojson.schema.template.JavaListSchema<T>
- All Implemented Interfaces:
ArraySchema<List<T>,,List<T>> ArraySchema.Simple<List<T>>,Schema<List<T>>
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.drtheo.autojson.schema.base.ArraySchema
ArraySchema.Simple<T> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondeserialize(JsonAdapter<Object, To> auto, JsonDeserializationContext c, List<T> o, int index) <To> voidserialize(JsonAdapter<Object, To> auto, JsonSerializationContext.Array c, List<T> ts) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.drtheo.autojson.schema.base.ArraySchema
serialize, typeMethods inherited from interface dev.drtheo.autojson.schema.base.ArraySchema.Simple
packMethods inherited from interface dev.drtheo.autojson.schema.base.Schema
asArray, asObject, asPrimitive, asWrapper
-
Constructor Details
-
JavaListSchema
-
-
Method Details
-
serialize
public <To> void serialize(JsonAdapter<Object, To> auto, JsonSerializationContext.Array c, List<T> ts) - Specified by:
serializein interfaceArraySchema<List<T>,List<T>> - Type Parameters:
To- the type the adapter serializes to.- Parameters:
auto- the adapter used to serialize this object.c- the serialization context. Used to provide the values in ascending order (fromarr[0]toarr[N]).ts- the object you're serializing.
-
instantiate
- Specified by:
instantiatein interfaceArraySchema<List<T>,List<T>> - Returns:
- a new instance of the
ArraySchematype.
-
deserialize
public <To> List<T> deserialize(JsonAdapter<Object, To> auto, JsonDeserializationContext c, List<T> o, int index) - Specified by:
deserializein interfaceArraySchema<List<T>,List<T>> - Type Parameters:
To- the type the adapter serializes to.- Parameters:
auto- the adapter used to deserialize this object.c- the deserialization context. Used to query the deserialization.o- the object you're deserializing the data into.index- the index of the element, maintaining the order used for serialization inArraySchema.serialize(JsonAdapter, JsonSerializationContext.Array, Object).- Returns:
- the new
ArraySchemavalue.
-