Interface Cursor<T>
- Type Parameters:
T-
- All Superinterfaces:
AutoCloseable,Closeable,CloseableIterator<T>,Iterator<T>
- All Known Implementing Classes:
ConvertingCursor,KeyBoundCursor,ScanCursor
Cursor abstraction to scan over the keyspace or elements within a data structure using a variant of a
SCAN
command.
Using a Java 8 java.util.stream.Stream allows to apply additional
filters and
limits to the underlying Cursor.
Make sure to close the cursor when done as this allows implementations to clean up
any resources they need to keep open to iterate over elements (eg. by using a try-with-resource statement).
- Since:
- 1.4
- Author:
- Christoph Strobl, Mark Paluch
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classValue class representing a cursor identifier. -
Method Summary
Methods inherited from interface org.springframework.data.util.CloseableIterator
close, spliterator, streamMethods inherited from interface java.util.Iterator
forEachRemaining, hasNext, next, remove
-
Method Details
-
getId
Cursor.CursorId getId()Returns the reference cursor.- Returns:
- the reference cursor.
- Since:
- 3.2.1
-
getCursorId
Deprecated.since 3.3.0, usegetId()instead as the cursorId can exceedLong.MAX_VALUE.Get the reference cursor.
NOTE: the id might change while iterating items.- Returns:
-
isClosed
boolean isClosed()- Returns:
trueif cursor closed.
-
getPosition
long getPosition()- Returns:
- the current position of the cursor.
-
getId()instead as the cursorId can exceedLong.MAX_VALUE.