Class VariableTemplatePart
java.lang.Object
io.aiven.commons.kafka.connector.common.templating.VariableTemplatePart
- All Implemented Interfaces:
TemplatePart
A template part tht contains a variable definition.
-
Method Summary
Modifier and TypeMethodDescriptionExtracts the original template string from the rendered text.final StringReturns the original placeholder for the template.final ParameterReturns the associated parameter.final StringReturns the variable name.final booleanDetermines if this variable template has a parameter associated.Renders the template part using the bindings as necessary.
-
Method Details
-
getVariableName
Returns the variable name.- Returns:
- the variable name.
-
hasParameter
public final boolean hasParameter()Determines if this variable template has a parameter associated.- Returns:
trueif a parameter is available.
-
getParameter
Returns the associated parameter.- Returns:
- the associated parameter. Will return
Parameter.EMPTYif there is no parameter.
-
getOriginalPlaceholder
Returns the original placeholder for the template. This is the variable pattern with the enclosing curly braces.- Returns:
- the original placeholder.
-
render
Description copied from interface:TemplatePartRenders the template part using the bindings as necessary.- Specified by:
renderin interfaceTemplatePart- Parameters:
bindings- the binding to map parameters with.- Returns:
- the rendered string.
-
extract
Description copied from interface:TemplatePartExtracts the original template string from the rendered text.- Specified by:
extractin interfaceTemplatePart- Parameters:
captureGroups- the capture group to use for extraction.- Returns:
- the original string for this template.
-