Interface JavaRegistry<T>

All Known Implementing Classes:
SimpleJavaRegistry

public interface JavaRegistry<T>
A wrapper for a list, holding Java registry values.
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable T
    byId(@org.checkerframework.checker.index.qual.NonNegative int id)
    Looks up a registry entry by its ID.
    @Nullable T
    byKey(net.kyori.adventure.key.Key key)
    Looks up a registry entry by its key.
    int
    byValue(T value)
    Reverse looks-up an object to return its network ID, or -1.
    @Nullable RegistryEntryData<T>
    entryById(@org.checkerframework.checker.index.qual.NonNegative int id)
    Looks up a registry entry by its ID, and returns it wrapped in RegistryEntryData so that its registered key is also known.
    @Nullable RegistryEntryData<T>
    entryByKey(net.kyori.adventure.key.Key key)
    Looks up a registry entry by its key, and returns it wrapped in RegistryEntryData.
    @Nullable RegistryEntryData<T>
    entryByValue(T value)
    Reverse looks-up an object to return it wrapped in RegistryEntryData, or null.
    List<net.kyori.adventure.key.Key>
    All keys of this registry, as a list.
    void
    Resets the objects by these IDs.
    int
    The amount of values registered in this registry.
    All values of this registry, as a list.
  • Method Details

    • byId

      @Nullable T byId(@org.checkerframework.checker.index.qual.NonNegative int id)
      Looks up a registry entry by its ID. The object can be null, or not present.
    • entryById

      @Nullable RegistryEntryData<T> entryById(@org.checkerframework.checker.index.qual.NonNegative int id)
      Looks up a registry entry by its ID, and returns it wrapped in RegistryEntryData so that its registered key is also known. The object can be null, or not present.
    • byKey

      @Nullable T byKey(net.kyori.adventure.key.Key key)
      Looks up a registry entry by its key. The object can be null, or not present.
    • entryByKey

      @Nullable RegistryEntryData<T> entryByKey(net.kyori.adventure.key.Key key)
      Looks up a registry entry by its key, and returns it wrapped in RegistryEntryData. The object can be null, or not present.
    • byValue

      int byValue(T value)
      Reverse looks-up an object to return its network ID, or -1.
    • entryByValue

      @Nullable RegistryEntryData<T> entryByValue(T value)
      Reverse looks-up an object to return it wrapped in RegistryEntryData, or null.
    • reset

      void reset(List<RegistryEntryData<T>> values)
      Resets the objects by these IDs.
    • keys

      List<net.kyori.adventure.key.Key> keys()
      All keys of this registry, as a list.
    • values

      List<T> values()
      All values of this registry, as a list.
    • size

      int size()
      The amount of values registered in this registry.