Class Version

  • All Implemented Interfaces:
    Comparable

    public class Version
    extends Object
    implements Comparable
    Represents a version identifier.
    • Constructor Detail

      • Version

        public Version​(int major,
                       int minor,
                       int micro,
                       String qualifier)
    • Method Detail

      • parseVersion

        public static Version parseVersion​(String text)
        Parses a version text in the form {<number><sep>}[<qualifier>], where <sep> is one of '.', '-' or '_'. If no number was found 1.[<qualifier>] is assumed, e.g. "M1", is the same as "1.0.0.M1".
        Parameters:
        text - the text to parse
        Returns:
        the version identifier
      • getNumberCount

        public int getNumberCount()
      • getNumber

        public int getNumber​(int i)
      • getMajor

        public int getMajor()
      • getMinor

        public int getMinor()
      • getMicro

        public int getMicro()
      • getQualifier

        public String getQualifier()
      • toString

        public String toString()
        Returns the string representation of the version in the form {major}.{minor}.{micro}-{qualifier}.
        Overrides:
        toString in class Object
        Returns:
        a string representation of the version.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object