Package net.sf.basedb.core
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) $
-
-
Constructor Summary
Constructors Constructor Description Version()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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.static int
getBuild()
Get the build version.static int
getMaintenance()
Get the maintentance version.static int
getMajor()
Get the major version.static int
getMinor()
Get the minor version.static String
getSuffix()
Get the version suffix string (eg "-dev" for development versions)static String
getVersion()
(package private) static void
init()
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.
-
-
-
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
-
-
Method Detail
-
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.
-
-