Class Version

java.lang.Object
net.sf.basedb.core.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 Summary

    Fields
    Modifier and Type
    Field
    Description
    private static int
     
    private static int
     
    private static int
     
    private static int
     
    private static String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    Compare the given version string, which should be of the form a.b or a.b.c, with the current BASE version.
    static int
    Get the build version.
    static int
    Get the maintentance version.
    static int
    Get the major version.
    static int
    Get the minor version.
    static String
    Get the version suffix string (eg "-dev" for development versions)
    static String
     
    (package private) static void
    Loads the settings from the configuration file.
    private static int
    parseBuildNumber(String buildNumber)
    Find the first digits in a string and return those as the build number.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • 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 Details

    • Version

      public Version()
  • Method Details

    • init

      static void init() throws ConfigurationException
      Loads the settings from the configuration file.
      Throws:
      ConfigurationException - This exception is thrown if the configuration settings cannot be loaded
    • 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.