Package dev.drtheo.autojson.schema.base
Interface WrapperSchema
-
- All Implemented Interfaces:
-
dev.drtheo.autojson.schema.base.Schema
public interface WrapperSchema<T, B> implements 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 Type Method Description <S> ObjectSchema<S>asObject()<S> ArraySchema<S, out Object>asArray()<S> PrimitiveSchema<S>asPrimitive()bytetype()The type of the schema. abstract Typewrapping()abstract <To> Tdeserialize(JsonAdapter<Object, To> adapter, B t)abstract Schema<B>child()-
-
Method Detail
-
asObject
<S> ObjectSchema<S> asObject()
-
asArray
<S> ArraySchema<S, out Object> asArray()
-
asPrimitive
<S> PrimitiveSchema<S> asPrimitive()
-
type
byte type()
The type of the schema. Instead of doing if-instanceof checks for the schema implementations, the adapters should use the SchemaType with a switch statement instead.
- Returns:
the type of this schema.
-
deserialize
abstract <To> T deserialize(JsonAdapter<Object, To> adapter, B t)
- Parameters:
adapter- the adapter used to deserialize this object.t- the object you're deserializing the data into.- Returns:
The deserialized wrapped object.
-
-
-
-