Class EmptyMongoCursor<TResult>

  • Type Parameters:
    TResult - The type of documents the cursor is supposed to contains
    All Implemented Interfaces:
    com.mongodb.client.MongoCursor<TResult>, java.io.Closeable, java.lang.AutoCloseable, java.util.Iterator<TResult>

    public class EmptyMongoCursor<TResult>
    extends java.lang.Object
    implements com.mongodb.client.MongoCursor<TResult>
    Empty mongo cursor implementation to use in place of a real MongoCursor
    • Constructor Detail

      • EmptyMongoCursor

        public EmptyMongoCursor()
        the constructor
    • Method Detail

      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface com.mongodb.client.MongoCursor<TResult>
      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface java.util.Iterator<TResult>
        Specified by:
        hasNext in interface com.mongodb.client.MongoCursor<TResult>
      • next

        public TResult next()
        Specified by:
        next in interface java.util.Iterator<TResult>
        Specified by:
        next in interface com.mongodb.client.MongoCursor<TResult>
      • tryNext

        public TResult tryNext()
        Specified by:
        tryNext in interface com.mongodb.client.MongoCursor<TResult>
      • getServerCursor

        public com.mongodb.ServerCursor getServerCursor()
        Specified by:
        getServerCursor in interface com.mongodb.client.MongoCursor<TResult>
      • getServerAddress

        public com.mongodb.ServerAddress getServerAddress()
        Specified by:
        getServerAddress in interface com.mongodb.client.MongoCursor<TResult>