Class ServerId

java.lang.Object
com.mongodb.connection.ServerId

@Immutable public final class ServerId extends Object
A client-generated identifier that uniquely identifies a MongoDB server.
Since:
3.0
  • Constructor Details

    • ServerId

      public ServerId(ClusterId clusterId, ServerAddress address)
      Construct an instance.
      Parameters:
      clusterId - the client-generated cluster identifier
      address - the server address
  • Method Details

    • getClusterId

      public ClusterId getClusterId()
      Gets the cluster identifier.
      Returns:
      the cluster identifier
    • 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