Interface Registry<T>

Type Parameters:
T - Generic type argument

public interface Registry<T>
Simple registry interface
  • Method Details

    • register

      void register(@NonNull Key key, @NonNull T value)
      Register a new entry with the provided key and value
      Parameters:
      key - key
      value - value
      Throws:
      IllegalArgumentException - when there is already an entry for the provided key
    • unregister

      void unregister(@NonNull Key key)
      Unregister the entry for the provided key if present
      Parameters:
      key - key
      Throws:
      IllegalArgumentException - when there is no entry for the provided key
    • hasEntry

      boolean hasEntry(@NonNull Key key)
      Check whether an entry is present for the provided key
      Parameters:
      key - key
      Returns:
      whether an entry is present
    • get

      @NonNull T get(@NonNull Key key)
      Get the registered value for a key
      Parameters:
      key - key
      Returns:
      value
      Throws:
      IllegalArgumentException - when there is no value for the provided key
    • entries

      @NonNull Iterable<Pair<Key,T>> entries()
      Get the registered entries
      Returns:
      the registered entries