Interface SnapshotCapable
- All Known Subinterfaces:
AggregatedPoint<V,
,A> AtomicPoint<V>
,DataPoint<V>
- All Known Implementing Classes:
AggregatedDataPoint
Represents an entity capable of creating and managing snapshots.
This sealed interface defines the contract for snapshot-capable entities
and restricts its implementations to the DataPoint
subtype.
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
Checks if this entity represents a snapshot.Retrieves the timestamp of the snapshot, if available.default SnapshotCapable
Creates a snapshot of this entity at the current time.withSnapshot
(Instant timestamp) Creates a snapshot of this entity at the specified time.
-
Method Details
-
snapshotTimestamp
Retrieves the timestamp of the snapshot, if available. -
isSnapshot
default boolean isSnapshot()Checks if this entity represents a snapshot.- Returns:
true
if a snapshot timestamp is present,false
otherwise.
-
withSnapshot
Creates a snapshot of this entity at the current time.- Returns:
- A new instance of
SnapshotCapable
with the current timestamp as the snapshot time.
-
withSnapshot
Creates a snapshot of this entity at the specified time.- Parameters:
timestamp
- The timestamp to use for the snapshot.- Returns:
- A new instance of
SnapshotCapable
with the specified snapshot time.
-