Package org.n52.janmayen.component
Interface SingleTypeComponentFactory<K,C extends Component<K>>
- Type Parameters:
K- the component keyC- the component type
- All Superinterfaces:
ComponentFactory<K,,C> Keyed<K>
Convenience interface for a
ComponentFactory that supports only a single key.- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptioncreate()Creates the singleComponentsupported by this factory.default CCreates theComponentassociated with the suppliedkey.Creates a singleton set of theComponentsupported by this factory.getKey()Gets the single key supported by this factory.getKeys()Creates a singleton set of the key supported by this factory.default booleanChecks if thekeyis the key supported by this factory.
-
Method Details
-
create
C create()Creates the singleComponentsupported 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
-
create
Creates theComponentassociated with the suppliedkey. Whether this method will always return the same instance or a fresh instance for each call is implementation dependent.- Specified by:
createin interfaceComponentFactory<K,C extends Component<K>> - Parameters:
key- the key- Returns:
- the
Component - Throws:
IllegalArgumentException- ifkeydoes not equal the key of this factory.
-
createAll
Creates a singleton set of theComponentsupported by this factory. -
getKey
K getKey()Gets the single key supported by this factory.- Returns:
- the key
-
getKeys
Creates a singleton set of the key supported by this factory. -
has
Checks if thekeyis the key supported by this factory.
-