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
    default @Nullable T
    byId(@org.checkerframework.checker.index.qual.NonNegative int id)
    Looks up a registry entry by its ID.
    default @Nullable T
    byKey(net.kyori.adventure.key.Key key)
    Looks up a registry entry by its key.
    default int
    byValue(T value)
    Reverse looks-up an object to return its network ID, or -1.
    All entries of this registry, as a list.
    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.
    entryByKey(net.kyori.adventure.key.Key key)
    Looks up a registry entry by its key, and returns it wrapped in RegistryEntryData.
    entryByValue(T value)
    Reverse looks-up an object to return it wrapped in RegistryEntryData, or null.
    default List<net.kyori.adventure.key.Key>
    All keys of this registry, as a list.
    default int
    The amount of values registered in this registry.
    default List<T>
    All values of this registry, as a list.
  • Method Details

    • byId

      default @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

      default Optional<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

      default @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

      default Optional<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

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

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

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

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

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

      List<RegistryEntryData<T>> entries()
      All entries of this registry, as a list.