Class TypeAdapter<T,S>

java.lang.Object
ca.spottedleaf.yamlconfig.adapter.TypeAdapter<T,S>
Type Parameters:
T - The deserialized type of the object
S - The serialized type of the object
Direct Known Subclasses:
BigDecimalTypeAdapter, BigIntegerTypeAdapter, BooleanTypeAdapter, ByteTypeAdapter, CollectionTypeAdapter, DefaultedTypeAdapter, DoubleTypeAdapter, EnumMapTypeAdapter, EnumSetTypeAdapter, FloatTypeAdapter, IntegerTypeAdapter, ListTypeAdapter, LongTypeAdapter, MapTypeAdapter, SetTypeAdapter, ShortTypeAdapter, StringEnumTypeAdapter, StringFormTypeAdapter, StringTypeAdapter

public abstract class TypeAdapter<T,S> extends Object
Class which defines serialization to and from YAML.
  • Constructor Details

    • TypeAdapter

      public TypeAdapter()
  • Method Details

    • deserialize

      public abstract T deserialize(TypeAdapterRegistry registry, Object input, Type type)
      Deserializes the value from YAML.
      Parameters:
      registry - The type adapter registry context.
      input - The object from YAML.
      type - The type information associated with the deserialized object.
      Returns:
      The deserialized form of the object.
    • serialize

      public abstract S serialize(TypeAdapterRegistry registry, T value, Type type)
      Serializes the value to YAML.
      Parameters:
      registry - The type adapter registry context.
      value - The deserialized form of the object.
      type - The type information associated with the deserialized object.
      Returns:
      The serialized form of the object.