B
- The type of Component containedpublic class Component<B> extends Object
Constructor and Description |
---|
Component(Configuration config,
String name,
Function<Configuration,? extends B> builderFunction)
Creates a component for the given
config with given name created by the given
builderFunction . |
Component(Supplier<Configuration> config,
String name,
Function<Configuration,? extends B> builderFunction)
Creates a component for the given
config with given name created by the given
builderFunction . |
Modifier and Type | Method and Description |
---|---|
B |
get()
Retrieves the object contained in this component, triggering the builder function if the component hasn't been
built yet.
|
void |
update(Function<Configuration,? extends B> builderFunction)
Updates the builder function for this component.
|
public Component(Configuration config, String name, Function<Configuration,? extends B> builderFunction)
config
with given name
created by the given
builderFunction
. Then the Configuration is not initialized yet, consider using
Component(Supplier, String, Function)
instead.config
- The Configuration the component is part ofname
- The name of the componentbuilderFunction
- The builder function of the componentpublic Component(Supplier<Configuration> config, String name, Function<Configuration,? extends B> builderFunction)
config
with given name
created by the given
builderFunction
.config
- The supplier function of the configurationname
- The name of the componentbuilderFunction
- The builder function of the componentpublic B get()
public void update(Function<Configuration,? extends B> builderFunction)
builderFunction
- The new builder function for the componentIllegalStateException
- when the component has already been retrieved using get()
.Copyright © 2010–2018. All rights reserved.