Class Version.BuildAwareOrder

  • All Implemented Interfaces:
    java.util.Comparator<Version>
    Enclosing class:
    Version

    private static class Version.BuildAwareOrder
    extends java.lang.Object
    implements java.util.Comparator<Version>
    A build-aware comparator.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private BuildAwareOrder()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compare​(Version v1, Version v2)
      Compares two Version instances taking into account their build metadata.
      • 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
    • Constructor Detail

      • BuildAwareOrder

        private BuildAwareOrder()
    • Method Detail

      • compare

        public int compare​(Version v1,
                           Version v2)
        Compares two Version instances taking into account their build metadata. When compared build metadata is divided into identifiers. The numeric identifiers are compared numerically, and the alphanumeric identifiers are compared in the ASCII sort order. If one of the compared versions has no defined build metadata, this version is considered to have a lower precedence than that of the other.
        Specified by:
        compare in interface java.util.Comparator<Version>
        Returns: