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