Interface Registry<T extends net.kyori.adventure.key.Keyed>

All Superinterfaces:
Iterable<T>
All Known Subinterfaces:
ReloadableRegistry<T>

@NonExtendable public interface Registry<T extends net.kyori.adventure.key.Keyed> extends Iterable<T>
Read view of a registry. Iteration order is registration order (deterministic, ยง19). Thread-safe once frozen.
  • Method Details

    • type

      @NotNull @NotNull RegistryType<T> type()
    • get

      @NotNull @NotNull Optional<T> get(@NotNull @NotNull net.kyori.adventure.key.Key id)
      The entry id, or the entry an alias id points to.
    • getOrThrow

      @NotNull default T getOrThrow(@NotNull @NotNull net.kyori.adventure.key.Key id)
    • contains

      boolean contains(@NotNull @NotNull net.kyori.adventure.key.Key id)
      Whether get(Key) finds id, as an entry or an alias.
    • containsValue

      boolean containsValue(@NotNull T value)
      Returns:
      whether this exact (reference-equal) object is registered
    • owner

      @NotNull @NotNull Optional<AddonId> owner(@NotNull @NotNull net.kyori.adventure.key.Key id)
      The addon that registered the entry or the alias id.
    • keys

      @NotNull @NotNull Set<net.kyori.adventure.key.Key> keys()
      The keys of the entries; aliases are not included.
    • aliases

      @NotNull default @NotNull Map<net.kyori.adventure.key.Key, net.kyori.adventure.key.Key> aliases()
      Old keys and the entry each one now means (see WritableRegistry.alias(Key, Key)).
    • values

      @NotNull @NotNull List<T> values()
    • stream

      @NotNull default @NotNull Stream<T> stream()
    • size

      default int size()
    • iterator

      @NotNull default @NotNull Iterator<T> iterator()
      Specified by:
      iterator in interface Iterable<T extends net.kyori.adventure.key.Keyed>