Package com.mongodb

Class ServerCursor

java.lang.Object
com.mongodb.ServerCursor
All Implemented Interfaces:
Serializable

@Immutable public final class ServerCursor extends Object implements Serializable
A class representing a cursor id associated with a server address (host/port) Since cursor ids are only useful in the context of a single MongoDB server process, you need both values to do a getMore on the cursor.
Since:
3.0
See Also:
  • Constructor Details

    • ServerCursor

      public ServerCursor(long id, ServerAddress address)
      Construct an instance.
      Parameters:
      id - the non-null cursor id
      address - the non-null server address that has the cursor
  • Method Details

    • getId

      public long getId()
      Gets the cursor id that the server uses to uniquely identify the cursor.
      Returns:
      the cursor id
    • getAddress

      public ServerAddress getAddress()
      Gets the server address.
      Returns:
      the server address
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object