Class ConvertingCursor<S,T>
java.lang.Object
org.springframework.data.redis.core.ConvertingCursor<S,T>
- Type Parameters:
S-T-
- All Implemented Interfaces:
Closeable,AutoCloseable,Iterator<T>,Cursor<T>,CloseableIterator<T>
ConvertingCursor wraps a given cursor and applies given Converter to items prior to returning them.
This allows to easily perform required conversion whereas the underlying implementation may still work with its
native types.- Since:
- 1.4
- Author:
- Christoph Strobl
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.data.redis.core.Cursor
Cursor.CursorId -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.data.util.CloseableIterator
spliterator, streamMethods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
ConvertingCursor
- Parameters:
cursor- Cursor must not be null.converter- Converter must not be null.
-
-
Method Details
-
hasNext
public boolean hasNext() -
next
-
remove
public void remove() -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceCloseableIterator<S>
-
getId
Description copied from interface:CursorReturns the reference cursor. -
getCursorId
Deprecated.Description copied from interface:CursorGet the reference cursor.
NOTE: the id might change while iterating items.- Specified by:
getCursorIdin interfaceCursor<S>- Returns:
-
isClosed
public boolean isClosed() -
getPosition
public long getPosition()- Specified by:
getPositionin interfaceCursor<S>- Returns:
- the current position of the cursor.
-