Class ParameterDescriptor
java.lang.Object
io.aiven.commons.kafka.connector.common.templating.ParameterDescriptor
The Description of a parameter including the name and an input validator.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe builder for a ParameterDescriptor. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionParameterDescriptor(String name, boolean required, List<String> values) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionstatic ParameterDescriptor.BuilderCreate a builder for a ParameterDescriptor.booleanexample()Creates an example for the described parameter.Gets the description of this parametergetName()Gets the parameter name.Gets the validator help text.inthashCode()booleanDetermines if a validator is available.booleanGets the required flag.toString()Gets the validator description.voidValidates that the template contains a proper value.Gets the valid values for this parameter.
-
Field Details
-
NO_PARAMETER
The NO PARAMETER instance.
-
-
Constructor Details
-
ParameterDescriptor
Deprecated.usebuilder(String)and fluent builder.Constructor.- Parameters:
name- the name of the parameterrequired- the required flag.values- the valid values
-
-
Method Details
-
builder
Create a builder for a ParameterDescriptor.- Parameters:
name- the name of the parameter.- Returns:
- the Builder.
-
getName
Gets the parameter name.- Returns:
- the parameter name.
-
hasValidator
public boolean hasValidator()Determines if a validator is available.- Returns:
trueif a validator is available.
-
example
Creates an example for the described parameter.- Returns:
- the example 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:
trueif the parameter is required.
-
getDescription
Gets the description of this parameter- Returns:
- the description of this parameter or an empty string if no description was provided.
-
validValues
Gets the valid values for this parameter.- Returns:
- the description of the valid values.
-
toString
Gets the validator description. -
equals
-
hashCode
public int hashCode() -
validate
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.
-
builder(String)and fluent builder.