Interface ComponentFactory<K,C extends Component<K>>

Type Parameters:
K - the key type
C - the component type
All Superinterfaces:
Keyed<K>
All Known Subinterfaces:
SingleTypeComponentFactory<K,C>

public interface ComponentFactory<K,C extends Component<K>> extends Keyed<K>
Interface for Component factories.
Since:
1.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    create(K key)
    Creates the Component associated with the supplied key.
    default Set<C>
    Creates all Components supported by this factory.
    Get all keys that are supported by this factory.
    default boolean
    has(K key)
    Checks if this factory supports the supplied key.
  • Method Details

    • has

      default boolean has(K key)
      Checks if this factory supports the supplied key.
      Parameters:
      key - the key
      Returns:
      if this factory supports the key.
    • createAll

      default Set<C> createAll()
      Creates all Components supported by this factory.
      Returns:
      the components
    • getKeys

      Set<K> getKeys()
      Get all keys that are supported by this factory.
      Specified by:
      getKeys in interface Keyed<K>
      Returns:
      the keys
    • create

      C create(K key)
      Creates the Component associated with the supplied key. Whether this method will always return the same instance or a fresh instance for each call is implementation dependent.
      Parameters:
      key - the key
      Returns:
      the Component