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:
com.mongodb.client.MongoCursor<T>,Closeable,AutoCloseable,Iterator<T>
public class MorphiaCursor<T> extends Object implements com.mongodb.client.MongoCursor<T>
- Since:
- 2.2
-
-
Constructor Summary
Constructors Constructor Description MorphiaCursor(com.mongodb.client.MongoCursor<T> cursor)Creates a MorphiaCursor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidclose()Closes the underlying cursor.com.mongodb.ServerAddressgetServerAddress()com.mongodb.ServerCursorgetServerCursor()booleanhasNext()Tnext()voidremove()List<T>toList()Converts this cursor to a List.TtryNext()
-
-
-
Constructor Detail
-
MorphiaCursor
public MorphiaCursor(com.mongodb.client.MongoCursor<T> cursor)
Creates a MorphiaCursor- Parameters:
cursor- the Iterator to use
-
-
Method Detail
-
close
public void close()
Closes the underlying cursor.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfacecom.mongodb.client.MongoCursor<T>
-
hasNext
public boolean hasNext()
-
next
@NonNull public T next()
-
available
public int available()
- Specified by:
availablein interfacecom.mongodb.client.MongoCursor<T>
-
getServerCursor
public com.mongodb.ServerCursor getServerCursor()
- Specified by:
getServerCursorin interfacecom.mongodb.client.MongoCursor<T>
-
getServerAddress
@NonNull public com.mongodb.ServerAddress getServerAddress()
- Specified by:
getServerAddressin interfacecom.mongodb.client.MongoCursor<T>
-
-