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 booleanChecks if this entity represents a snapshot.Retrieves the timestamp of the snapshot, if available.default SnapshotCapableCreates 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:
trueif a snapshot timestamp is present,falseotherwise.
-
withSnapshot
Creates a snapshot of this entity at the current time.- Returns:
- A new instance of
SnapshotCapablewith 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
SnapshotCapablewith the specified snapshot time.
-