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 BigDecimal
Returns the maximum value of an item state.@Nullable BigDecimal
Returns the minimum value of an item state.@Nullable List<StateOption>
Returns a list of predefined states with their label.@Nullable String
Returns the pattern to render the state to a string.@Nullable BigDecimal
getStep()
Returns the step size.@Nullable Boolean
Returns true, if the state can only be read but not written.@Nullable StateDescription
Create and return aStateDescription
from 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 aStateDescription
from this fragment. The resultingStateDescription
should be null if the fragment does not define any values.- Returns:
- a
StateDescription
from this fragment.
-