Class SimpleJavaRegistry<T>

java.lang.Object
org.geysermc.geyser.session.cache.registry.SimpleJavaRegistry<T>
All Implemented Interfaces:
JavaRegistry<T>

public class SimpleJavaRegistry<T> extends Object implements JavaRegistry<T>
  • Field Details

    • values

      protected final it.unimi.dsi.fastutil.objects.ObjectArrayList<RegistryEntryData<T>> values
  • Constructor Details

    • SimpleJavaRegistry

      public SimpleJavaRegistry()
  • Method Details

    • byId

      public T byId(@org.checkerframework.checker.index.qual.NonNegative int id)
      Description copied from interface: JavaRegistry
      Looks up a registry entry by its ID. The object can be null, or not present.
      Specified by:
      byId in interface JavaRegistry<T>
    • byKey

      public T byKey(net.kyori.adventure.key.Key key)
      Description copied from interface: JavaRegistry
      Looks up a registry entry by its key. The object can be null, or not present.
      Specified by:
      byKey in interface JavaRegistry<T>
    • entryById

      public RegistryEntryData<T> entryById(@org.checkerframework.checker.index.qual.NonNegative int id)
      Description copied from interface: JavaRegistry
      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.
      Specified by:
      entryById in interface JavaRegistry<T>
    • byValue

      public int byValue(T value)
      Description copied from interface: JavaRegistry
      Reverse looks-up an object to return its network ID, or -1.
      Specified by:
      byValue in interface JavaRegistry<T>
    • entryByValue

      public RegistryEntryData<T> entryByValue(T value)
      Description copied from interface: JavaRegistry
      Reverse looks-up an object to return it wrapped in RegistryEntryData, or null.
      Specified by:
      entryByValue in interface JavaRegistry<T>
    • reset

      public void reset(List<RegistryEntryData<T>> values)
      Description copied from interface: JavaRegistry
      Resets the objects by these IDs.
      Specified by:
      reset in interface JavaRegistry<T>
    • values

      public List<T> values()
      Description copied from interface: JavaRegistry
      All values of this registry, as a list.
      Specified by:
      values in interface JavaRegistry<T>
    • toString

      public String toString()
      Overrides:
      toString in class Object