Class MapTemplate.Builder
java.lang.Object
io.github.projectunified.maptemplate.MapTemplate.Builder
- Enclosing class:
MapTemplate
A fluent builder for creating
MapTemplate.Options and MapTemplate instances.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds theMapTemplateinstance with the configured options.setEndVariable(String endVariable) Sets the end marker for variables.setEscapeChar(String escapeChar) Sets the escape character for markers.setStartVariable(String startVariable) Sets the start marker for variables.setVariableFunction(Function<String, Object> variableFunction) Sets the function used to resolve variable values.setVariableMap(Map<String, Object> variableMap) Sets the map of variables to be used for resolution.
-
Method Details
-
setStartVariable
Sets the start marker for variables.- Parameters:
startVariable- the start marker- Returns:
- this builder
-
setEndVariable
Sets the end marker for variables.- Parameters:
endVariable- the end marker- Returns:
- this builder
-
setEscapeChar
Sets the escape character for markers.- Parameters:
escapeChar- the escape character- Returns:
- this builder
-
setVariableFunction
Sets the function used to resolve variable values.- Parameters:
variableFunction- the variable resolution function- Returns:
- this builder
-
setVariableMap
Sets the map of variables to be used for resolution. This is a convenience method that delegates tosetVariableFunction(Function).- Parameters:
variableMap- the map of variable names to their values- Returns:
- this builder
-
build
Builds theMapTemplateinstance with the configured options.- Returns:
- a new MapTemplate
-