Class Key<T>

java.lang.Object
studio.mevera.lotus.api.data.Key<T>

public final class Key<T> extends Object
Strongly-typed identifier for values stored in a DataRegistry.

Two keys are equal iff their names match — type is metadata, not identity. This permits a single registry slot to evolve type while preserving identity, but makes type mismatch a runtime error caught at lookup (DataRegistry.get(Key)).

  • Method Details

    • of

      @NotNull public static <T> @NotNull Key<T> of(@NotNull @NotNull String name, @NotNull @NotNull Class<T> type)
    • name

      @NotNull public @NotNull String name()
    • type

      @NotNull public @NotNull Class<T> type()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object