Package org.openhab.core.items
Interface StateChangeListener
- All Known Implementing Classes:
GroupItem
@NonNullByDefault
public interface StateChangeListener
This interface must be implemented by all classes that want to be notified about changes in the state of an item.
The GenericItem
class provides the possibility to register such listeners.
- Author:
- Kai Kreuzer - Initial contribution
-
Method Summary
Modifier and TypeMethodDescriptionvoid
stateChanged
(Item item, State oldState, State newState) This method is called, if a state has changed.void
stateUpdated
(Item item, State state) This method is called, if a state was updated, but has not changed
-
Method Details
-
stateChanged
This method is called, if a state has changed.- Parameters:
item
- the item whose state has changedoldState
- the previous statenewState
- the new state
-
stateUpdated
This method is called, if a state was updated, but has not changed- Parameters:
item
- the item whose state was updatedstate
- the current state, same before and after the update
-