Package io.vertigo.core.node.config
Class NodeConfigBuilder
- java.lang.Object
-
- io.vertigo.core.node.config.NodeConfigBuilder
-
- All Implemented Interfaces:
Builder<NodeConfig>
public final class NodeConfigBuilder extends Object implements Builder<NodeConfig>
The NodeConfigBuilder builder allows you to create an NodeConfig using a fluent, simple style .- Author:
- npiedeloup, pchretien
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NodeConfigBuilder
addInitializer(Class<? extends ComponentInitializer> componentInitializerClass)
Adds an initializer to the current config.NodeConfigBuilder
addModule(ModuleConfig moduleConfig)
Adds a a moduleConfig.NodeConfig
build()
Builds the nodeConfig.NodeConfigBuilder
withAppName(String appName)
Associate a common name that define the application as a whole.NodeConfigBuilder
withBoot(BootConfig bootConfig)
Opens the bootConfigBuilder.NodeConfigBuilder
withEndPoint(String endPoint)
Associate an optional endPoint to reach the current node.NodeConfigBuilder
withNodeId(String nodeId)
Associate an id to the current node (random UUID by default)
-
-
-
Method Detail
-
withBoot
public NodeConfigBuilder withBoot(BootConfig bootConfig)
Opens the bootConfigBuilder. There is exactly one BootConfig per NodeConfig.- Returns:
- this builder
-
withAppName
public NodeConfigBuilder withAppName(String appName)
Associate a common name that define the application as a whole. (ex: Facebook, Pharos...) (myApp by default)- Parameters:
appName
- the node name- Returns:
- this builder
-
withNodeId
public NodeConfigBuilder withNodeId(String nodeId)
Associate an id to the current node (random UUID by default)- Parameters:
nodeId
- the node id- Returns:
- this builder
-
withEndPoint
public NodeConfigBuilder withEndPoint(String endPoint)
Associate an optional endPoint to reach the current node.- Parameters:
endPoint
- the endPoint to reach the node (protocol:port//host)- Returns:
- this builder
-
addInitializer
public NodeConfigBuilder addInitializer(Class<? extends ComponentInitializer> componentInitializerClass)
Adds an initializer to the current config.- Parameters:
componentInitializerClass
- Class of the initializer- Returns:
- this builder
-
addModule
public NodeConfigBuilder addModule(ModuleConfig moduleConfig)
Adds a a moduleConfig.- Parameters:
moduleConfig
- the moduleConfig- Returns:
- this builder
-
build
public NodeConfig build()
Builds the nodeConfig.- Specified by:
build
in interfaceBuilder<NodeConfig>
- Returns:
- nodeConfig.
-
-