Class ItemStateChangedEvent

All Implemented Interfaces:
Event
Direct Known Subclasses:
GroupItemStateChangedEvent

@NonNullByDefault public class ItemStateChangedEvent extends ItemEvent
ItemStateChangedEvents can be used to deliver item state changes through the openHAB event bus. In contrast to the ItemStateEvent the ItemStateChangedEvent is only sent if the state changed. State events must be created with the ItemEventFactory.
Author:
Dennis Nobel - Initial contribution
  • Field Details

    • TYPE

      public static final String TYPE
      The item state changed event type.
    • itemState

      protected final State itemState
    • oldItemState

      protected final State oldItemState
  • Constructor Details

    • ItemStateChangedEvent

      protected ItemStateChangedEvent(String topic, String payload, String itemName, State newItemState, State oldItemState)
      Constructs a new item state changed event.
      Parameters:
      topic - the topic
      payload - the payload
      itemName - the item name
      newItemState - the new item state
      oldItemState - the old item state
  • Method Details

    • getType

      public String getType()
      Description copied from interface: Event
      Gets the event type.
      Returns:
      the event type
    • getItemState

      public State getItemState()
      Gets the item state.
      Returns:
      the item state
    • getOldItemState

      public State getOldItemState()
      Gets the old item state.
      Returns:
      the old item state
    • toString

      public String toString()
      Overrides:
      toString in class Object