Package dev.drtheo.autojson.schema.base
Interface WrapperSchema<T>
- 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 ArraySchema<T,?> asArray()default ObjectSchema<T>asObject()default PrimitiveSchema<T>child()default <To> JsonSerializationContext.Builtserialize(JsonAdapter<Object, To> adapter, JsonSerializationContext ctx, T t) default SchemaTypetype()The type of the schema.
-
Method Details
-
asObject
-
asArray
-
asPrimitive
- Specified by:
asPrimitivein interfaceSchema<T>
-
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. -
serialize
default <To> JsonSerializationContext.Built serialize(JsonAdapter<Object, To> adapter, JsonSerializationContext ctx, T t) -
child
- Returns:
- the child schema this wrapper schema wraps around.
-