Interface Registry<E extends Registry.Entry>

All Known Subinterfaces:
Registry.Mutable<E>

public interface Registry<E extends Registry.Entry>
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
     
    static interface 
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the default value of the registry.
    @NotNull Collection<E>
    Gets a collection of all entries.
    get(int id)
    Gets an entry by its id.
    default E
    get(@NotNull String key)
    Gets an entry by its key.
    get(@NotNull String key, E def)
    Gets an entry by its key.
    default E
    get(@NotNull Key key)
    Gets an entry by its key.
    @NotNull String
    Gets the type key of the registry.
  • Method Details

    • type

      @NotNull @NotNull String type()
      Gets the type key of the registry.
      Returns:
      the type key of the registry
      Since:
      1.0.0
    • get

      E get(@NotNull @NotNull String key, E def)
      Gets an entry by its key.
      Parameters:
      key - the key of the entry
      def - the default what will be returned if nothing is found
      Returns:
      the entry or a default value
      Since:
      1.0.0
    • get

      @NotNull default E get(@NotNull @NotNull String key)
      Gets an entry by its key.
      Parameters:
      key - the key of the entry
      Returns:
      the entry or a default value
      Since:
      1.0.0
    • get

      @NotNull default E get(@NotNull @NotNull Key key)
      Gets an entry by its key.
      Parameters:
      key - the key of the entry
      Returns:
      the entry or a default value
      Since:
      1.0.0
    • get

      E get(int id)
      Gets an entry by its id.
      Parameters:
      id - the id of the entry
      Returns:
      the entry or a default value
      Since:
      1.0.0
    • entries

      @NotNull @NotNull Collection<E> entries()
      Gets a collection of all entries.
      Returns:
      the collection of all entries
      Since:
      1.0.0
    • defaultValue

      @NotNull E defaultValue()
      Returns the default value of the registry.
      Returns:
      the default value