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

  • Type Parameters:
    C - the component type
    K - the key 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 Detail

      • 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