Class Version


  • public class Version
    extends Object
    Get information about the BASE version.

    The version information is stored in the base.version file.

    Version:
    2.0
    Author:
    Nicklas
    Last modified
    $Date: 2015-05-12 11:27:08 +0200 (ti, 12 maj 2015) $
    • Field Detail

      • major

        private static int major
      • minor

        private static int minor
      • maintenance

        private static int maintenance
      • build

        private static int build
      • suffix

        private static String suffix
    • Constructor Detail

      • Version

        public Version()
    • Method Detail

      • getMajor

        public static int getMajor()
        Get the major version.
        Since:
        3.0 (was returning a String in 2.x)
      • getMinor

        public static int getMinor()
        Get the minor version.
        Since:
        3.0 (was returning a String in 2.x)
      • getMaintenance

        public static int getMaintenance()
        Get the maintentance version.
        Since:
        3.0 (was returning a String in 2.x)
      • getBuild

        public static int getBuild()
        Get the build version.
      • getSuffix

        public static String getSuffix()
        Get the version suffix string (eg "-dev" for development versions)
        Since:
        3.0
      • getVersion

        public static String getVersion()
      • compareWith

        public static int compareWith​(String version)
        Compare the given version string, which should be of the form a.b or a.b.c, with the current BASE version. If they are exactly equal 0 is returned. If the given string is less than the current version -1 is returned, if the given string is greater than the current version +1 is returned.
        Returns:
        0, -1 or +1
        Throws:
        InvalidDataException - If the given string isn't correctly formatted
        Since:
        3.0
      • parseBuildNumber

        private static int parseBuildNumber​(String buildNumber)
        Find the first digits in a string and return those as the build number.