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 Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final it.unimi.dsi.fastutil.objects.ObjectArrayList<T>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    byId(@org.checkerframework.checker.index.qual.NonNegative int id)
    Looks up a registry entry by its ID.
    int
    byValue(T value)
    Reverse looks-up an object to return its network ID, or -1.
    void
    reset(List<T> values)
    Resets the objects by these IDs.
    All values of this registry, as a list.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • values

      protected final it.unimi.dsi.fastutil.objects.ObjectArrayList<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>
    • 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>
    • reset

      public void reset(List<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>