Class DataRegistry

java.lang.Object
studio.mevera.lotus.api.data.DataRegistry

public final class DataRegistry extends Object
Type-safe heterogeneous container keyed by Key. Replaces the legacy String -> Object bag — values are validated against their key's declared type at insert and at read.

Not thread-safe. Lotus mutators run on the server main thread.

  • Method Details

    • empty

      @NotNull public static @NotNull DataRegistry empty()
    • put

      @NotNull public <T> @NotNull DataRegistry put(@NotNull @NotNull Key<T> key, @NotNull T value)
    • get

      @NotNull public <T> @NotNull Optional<T> get(@NotNull @NotNull Key<T> key)
    • require

      @NotNull public <T> T require(@NotNull @NotNull Key<T> key)
    • getOrNull

      @Nullable public <T> T getOrNull(@NotNull @NotNull Key<T> key)
    • contains

      public boolean contains(@NotNull @NotNull Key<?> key)
    • remove

      public void remove(@NotNull @NotNull Key<?> key)
    • size

      public int size()