Package dev.drtheo.autojson.schema.base
Interface WrapperSchema<T,B>
- Type Parameters:
T- the type this schema serializes.
- All Superinterfaces:
Schema<T>
One of the base implementations of the
Schema class.
A schema used to serialize a class that wraps another object with its own schema.-
Method Summary
Modifier and TypeMethodDescriptiondefault <S> ArraySchema<S,?> asArray()default <S> ObjectSchema<S>asObject()default <S> PrimitiveSchema<S>child()<To> Tdeserialize(JsonAdapter<Object, To> adapter, B t) default bytetype()The type of the schema.wrapping()
-
Method Details
-
asObject
-
asArray
-
asPrimitive
- Specified by:
asPrimitivein interfaceSchema<T>
-
type
default byte type()Description copied from interface:SchemaThe type of the schema.
Instead of doing if-instanceof checks for the schema implementations, the adapters should use theSchemaTypewith a switch statement instead. -
wrapping
Type wrapping()- Returns:
- the type you're wrapping (same as
WrapperSchema).
-
deserialize
- Type Parameters:
To- the type the adapter serializes to.- Parameters:
adapter- the adapter used to deserialize this object.t- the object you're deserializing the data into.- Returns:
- The deserialized wrapped object.
-
child
- Returns:
- the child schema this wrapper schema wraps around.
-