Class MapTemplate.Builder

java.lang.Object
io.github.projectunified.maptemplate.MapTemplate.Builder
Enclosing class:
MapTemplate

public static class MapTemplate.Builder extends Object
A fluent builder for creating MapTemplate.Options and MapTemplate instances.
  • Method Details

    • setStartVariable

      public MapTemplate.Builder setStartVariable(String startVariable)
      Sets the start marker for variables.
      Parameters:
      startVariable - the start marker
      Returns:
      this builder
    • setEndVariable

      public MapTemplate.Builder setEndVariable(String endVariable)
      Sets the end marker for variables.
      Parameters:
      endVariable - the end marker
      Returns:
      this builder
    • setEscapeChar

      public MapTemplate.Builder setEscapeChar(String escapeChar)
      Sets the escape character for markers.
      Parameters:
      escapeChar - the escape character
      Returns:
      this builder
    • setVariableFunction

      public MapTemplate.Builder setVariableFunction(Function<String,Object> variableFunction)
      Sets the function used to resolve variable values.
      Parameters:
      variableFunction - the variable resolution function
      Returns:
      this builder
    • setVariableMap

      public MapTemplate.Builder setVariableMap(Map<String,Object> variableMap)
      Sets the map of variables to be used for resolution. This is a convenience method that delegates to setVariableFunction(Function).
      Parameters:
      variableMap - the map of variable names to their values
      Returns:
      this builder
    • build

      public MapTemplate build()
      Builds the MapTemplate instance with the configured options.
      Returns:
      a new MapTemplate