Package org.eclipse.handly.snapshot
Class NonExpiringSnapshot
java.lang.Object
org.eclipse.handly.snapshot.Snapshot
org.eclipse.handly.snapshot.NonExpiringSnapshot
- All Implemented Interfaces:
ISnapshot
A snapshot that never expires. It never returns
null
from
getContents()
; it wraps another snapshot and holds on to its
contents.
Protractedly holding on to non-expiring snapshots is not recommended, as they may potentially consume large amount of space.
-
Constructor Summary
ConstructorDescriptionNonExpiringSnapshot
(ISnapshotProvider provider) Takes a snapshot from the given provider and wraps it in a new non-expiring snapshot. -
Method Summary
Modifier and TypeMethodDescriptionReturns the cached contents of the wrapped snapshot.Returns the snapshot wrapped by this snapshot.Methods inherited from class org.eclipse.handly.snapshot.Snapshot
isEqualTo, predictEquality
-
Constructor Details
-
NonExpiringSnapshot
Takes a snapshot from the given provider and wraps it in a new non-expiring snapshot.- Parameters:
provider
- a snapshot provider from which a snapshot is to be taken (notnull
)- Throws:
IllegalStateException
- if the snapshot could not be created because of an inappropriate state of the snapshot provider
-
-
Method Details
-
getContents
Returns the cached contents of the wrapped snapshot.Protractedly holding on to the returned contents is not recommended, as it may potentially consume significant amount of space.
- Returns:
- the cached contents of the wrapped snapshot
(never
null
)
-
getWrappedSnapshot
Returns the snapshot wrapped by this snapshot.- Returns:
- the wrapped snapshot (never
null
)
-