Class Version

  • All Implemented Interfaces:
    java.lang.Comparable<Version>

    public class Version
    extends java.lang.Object
    implements java.lang.Comparable<Version>
    Version object supporting Maven and OSGi versions.
    Since:
    1.4
    • Constructor Summary

      Constructors 
      Constructor Description
      Version​(java.lang.String version)
      Creates a version identifier from the specified string.
    • Constructor Detail

      • Version

        public Version​(java.lang.String version)
        Creates a version identifier from the specified string.
        Throws:
        java.lang.IllegalArgumentException - if the version string can't be parsed
    • Method Detail

      • getMajorVersion

        public int getMajorVersion()
        Get the major version
        Returns:
        The major version
        Since:
        1.8.0
      • getMinorVersion

        public int getMinorVersion()
        Get the major version
        Returns:
        The major version
        Since:
        1.8.0
      • getMicroVersion

        public int getMicroVersion()
        Get the minor version
        Returns:
        The minor version
        Since:
        1.8.0
      • getQualifier

        public java.lang.String getQualifier()
        Get the qualifier
        Returns:
        The qualifier, the qualifier might be the empty string.
        Since:
        1.8.0
      • hashCode

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

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • compareTo

        public int compareTo​(Version other)
        Compares this Version object to another Version.
        Specified by:
        compareTo in interface java.lang.Comparable<Version>
      • toString

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