Interface JavaRegistry<T>

Type Parameters:
T - the type of this registry
All Superinterfaces:
Iterable<T>, JavaRegistryLookup<T>
All Known Subinterfaces:
MutableJavaRegistry<T>
All Known Implementing Classes:
SimpleJavaRegistry

public interface JavaRegistry<T> extends JavaRegistryLookup<T>, Iterable<T>
Extends JavaRegistryLookup with methods to iterate over a registry's contents.

This interface extends Iterable, making it usable in for-loops and with Iterable.forEach(Consumer). The iterator provided by instances is sorted by network ID.

See Also:
  • Method Details

    • keys

      Collection<net.kyori.adventure.key.Key> keys()
      Returns a collection of all keys in this registry.

      Note that this collection may not necessarily be sorted by network ID.

      Returns:
      a collection of all keys in this registry
    • isEmpty

      default boolean isEmpty()
      Returns:
      true if this registry is empty
    • size

      int size()
      Returns:
      the amount of entries in this registry
    • forEachEntry

      void forEachEntry(Consumer<RegistryEntryData<T>> action)
      Iterates action for each RegistryEntryData of this registry.

      The action is executed in order of network ID.

      Parameters:
      action - the action to execute for each RegistryEntryData
    • spliterator

      default Spliterator<T> spliterator()
      Specified by:
      spliterator in interface Iterable<T>
    • stream

      default Stream<T> stream()
      Returns:
      a stream iterating over all the entries in this registry, sorted by network ID
    • parallelStream

      default Stream<T> parallelStream()
      Returns:
      a parallel stream iterating over all the entries in this registry, sorted by network ID