Package org.openhab.core.config.core
Class ConfigDescriptionParameterBuilder
java.lang.Object
org.openhab.core.config.core.ConfigDescriptionParameterBuilder
The
ConfigDescriptionParameterBuilder
class provides a builder for the ConfigDescriptionParameter
class.- Author:
- Chris Jackson - Initial contribution, Thomas Höfer - Added unit
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a result with the settings of this builder.create
(String name, ConfigDescriptionParameter.Type type) Creates a parameter builderwithAdvanced
(Boolean advanced) Set the configuration parameter as an advanced parameterwithContext
(String context) Set the context of the configuration parameterwithDefault
(String defaultValue) Set the default value of the configuration parameterwithDescription
(String description) Set the description of the configuration parameterwithFilterCriteria
(List<FilterCriteria> filterCriteria) Set the filter criteria of the configuration parameterwithGroupName
(String groupName) Set the configuration parameter to be limited to the values in the options listSet the label of the configuration parameterwithLimitToOptions
(Boolean limitToOptions) Set the configuration parameter to be limited to the values in the options listwithMaximum
(BigDecimal max) Set the maximum value of the configuration parameterwithMinimum
(BigDecimal min) Set the minimum value of the configuration parameterwithMultiple
(Boolean multiple) Set the configuration parameter to allow multiple selectionwithMultipleLimit
(Integer multipleLimit) Set the configuration parameter to allow multiple selectionwithOptions
(List<ParameterOption> options) Set the options of the configuration parameterwithPattern
(String pattern) Set the pattern of the configuration parameterwithReadOnly
(Boolean readOnly) Set the configuration parameter as read onlywithRequired
(Boolean required) Set the configuration parameter to be requiredwithStepSize
(BigDecimal step) Set the step size of the configuration parameterSets the unit of the configuration parameter.withUnitLabel
(String unitLabel) Sets the unit label of the configuration parameter.withVerify
(Boolean verify) Set the configuration parameter as a verifyable parameter
-
Method Details
-
create
public static ConfigDescriptionParameterBuilder create(String name, ConfigDescriptionParameter.Type type) Creates a parameter builder- Parameters:
name
- configuration parameter nametype
- configuration parameter type- Returns:
- parameter builder
-
withMinimum
Set the minimum value of the configuration parameter- Parameters:
min
- the min value of theConfigDescriptionParameter
- Returns:
- the updated builder instance
-
withMaximum
Set the maximum value of the configuration parameter- Parameters:
max
- the max value of theConfigDescriptionParameter
- Returns:
- the updated builder instance
-
withStepSize
Set the step size of the configuration parameter- Parameters:
step
- the step of theConfigDescriptionParameter
- Returns:
- the updated builder instance
-
withPattern
Set the pattern of the configuration parameter- Parameters:
pattern
- the pattern for theConfigDescriptionParameter
- Returns:
- the updated builder instance
-
withReadOnly
Set the configuration parameter as read only- Parameters:
readOnly
-true
to make the parameter read only- Returns:
- the updated builder instance
-
withMultiple
Set the configuration parameter to allow multiple selection- Parameters:
multiple
-true
for multiple selection- Returns:
- the updated builder instance
-
withMultipleLimit
Set the configuration parameter to allow multiple selection- Parameters:
multipleLimit
- the parameters limit- Returns:
- the updated builder instance
-
withContext
Set the context of the configuration parameter- Parameters:
context
- the context for this parameter- Returns:
- the updated builder instance
-
withRequired
Set the configuration parameter to be required- Parameters:
required
-true
if the parameter is required- Returns:
- the updated builder instance
-
withDefault
Set the default value of the configuration parameter- Parameters:
defaultValue
- the default value of the configuration parameter- Returns:
- the updated builder instance
-
withLabel
Set the label of the configuration parameter- Parameters:
label
- a short user friendly description- Returns:
- the updated builder instance
-
withDescription
Set the description of the configuration parameter- Parameters:
description
- a detailed user friendly description- Returns:
- the updated builder instance
-
withOptions
Set the options of the configuration parameter- Parameters:
options
- the options for this parameter- Returns:
- the updated builder instance
-
withAdvanced
Set the configuration parameter as an advanced parameter- Parameters:
advanced
-true
to make the parameter advanced- Returns:
- the updated builder instance
-
withVerify
Set the configuration parameter as a verifyable parameter- Parameters:
verify
- flag
-
withLimitToOptions
Set the configuration parameter to be limited to the values in the options list- Parameters:
limitToOptions
-true
if only the declared options are acceptable- Returns:
- the updated builder instance
-
withGroupName
Set the configuration parameter to be limited to the values in the options list- Parameters:
groupName
- the group name of this config description parameter- Returns:
- the updated builder instance
-
withFilterCriteria
Set the filter criteria of the configuration parameter- Parameters:
filterCriteria
- the filter criteria- Returns:
- the updated builder instance
-
withUnit
Sets the unit of the configuration parameter.- Parameters:
unit
- the unit to be set- Returns:
- the updated builder instance
-
withUnitLabel
Sets the unit label of the configuration parameter.- Parameters:
unitLabel
- the unit label to be set- Returns:
- the updated builder instance
-
build
Builds a result with the settings of this builder.- Returns:
- the desired result
- Throws:
IllegalArgumentException
-