Class Template.BoundBuilder

java.lang.Object
io.aiven.commons.kafka.connector.common.templating.Template.BoundBuilder
Enclosing class:
Template

public class Template.BoundBuilder extends Object
A builder for Template.Bound instances.
  • 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

      public Template.BoundBuilder bind(String name, Supplier<String> binding)
      Bind the variable to the supplier of string.
      Parameters:
      name - the name to bind.
      binding - the binding.
      Returns:
      this
      Throws:
      IllegalArgumentException - if the variable is not in the template.
    • bind

      public Template.BoundBuilder bind(String name, Function<Parameter,String> binding)
      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

      public Template.Bound build()
      Builds the bound template. Will log any missing bindings.
      Returns:
      the bound template.