Interface Registry<T extends Nameable,V>

Type Parameters:
T - Type of Nameable
V - Type of stored entries
All Known Subinterfaces:
SchematicRegistry, StorageRegistry

public interface Registry<T extends Nameable,V>
Interface which represents the base for a registry, which holds values associated with a Nameable key.
  • Method Summary

    Modifier and Type
    Method
    Description
    get(T key)
    Returns the value associated with this key
    boolean
    Checks if an entry with this key is registered
    void
    register(T key, V entry)
    Registers an enty with this key
    Get a map of the registered entries
    void
    Unregisters any value associated with this key.
  • Method Details

    • register

      void register(T key, V entry)
      Registers an enty with this key
      Parameters:
      key - key
      entry - entry
      Throws:
      AlreadyRegisteredException - When an entry with this key is already present.
    • unregister

      void unregister(T key)
      Unregisters any value associated with this key.
      Parameters:
      key - key
    • get

      V get(T key)
      Returns the value associated with this key
      Parameters:
      key - key
      Returns:
      value
      Throws:
      IllegalArgumentException - if no entry is registered with this key.
    • isRegistered

      boolean isRegistered(T key)
      Checks if an entry with this key is registered
      Parameters:
      key - key
      Returns:
      true if registered
    • registry

      Map<T,V> registry()
      Get a map of the registered entries
      Returns:
      unmodifiable map