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.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

    • Method Detail

      • 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.

      • wrapping

         abstract Type wrapping()
        Returns:

        the type you're wrapping (same as T).

      • 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.

      • child

         abstract Schema<B> child()
        Returns:

        the child schema this wrapper schema wraps around.