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
-
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.data.util.CloseableIterator
spliterator, stream
Methods 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceCloseableIterator<S>
-
getId
Description copied from interface:Cursor
Returns the reference cursor. -
getCursorId
Deprecated.Description copied from interface:Cursor
Get the reference cursor.
NOTE: the id might change while iterating items.- Specified by:
getCursorId
in interfaceCursor<S>
- Returns:
-
isClosed
public boolean isClosed() -
getPosition
public long getPosition()- Specified by:
getPosition
in interfaceCursor<S>
- Returns:
- the current position of the cursor.
-