3.2.1: 2012-12-13

net.sf.basedb.core
Class Version

java.lang.Object
  extended by 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: 2011-04-15 09:52:28 +0200 (Fri, 15 Apr 2011) $

Field Summary
private static int build
           
private static int maintenance
           
private static int major
           
private static int minor
           
private static String suffix
           
 
Constructor Summary
Version()
           
 
Method Summary
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

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.

Parameters:
version -
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.


3.2.1: 2012-12-13