Package org.openhab.core.items.events
Class ItemStateUpdatedEvent
java.lang.Object
org.openhab.core.events.AbstractEvent
org.openhab.core.items.events.ItemEvent
org.openhab.core.items.events.ItemStateUpdatedEvent
- All Implemented Interfaces:
Event
- Direct Known Subclasses:
GroupStateUpdatedEvent
ItemStateUpdatedEvent
s can be used to report item status updates through the openHAB event bus.
State update events must be created with the ItemEventFactory
.- Author:
- Jan N. Klug - Initial contribution
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final State
protected final @Nullable ZonedDateTime
static final String
The item state event type. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ItemStateUpdatedEvent
(String topic, String payload, String itemName, State itemState, @Nullable ZonedDateTime lastStateUpdate, @Nullable String source) Constructs a new item state event. -
Method Summary
Modifier and TypeMethodDescriptionGets the item state.@Nullable ZonedDateTime
Gets the timestamp of the previous state update that occurred prior to this event.getType()
Gets the event type.toString()
Methods inherited from class org.openhab.core.items.events.ItemEvent
getItemName
Methods inherited from class org.openhab.core.events.AbstractEvent
equals, getPayload, getSource, getTopic, hashCode
-
Field Details
-
TYPE
The item state event type. -
itemState
-
lastStateUpdate
-
-
Constructor Details
-
ItemStateUpdatedEvent
protected ItemStateUpdatedEvent(String topic, String payload, String itemName, State itemState, @Nullable ZonedDateTime lastStateUpdate, @Nullable String source) Constructs a new item state event.- Parameters:
topic
- the topicpayload
- the payloaditemName
- the item nameitemState
- the item statelastStateUpdate
- the last state updatesource
- the source, can be null
-
-
Method Details
-
getType
Description copied from interface:Event
Gets the event type.- Returns:
- the event type
-
getItemState
Gets the item state.- Returns:
- the item state
-
getLastStateUpdate
Gets the timestamp of the previous state update that occurred prior to this event.- Returns:
- the last state update
-
toString
-