Class BakedClassAutoSchema<T>

java.lang.Object
dev.drtheo.autojson.schema.baked.BakedClassAutoSchema<T>
All Implemented Interfaces:
ObjectSchema<T>, Schema<T>

public class BakedClassAutoSchema<T> extends Object implements ObjectSchema<T>
  • Method Details

    • bake

      public static <T> BakedClassAutoSchema<T> bake(AutoJSON auto, Class<T> clazz)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • serialize

      public <To> void serialize(JsonAdapter<Object,To> auto, JsonSerializationContext.Obj c, T t)
      Specified by:
      serialize in interface ObjectSchema<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 key-value pairs.
      t - the object you're serializing.
    • instantiate

      public T instantiate()
      Specified by:
      instantiate in interface ObjectSchema<T>
      Returns:
      A new instance of the object this schema serializes.
    • deserialize

      public <To> void deserialize(JsonAdapter<Object,To> auto, JsonDeserializationContext c, T t, String field)
      Specified by:
      deserialize in interface ObjectSchema<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.
      t - the object you're deserializing the data into.
      field - the name of the field you're deserializing.