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

  • Type Parameters:
    K - the component key
    C - the component type
    All Superinterfaces:
    ComponentFactory<K,​C>, Keyed<K>

    public interface SingleTypeComponentFactory<K,​C extends Component<K>>
    extends ComponentFactory<K,​C>
    Convenience interface for a ComponentFactory that supports only a single key.
    Since:
    1.0.0
    • Method Detail

      • create

        C create()
        Creates the single Component supported by this factory. Whether this method will always return the same instance or a fresh instance for each call is implementation dependent.
        Returns:
        the component
      • getKey

        K getKey()
        Gets the single key supported by this factory.
        Returns:
        the key
      • has

        default boolean has​(K key)
        Checks if the key is the key supported by this factory.
        Specified by:
        has in interface ComponentFactory<K,​C extends Component<K>>
        Parameters:
        key - the key
        Returns:
        if the key is the key supported