Package dev.morphia.query
Class MorphiaCursor<T>
- java.lang.Object
-
- dev.morphia.query.MorphiaCursor<T>
-
- Type Parameters:
T
- the original type being iterated
- All Implemented Interfaces:
MongoCursor<T>
,Closeable
,AutoCloseable
,Iterator<T>
public class MorphiaCursor<T> extends Object implements MongoCursor<T>
- Since:
- 2.2
-
-
Constructor Summary
Constructors Constructor Description MorphiaCursor(MongoCursor<T> cursor)
Creates a MorphiaCursor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
available()
void
close()
Closes the underlying cursor.ServerAddress
getServerAddress()
ServerCursor
getServerCursor()
boolean
hasNext()
T
next()
void
remove()
List<T>
toList()
Converts this cursor to a List.T
tryNext()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.mongodb.client.MongoCursor
forEachRemaining
-
-
-
-
Constructor Detail
-
MorphiaCursor
public MorphiaCursor(MongoCursor<T> cursor)
Creates a MorphiaCursor- Parameters:
cursor
- the Iterator to use
-
-
Method Detail
-
close
public void close()
Closes the underlying cursor.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceMongoCursor<T>
-
hasNext
public boolean hasNext()
-
available
public int available()
- Specified by:
available
in interfaceMongoCursor<T>
-
tryNext
public T tryNext()
- Specified by:
tryNext
in interfaceMongoCursor<T>
-
getServerCursor
public ServerCursor getServerCursor()
- Specified by:
getServerCursor
in interfaceMongoCursor<T>
-
getServerAddress
@NonNull public ServerAddress getServerAddress()
- Specified by:
getServerAddress
in interfaceMongoCursor<T>
-
-