Class TopologyVersion


  • @ThreadSafe
    public final class TopologyVersion
    extends java.lang.Object
    The topology version of a cluster.
    Since:
    4.1
    Since server release
    4.4
    • Constructor Summary

      Constructors 
      Constructor Description
      TopologyVersion​(org.bson.BsonDocument topologyVersionDocument)
      Construct a new instance from a document description
      TopologyVersion​(org.bson.types.ObjectId processId, long counter)
      Construct a new instance from process identifier and counter
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.bson.BsonDocument asDocument()
      Get the document representation of the topology version
      boolean equals​(java.lang.Object o)  
      long getCounter()
      Get the counter
      org.bson.types.ObjectId getProcessId()
      Get the process identifier
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • TopologyVersion

        public TopologyVersion​(org.bson.BsonDocument topologyVersionDocument)
        Construct a new instance from a document description
        Parameters:
        topologyVersionDocument - a document description of the topology version
      • TopologyVersion

        public TopologyVersion​(org.bson.types.ObjectId processId,
                               long counter)
        Construct a new instance from process identifier and counter
        Parameters:
        processId - the process identifer
        counter - the counter
    • Method Detail

      • getProcessId

        public org.bson.types.ObjectId getProcessId()
        Get the process identifier
        Returns:
        the process identifier
      • getCounter

        public long getCounter()
        Get the counter
        Returns:
        the counter
      • asDocument

        public org.bson.BsonDocument asDocument()
        Get the document representation of the topology version
        Returns:
        the document representation of the topology version
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object