Package org.openhab.core.types
Interface StateDescriptionFragment
@NonNullByDefault
public interface StateDescriptionFragment
A
StateDescriptionFragment will deliver only the parts of a StateDescription it knows of.
All other methods should return null to indicate an unknown value.- Author:
- Henning Treu - Initial contribution
-
Method Summary
Modifier and TypeMethodDescription@Nullable BigDecimalReturns the maximum value of an item state.@Nullable BigDecimalReturns the minimum value of an item state.@Nullable List<StateOption> Returns a list of predefined states with their label.@Nullable StringReturns the pattern to render the state to a string.@Nullable BigDecimalgetStep()Returns the step size.@Nullable BooleanReturns true, if the state can only be read but not written.@Nullable StateDescriptionCreate and return aStateDescriptionfrom this fragment.
-
Method Details
-
getMinimum
@Nullable BigDecimal getMinimum()Returns the minimum value of an item state.- Returns:
- minimum value of an item state
-
getMaximum
@Nullable BigDecimal getMaximum()Returns the maximum value of an item state.- Returns:
- maximum value of an item state
-
getStep
@Nullable BigDecimal getStep()Returns the step size.- Returns:
- step size
-
getPattern
@Nullable String getPattern()Returns the pattern to render the state to a string.- Returns:
- pattern
-
isReadOnly
@Nullable Boolean isReadOnly()Returns true, if the state can only be read but not written. Typically a sensor can be read only.- Returns:
- true, if the state can only be read but not written
-
getOptions
@Nullable List<StateOption> getOptions()Returns a list of predefined states with their label.- Returns:
- a list of predefined states with their label
-
toStateDescription
@Nullable StateDescription toStateDescription()Create and return aStateDescriptionfrom this fragment. The resultingStateDescriptionshould be null if the fragment does not define any values.- Returns:
- a
StateDescriptionfrom this fragment.
-