Class ParameterDescriptor

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

public final class ParameterDescriptor extends Object
The Description of a parameter including the name and an input validator.
  • Field Details

    • NO_PARAMETER

      public static final ParameterDescriptor NO_PARAMETER
      The NO PARAMETER instance.
  • Constructor Details

    • ParameterDescriptor

      @Deprecated public ParameterDescriptor(String name, boolean required, List<String> values)
      Deprecated.
      use builder(String) and fluent builder.
      Constructor.
      Parameters:
      name - the name of the parameter
      required - the required flag.
      values - the valid values
  • Method Details

    • builder

      public static ParameterDescriptor.Builder builder(String name)
      Create a builder for a ParameterDescriptor.
      Parameters:
      name - the name of the parameter.
      Returns:
      the Builder.
    • getName

      public String getName()
      Gets the parameter name.
      Returns:
      the parameter name.
    • hasValidator

      public boolean hasValidator()
      Determines if a validator is available.
      Returns:
      true if a validator is available.
    • example

      public String example()
      Creates an example for the described parameter.
      Returns:
      the example string.
    • getValidatorHelp

      public String getValidatorHelp()
      Gets the validator help text.
      Returns:
      the validator help text or an empty string if no validator is available.
    • isRequired

      public boolean isRequired()
      Gets the required flag.
      Returns:
      true if the parameter is required.
    • getDescription

      public String getDescription()
      Gets the description of this parameter
      Returns:
      the description of this parameter or an empty string if no description was provided.
    • validValues

      public String validValues()
      Gets the valid values for this parameter.
      Returns:
      the description of the valid values.
    • toString

      public String toString()
      Gets the validator description.
      Overrides:
      toString in class Object
      Returns:
      the validator description.
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • validate

      public void validate(String variable, String template, String value)
      Validates that the template contains a proper value.
      Parameters:
      variable - the variable name from the configuration.
      template - the template that is being validated.
      value - the value for this parameter.