Class StandardSnapshot
java.lang.Object
dev.getelements.elements.rt.transact.StandardSnapshot
- All Implemented Interfaces:
Snapshot,AutoCloseable
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.getelements.elements.rt.transact.Snapshot
Snapshot.Builder -
Constructor Summary
ConstructorsConstructorDescriptionStandardSnapshot(Monitor monitor, DataStore dataStore, SortedSet<ResourceId> resourceIds, SortedSet<Path> paths) -
Method Summary
Modifier and TypeMethodDescriptionadd(ResourceId resourceId) Adds a newResourceEntrywith the suppliedResourceId, returning the result.voidclose()Closes this snapshot, releasing any underlying system resources associated with this snapshot.findResourceEntry(ResourceId resourceId) Finds theResourceEntryat the supplied ResourceId.findResourceEntry(Path path) Finds theResourceEntryat the supplied path.findTaskEntry(ResourceId resourceId) Finds theTaskEntryassociated with the suppliedResourceId.getOrCreateTaskEntry(ResourceId resourceId) Gets theTaskEntryor throws an instance ofSnapshotMissException.Gets allResourceEntryinstances in thisSnapshot.Collection<TaskEntry<?>> List allResourceEntryinstances matching thePath.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.getelements.elements.rt.transact.Snapshot
getResourceEntry, getResourceEntry
-
Constructor Details
-
StandardSnapshot
-
-
Method Details
-
list
Description copied from interface:SnapshotList allResourceEntryinstances matching thePath. As aSnapshotmay be backed by aStreamfrom theDataStore, it is required that the Stream reach a terminal state or be explicitly closed. Closing thisSnapshotwill close the stream associatd with it.- Specified by:
listin interfaceSnapshot- Parameters:
path- the path- Returns:
- the
Stream<ResourceEntry>
-
findTaskEntry
Description copied from interface:SnapshotFinds theTaskEntryassociated with the suppliedResourceId.- Specified by:
findTaskEntryin interfaceSnapshot- Parameters:
resourceId- theResourceId- Returns:
- the
Optionalcontaining theTaskEntry<ResourceId>
-
getOrCreateTaskEntry
Description copied from interface:SnapshotGets theTaskEntryor throws an instance ofSnapshotMissException.- Specified by:
getOrCreateTaskEntryin interfaceSnapshot- Parameters:
resourceId- the path- Returns:
- the
Optionalcontaining aTaskEntrynever null
-
findResourceEntry
Description copied from interface:SnapshotFinds theResourceEntryat the supplied path.- Specified by:
findResourceEntryin interfaceSnapshot- Parameters:
path- the path- Returns:
- an
Optionalcontaining the Entry.
-
findResourceEntry
Description copied from interface:SnapshotFinds theResourceEntryat the supplied ResourceId.- Specified by:
findResourceEntryin interfaceSnapshot- Parameters:
resourceId- the path- Returns:
- an
Optionalcontaining the Entry.
-
getTaskEntries
Description copied from interface:Snapshot- Specified by:
getTaskEntriesin interfaceSnapshot- Returns:
- gets all
TaskEntryinstances associated with thisSnapshot
-
getResourceEntries
Description copied from interface:SnapshotGets allResourceEntryinstances in thisSnapshot.- Specified by:
getResourceEntriesin interfaceSnapshot- Returns:
- gets all
ResourceEntryinstances associated with thisSnapshot
-
add
Description copied from interface:SnapshotAdds a newResourceEntrywith the suppliedResourceId, returning the result. Any previously accessedResourceEntryinstances.- Specified by:
addin interfaceSnapshot- Parameters:
resourceId- theResourceId- Returns:
- the
ResourceEntrywhich was added.
-
close
public void close()Description copied from interface:SnapshotCloses this snapshot, releasing any underlying system resources associated with this snapshot.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceSnapshot
-
getDataStore
-