Package org.bukkit

Class Registry.SimpleRegistry<T extends Enum<T> & Keyed>

java.lang.Object
org.bukkit.Registry.SimpleRegistry<T>
All Implemented Interfaces:
Iterable<T>, Registry<T>
Enclosing interface:
Registry<T extends Keyed>

public static final class Registry.SimpleRegistry<T extends Enum<T> & Keyed> extends Object implements Registry<T>
  • Constructor Details

    • SimpleRegistry

      protected SimpleRegistry(@NotNull Class<T> type)
    • SimpleRegistry

      protected SimpleRegistry(@NotNull Class<T> type, @NotNull Predicate<T> predicate)
  • Method Details

    • get

      @Nullable public T get(@NotNull NamespacedKey key)
      Description copied from interface: Registry
      Get the object by its key.
      Specified by:
      get in interface Registry<T extends Enum<T> & Keyed>
      Parameters:
      key - non-null key
      Returns:
      item or null if does not exist
    • stream

      @NotNull public Stream<T> stream()
      Description copied from interface: Registry
      Returns a new stream, which contains all registry items, which are registered to the registry.
      Specified by:
      stream in interface Registry<T extends Enum<T> & Keyed>
      Returns:
      a stream of all registry items
    • iterator

      @NotNull public Iterator<T> iterator()
      Specified by:
      iterator in interface Iterable<T extends Enum<T> & Keyed>