Package net.sf.basedb.core
Class Version
java.lang.Object
net.sf.basedb.core.Version
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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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
Get the maintentance version.static int
getMajor()
Get the major version.static int
getMinor()
Get the minor version.static String
Get the version suffix string (eg "-dev" for development versions)static String
(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 Details
-
major
private static int major -
minor
private static int minor -
maintenance
private static int maintenance -
build
private static int build -
suffix
-
-
Constructor Details
-
Version
public Version()
-
-
Method Details
-
init
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
Get the version suffix string (eg "-dev" for development versions)- Since:
- 3.0
-
getVersion
-
compareWith
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
Find the first digits in a string and return those as the build number.
-