Class Template
java.lang.Object
io.aiven.commons.kafka.connector.common.templating.Template
A parsed template string.
A template string is a string that has zero or more TemplateVariables defined. For
example "This is the key {{ key }}, and this is the partition {{ partition:padding=true }}". To
construct a Template use the TemplateParser
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classA Template with bindings for the variables.classA builder for Template.Bound instances.final classGiven a template, theTemplate.Extractorfinds the matching variables from a string. -
Method Summary
Modifier and TypeMethodDescriptionCreates a bound builder.Creates an extractor to parse variable values back from the rendered string.static TemplateDeprecated.Return the original template pattern.toString()Creates a new list of variable names.Creates a new set of variable names.Gets a list of variable names to parameters where the parameters are known to be non empty.Gets a list of variable names to parameters.
-
Method Details
-
originalTemplate
Return the original template pattern.- Returns:
- the template pattern.
-
variables
Creates a new list of variable names.- Returns:
- A new list of variable names.
-
variablesSet
Creates a new set of variable names.- Returns:
- A new set of variable names.
-
variablesWithParameters
Gets a list of variable names to parameters. If duplicate variables appeared in the template there will be duplicates in the list.- Returns:
- the list of variable names to parameters.
-
variablesWithNonEmptyParameters
Gets a list of variable names to parameters where the parameters are known to be non empty. If duplicate variables appeared in the template there will be duplicates in the list.- Returns:
- the list of variable names to parameters.
-
boundBuilder
Creates a bound builder.- Returns:
- a new BoundBuilder based on this template.
-
extractor
Creates an extractor to parse variable values back from the rendered string.- Returns:
- a new Extractor.
-
of
Deprecated.Creates a template from a template string.- Parameters:
template- the template string.- Returns:
- the parsed template.
-
toString
-
TemplateParser.parse(String, TemplateVariableRegistry)