Class StableRevisionComparator

  • All Implemented Interfaces:
    java.util.Comparator<Revision>

    public class StableRevisionComparator
    extends java.lang.Object
    implements java.util.Comparator<Revision>
    StableRevisionComparator implements a revision comparator, which is only based on stable information available in the two revisions presented to this comparator. This class is used in sorted collections where revision keys must have a stable ordering independent from the time when a revision was seen.

    Revisions are first ordered by timestamp, then counter and finally cluster node id.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compare​(Revision o1, Revision o2)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Comparator

        equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
    • Field Detail

      • INSTANCE

        public static final java.util.Comparator<Revision> INSTANCE
      • REVERSE

        public static final java.util.Comparator<Revision> REVERSE
    • Method Detail

      • compare

        public int compare​(Revision o1,
                           Revision o2)
        Specified by:
        compare in interface java.util.Comparator<Revision>