Package org.togglz.core.activation
Class ParameterBuilder
java.lang.Object
org.togglz.core.activation.ParameterBuilder
- All Implemented Interfaces:
Parameter
Fluent API for creating
Parameter
instances.- Author:
- Christian Kaltepoth
-
Method Summary
Modifier and TypeMethodDescriptionstatic ParameterBuilder
Creates a new builder for a parameter with the given name.description
(String description) Sets an optional description for the parameter displayed in the admin console.An optional description of the parameter.getLabel()
A human readable label that describes the parameter.getName()
The name of the parameter.boolean
Returnstrue
if the parameter value is typically large so that it should be displayed with an textarea instead of a simple text input field.boolean
Returnstrue
if the parameter is optional.boolean
This method allows to implement custom validation logic for the parameter.A custom human readable label for the parameter.Specifies that the parameter typically has large texts as a valueSets a regular expression that must match for parameter values to be considered as valid.optional()
Configures the parameter to be optional.
-
Method Details
-
create
Creates a new builder for a parameter with the given name. The name is used to store and retrieve the parameter from theFeatureState
. -
label
A custom human readable label for the parameter. If no custom label is set, the builder will use the name of the parameter as a label. -
matching
Sets a regular expression that must match for parameter values to be considered as valid. -
optional
Configures the parameter to be optional. -
largeText
Specifies that the parameter typically has large texts as a value -
description
Sets an optional description for the parameter displayed in the admin console. -
getName
Description copied from interface:Parameter
The name of the parameter. This name is used to store and retrieve the parameter from theFeatureState
. -
getLabel
Description copied from interface:Parameter
A human readable label that describes the parameter. -
isValid
Description copied from interface:Parameter
This method allows to implement custom validation logic for the parameter. -
isOptional
public boolean isOptional()Description copied from interface:Parameter
Returnstrue
if the parameter is optional.- Specified by:
isOptional
in interfaceParameter
-
isLargeText
public boolean isLargeText()Description copied from interface:Parameter
Returnstrue
if the parameter value is typically large so that it should be displayed with an textarea instead of a simple text input field.- Specified by:
isLargeText
in interfaceParameter
-
getDescription
Description copied from interface:Parameter
An optional description of the parameter. Can returnnull
, if no description exists.- Specified by:
getDescription
in interfaceParameter
-