Class TemplateVariable

java.lang.Object
io.aiven.commons.kafka.connector.common.templating.TemplateVariable

public final class TemplateVariable extends Object
The template variable definition.
  • Field Details

    • KEY

      public static final TemplateVariable KEY
      The standard key definition
    • TOPIC

      public static final TemplateVariable TOPIC
      the standard topic definition
    • PARTITION

      public static final TemplateVariable PARTITION
      the standard partition definition
    • START_OFFSET

      public static final TemplateVariable START_OFFSET
      the standard start offset definition
    • TIMESTAMP

      public static final TemplateVariable TIMESTAMP
      The standard timestamp definition
  • Method Details

    • description

      public String description()
      Gets the description of this TemplateVariable.
      Returns:
      the description of this template variable.
    • example

      public String example()
      Generates an example of this variable.
      Returns:
      the example text for this variable.
    • builder

      public static TemplateVariable.Builder builder(String name)
      Gets the builder for TemplateVariables.
      Parameters:
      name - name of the variable being built.
      Returns:
      the Builder.
    • getName

      public String getName()
      Gets the name of the variable.
      Returns:
      the name of the variable.
    • hasParameter

      public boolean hasParameter()
      Determines if there is a parameter descriptor.
      Returns:
      true if there is a descriptor.
    • getParameterDescriptor

      public ParameterDescriptor getParameterDescriptor()
      Gets the parameter descriptor for this variable.
      Returns:
      the parameter descriptor.
    • validate

      public void validate(String errStr, String template, Parameter parameter)
      Validate the parameter against the template variable.
      Parameters:
      errStr - the error string for this template.
      template - the template the parameter was parsed from.
      parameter - The parsed parameter