Class VersionNumber

    • Method Detail

      • getVersionNumberPattern

        public static Pattern getVersionNumberPattern​(String delim)
        Returns the pattern with Perl regular expression:
           "\\D*(\\d+)[^\\"+delim+"\\s]*(?:\\"+delim+"\\D*(\\d+)[^\\"+delim+"\\s]*(?:\\"+delim+"\\D*(\\d+))?)?"
         

        A whitespace within the version number will end the parser.

        Capture groups represent the major (1), optional minor (2) and optional sub version number (3) component in this order.

        Each capture group ignores any leading non-digit and uses only contiguous digits, i.e. ignores pending non-digits.

        Parameters:
        delim - the delimiter, e.g. "."
      • isZero

        public final boolean isZero()
        Returns true, if all version components are zero, otherwise false.
      • hasMajor

        public final boolean hasMajor()
        Returns true, if the major component is defined explicitly, otherwise false. Undefined components has the value 0.
      • hasMinor

        public final boolean hasMinor()
        Returns true, if the optional minor component is defined explicitly, otherwise false. Undefined components has the value 0.
      • hasSub

        public final boolean hasSub()
        Returns true, if the optional sub component is defined explicitly, otherwise false. Undefined components has the value 0.
      • endOfStringMatch

        public final int endOfStringMatch()
        If constructed with version-string, returns the string offset after the last matching character, or 0 if none matched, or -1 if not constructed with a string.
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class Object
      • getMajor

        public final int getMajor()
      • getMinor

        public final int getMinor()
      • getSub

        public final int getSub()