Package org.openhab.core.persistence
Interface PersistedItem
- All Superinterfaces:
HistoricItem
This interface is used by persistence services to represent the full persisted state of an item, including the
previous state, and last update and change timestamps.
It can be used in restoring the full state of an item.
- Author:
- Mark Herwege - Initial contribution
-
Method Summary
Modifier and TypeMethodDescription@Nullable State
returns the last state of the item@Nullable ZonedDateTime
returns the timestamp of the last state change of the persisted itemdefault @Nullable Instant
returns the timestamp of the last state change of the persisted itemMethods inherited from interface org.openhab.core.persistence.HistoricItem
getInstant, getName, getState, getTimestamp
-
Method Details
-
getLastStateChange
@Nullable ZonedDateTime getLastStateChange()returns the timestamp of the last state change of the persisted item- Returns:
- the timestamp of the last state change of the item
-
getLastStateChangeInstant
returns the timestamp of the last state change of the persisted item- Returns:
- the timestamp of the last state change of the item
-
getLastState
@Nullable State getLastState()returns the last state of the item- Returns:
- the last state
-