Interface Persister<T>

All Known Implementing Classes:
ComponentPersister, EulerAnglePersister, ItemStackPersister, LocationPersister, NamespacedKeyPersister, PersisterRegistry, QuaternionfPersister, UUIDPersister, VectorPersister, WaypointTriggerRegistry

public interface Persister<T>
A serialisation primitive to be used with PersistenceLoader to serialise custom objects.
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates an object instance from the given DataKey.
    void
    save(T instance, DataKey root)
    Saves the object instance to the given DataKey.
  • Method Details

    • create

      T create(DataKey root)
      Creates an object instance from the given DataKey. Should not return null unless no data is present.
      Parameters:
      root - The root key to load from
      Returns:
      The created instance, or null if no data was present
    • save

      void save(T instance, DataKey root)
      Saves the object instance to the given DataKey.
      Parameters:
      instance - The object instance to save
      root - The key to save into