Class Template.BoundBuilder
java.lang.Object
io.aiven.commons.kafka.connector.common.templating.Template.BoundBuilder
- Enclosing class:
Template
A builder for Template.Bound instances.
-
Method Summary
Modifier and TypeMethodDescriptionadd(Template.Bound bound) Adds all the bindings from the Template.Bound to this builder.add(Template.BoundBuilder builder) Adds all the bindings from the builder to this builder.bind(TemplateVariable variable, String value) Bind the variable to the supplier of string.bind(TemplateVariable variable, Function<Parameter, String> binding) Bind the variable to the supplier of string.Bind the variable to the supplier of string.Bind the variable to a function to convert a parameter to a string.build()Builds the bound template.\ Gets a set of all the variable names in the bind builder.
-
Method Details
-
add
Adds all the bindings from the builder to this builder. Will overwrite any bindings with the same name.- Parameters:
builder- the builder to copy bindings from.- Returns:
- this.
-
add
Adds all the bindings from the Template.Bound to this builder.- Parameters:
bound- the Template.Bound to copy from.- Returns:
- this
-
bind
Bind the variable to the supplier of string.- Parameters:
name- the name to bind.value- the value.- Returns:
- this
- Throws:
IllegalArgumentException- if the variable is not in the template.
-
bind
Bind the variable to the supplier of string.- Parameters:
variable- the name to bind.value- the value- Returns:
- this
- Throws:
IllegalArgumentException- if the variable is not in the template.
-
bind
Bind the variable to the supplier of string.- Parameters:
variable- the name to bind.binding- the parameter binding.- Returns:
- this
- Throws:
IllegalArgumentException- if the variable is not in the template.
-
bind
Bind the variable to a function to convert a parameter to a string.- Parameters:
name- the name to bind.binding- the function to bind.- Returns:
- this
- Throws:
IllegalArgumentException- if the variable is not in the template.
-
build
Builds the bound template. Will log any missing bindings.- Returns:
- the bound template.
-
getVariableNames
\ Gets a set of all the variable names in the bind builder.- Returns:
- the set of variable names.
-