Package org.openhab.core.types
Class StateDescriptionFragmentBuilder
java.lang.Object
org.openhab.core.types.StateDescriptionFragmentBuilder
Builds a
StateDescriptionFragment with the relevant parts only.- Author:
- Henning Treu - Initial contribution
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds aStateDescriptionFragmentfrom the values of this builder.create()Creates and returns a fresh builder instance.create(StateDescription legacy) Creates a builder instance and initializes all fields from the givenStateDescription.create(StateDescriptionFragment fragment) Creates a builder instance and initializes all fields from the givenStateDescriptionFragment.withMaximum(BigDecimal maximum) Set the maximum for the resultingStateDescriptionFragment.withMinimum(BigDecimal minimum) Set the minimum for the resultingStateDescriptionFragment.withOption(StateOption option) Ass aStateOptionfor the resultingStateDescriptionFragment.withOptions(List<StateOption> options) Set theStateOptions for the resultingStateDescriptionFragment.withPattern(String pattern) Set the pattern for the resultingStateDescriptionFragment.withReadOnly(Boolean readOnly) Set readOnly for the resultingStateDescriptionFragment.withStep(BigDecimal step) Set the step for the resultingStateDescriptionFragment.
-
Method Details
-
create
Creates and returns a fresh builder instance.- Returns:
- a fresh
StateDescriptionFragmentBuilderinstance.
-
create
Creates a builder instance and initializes all fields from the givenStateDescriptionFragment. Note: State options will only be taken into account if the list is not empty.- Parameters:
fragment- theStateDescriptionFragmentthis builder be initialized from.- Returns:
- the builder.
-
create
Creates a builder instance and initializes all fields from the givenStateDescription. Note: State options will only be taken into account if the list is not empty.- Parameters:
legacy- theStateDescriptionthis builder be initialized from.- Returns:
- the builder.
-
build
Builds aStateDescriptionFragmentfrom the values of this builder.- Returns:
- a
StateDescriptionFragmentfrom the values of this builder.
-
withMaximum
Set the maximum for the resultingStateDescriptionFragment.- Parameters:
maximum- the maximum for the resultingStateDescriptionFragment.- Returns:
- this builder.
-
withMinimum
Set the minimum for the resultingStateDescriptionFragment.- Parameters:
minimum- the minimum for the resultingStateDescriptionFragment.- Returns:
- this builder.
-
withStep
Set the step for the resultingStateDescriptionFragment.- Parameters:
step- the step for the resultingStateDescriptionFragment.- Returns:
- this builder.
-
withPattern
Set the pattern for the resultingStateDescriptionFragment.- Parameters:
pattern- the pattern for the resultingStateDescriptionFragment.- Returns:
- this builder.
-
withReadOnly
Set readOnly for the resultingStateDescriptionFragment.- Parameters:
readOnly- readOnly for the resultingStateDescriptionFragment.- Returns:
- this builder.
-
withOption
Ass aStateOptionfor the resultingStateDescriptionFragment.- Parameters:
option- aStateOptionfor the resultingStateDescriptionFragment.- Returns:
- this builder.
-
withOptions
Set theStateOptions for the resultingStateDescriptionFragment.- Parameters:
options- theStateOptions for the resultingStateDescriptionFragment.- Returns:
- this builder.
-