Interface JavaRegistry<T>

All Superinterfaces:
Iterable<RegistryEntryData<T>>
All Known Implementing Classes:
SimpleJavaRegistry

public interface JavaRegistry<T> extends Iterable<RegistryEntryData<T>>
A wrapper for a list, holding Java registry values.
  • 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.
    • iterator

      default @NonNull Iterator<RegistryEntryData<T>> iterator()
      Specified by:
      iterator in interface Iterable<T>
    • entries

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