Class StateDescription

  • @NonNullByDefault
    public class StateDescription
    extends Object
    The StateDescription describes restrictions of an item state and gives information how to interpret it.
    Dennis Nobel - Initial contribution
    • Field Detail

      • minimum

        protected final @Nullable BigDecimal minimum
      • maximum

        protected final @Nullable BigDecimal maximum
      • pattern

        protected final @Nullable String pattern
      • readOnly

        protected final boolean readOnly
    • Constructor Detail

      • StateDescription

        protected StateDescription​(@Nullable BigDecimal minimum,
                                   @Nullable BigDecimal maximum,
                                   @Nullable BigDecimal step,
                                   @Nullable String pattern,
                                   boolean readOnly,
                                   @Nullable List<StateOption> options)
        Creates a state description object.
        minimum - minimum value of the state
        maximum - maximum value of the state
        step - step size
        pattern - pattern to render the state
        readOnly - if the state can be changed by the system
        options - predefined list of options
    • Method Detail

      • getMinimum

        public @Nullable BigDecimal getMinimum()
        Returns the minimum value of an item state.
        minimum value of an item state
      • getMaximum

        public @Nullable BigDecimal getMaximum()
        Returns the maximum value of an item state.
        maximum value of an item state
      • getStep

        public @Nullable BigDecimal getStep()
        Returns the step size.
        step size
      • getPattern

        public @Nullable String getPattern()
        Returns the pattern to render the state to a string.
      • isReadOnly

        public boolean isReadOnly()
        Returns true if the state can only be read but not written or false if the state can also be written. Typically a sensor can only be read.
        true for readOnly, false otherwise.
      • getOptions

        public List<StateOption> getOptions()
        Returns a list of predefined states with their label.
        a list of predefined states with their label
      • hashCode

        public int hashCode()
        hashCode in class Object
      • equals

        public boolean equals​(@Nullable Object obj)
        equals in class Object