Class MorphiaKeyCursor<T>

  • Type Parameters:
    T - the entity type
    All Implemented Interfaces:
    com.mongodb.client.MongoCursor<Key<T>>, Closeable, AutoCloseable, Iterator<Key<T>>

    @Deprecated(since="2.0",
                forRemoval=true)
    public class MorphiaKeyCursor<T>
    extends Object
    implements com.mongodb.client.MongoCursor<Key<T>>
    Deprecated, for removal: This API element is subject to removal in a future version.
    Defines an Iterator across the Key values for a given type.
    • Constructor Summary

      Constructors 
      Constructor Description
      MorphiaKeyCursor​(com.mongodb.client.MongoCursor<org.bson.Document> cursor, Mapper mapper, Class<T> clazz, String collection)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void close()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Closes the underlying cursor.
      com.mongodb.ServerAddress getServerAddress()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      com.mongodb.ServerCursor getServerCursor()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      boolean hasNext()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      Key<T> next()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      void remove()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      List<Key<T>> toList()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Converts this cursor to a List.
      Key<T> tryNext()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
    • Constructor Detail

      • MorphiaKeyCursor

        public MorphiaKeyCursor​(com.mongodb.client.MongoCursor<org.bson.Document> cursor,
                                Mapper mapper,
                                Class<T> clazz,
                                String collection)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Create
        Parameters:
        cursor - the cursor to use
        mapper - the Mapper to use
        clazz - the original type being iterated
        collection - the mongodb collection
    • Method Detail

      • close

        public void close()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Closes the underlying cursor.
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
        Specified by:
        close in interface com.mongodb.client.MongoCursor<T>
      • hasNext

        public boolean hasNext()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Specified by:
        hasNext in interface Iterator<T>
        Specified by:
        hasNext in interface com.mongodb.client.MongoCursor<T>
      • next

        @NonNull
        public Key<T> next()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Specified by:
        next in interface Iterator<T>
        Specified by:
        next in interface com.mongodb.client.MongoCursor<T>
      • tryNext

        public Key<T> tryNext()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Specified by:
        tryNext in interface com.mongodb.client.MongoCursor<T>
      • getServerCursor

        public com.mongodb.ServerCursor getServerCursor()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Specified by:
        getServerCursor in interface com.mongodb.client.MongoCursor<T>
      • getServerAddress

        @NonNull
        public com.mongodb.ServerAddress getServerAddress()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Specified by:
        getServerAddress in interface com.mongodb.client.MongoCursor<T>
      • toList

        public List<Key<T>> toList()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Converts this cursor to a List. Care should be taken on large datasets as OutOfMemoryErrors are a risk.
        Returns:
        the list of Entities
      • remove

        public void remove()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Specified by:
        remove in interface Iterator<T>