Class ServerId


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

      • ServerId

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

      • 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​( o)
        Overrides:
         in class 
      • hashCode

        public int hashCode()
        Overrides:
         in class 
      • toString

        public  toString()
        Overrides:
         in class