Class ItemStatePredictedEvent

All Implemented Interfaces:
Event

@NonNullByDefault public class ItemStatePredictedEvent extends ItemEvent
This event announces potential item state outcomes when a command was received.

Thereby it denotes that the item state is most likely going to change to the given predicted value.

If isConfirmation == true, then it basically only confirms the previous item state because a received command will not be successfully executed and therefore presumably will not result in a state change (e.g. because no handler currently is capable of delivering such an event to its device).

Author:
Simon Kaufmann - Initial contribution
  • Field Details

    • TYPE

      public static final String TYPE
      The item state predicted event type.
    • predictedState

      protected final State predictedState
    • isConfirmation

      protected final boolean isConfirmation
  • Constructor Details

    • ItemStatePredictedEvent

      public ItemStatePredictedEvent(String topic, String payload, String itemName, State predictedState, boolean isConfirmation)
      Constructs a new item state predicted event.
      Parameters:
      topic - the topic
      payload - the payload
      itemName - the item name
      predictedState - the predicted item state
      isConfirmation - the confirmation of previous item state
  • Method Details

    • getType

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

      public State getPredictedState()
      Gets the predicted item state.
      Returns:
      the predicted item state
    • isConfirmation

      public boolean isConfirmation()
      Gets the confirmation of previous item state.
      Returns:
      true, if previous item state is confirmed
    • toString

      public String toString()
      Overrides:
      toString in class Object