Package org.jgroups
Class Version
- java.lang.Object
-
- org.jgroups.Version
-
public class Version extends java.lang.ObjectWe're using the scheme described at http://www.jboss.com/index.html?module=bb&op=viewtopic&t=77231 for major, minor and micro version numbers. We have 5 bits for major and minor version numbers each and 6 bits for the micro version. This gives: X = 0-31 for major versions Y = 0-31 for minor versions Z = 0-63 for micro versions
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCODENAMEstatic java.lang.Stringdescriptionstatic shortmajorprivate static intMAJOR_MASKprivate static intMAJOR_SHIFTstatic shortmicroprivate static intMICRO_MASKstatic shortminorprivate static intMINOR_MASKprivate static intMINOR_SHIFTstatic java.lang.Stringstring_versionstatic shortversionstatic java.lang.StringVERSION_FILEstatic java.lang.StringVERSION_PROPERTYprivate static java.util.regex.PatternVERSION_REGEXP
-
Constructor Summary
Constructors Constructor Description Version()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static short[]decode(short version)static shortencode(int major, int minor, int micro)Method copied from http://www.jboss.com/index.html?module=bb&op=viewtopic&t=77231static shortgetMajor()static shortgetMajor(short v)static shortgetMicro()static shortgetMicro(short v)static shortgetMinor()static shortgetMinor(short v)static booleanisBinaryCompatible(short ver)Checks whether ver is binary compatible with the current version.static booleanisBinaryCompatible(short ver1, short ver2)static booleanisSame(short v)Compares the specified version number against the current version number.static voidmain(java.lang.String[] args)Prints the value of the description and cvs fields to System.out.static shortparse(java.lang.String ver)static java.lang.Stringprint(short version)Method copied from http://www.jboss.com/index.html?module=bb&op=viewtopic&t=77231static java.lang.StringprintDescription()Returns the catenation of the description and cvs fields.static java.lang.StringprintVersion()Returns the version field as a String.
-
-
-
Field Detail
-
major
public static final short major
-
minor
public static final short minor
-
micro
public static final short micro
-
description
public static final java.lang.String description
-
version
public static final short version
-
string_version
public static final java.lang.String string_version
-
MAJOR_SHIFT
private static final int MAJOR_SHIFT
- See Also:
- Constant Field Values
-
MINOR_SHIFT
private static final int MINOR_SHIFT
- See Also:
- Constant Field Values
-
MAJOR_MASK
private static final int MAJOR_MASK
- See Also:
- Constant Field Values
-
MINOR_MASK
private static final int MINOR_MASK
- See Also:
- Constant Field Values
-
MICRO_MASK
private static final int MICRO_MASK
- See Also:
- Constant Field Values
-
VERSION_FILE
public static final java.lang.String VERSION_FILE
- See Also:
- Constant Field Values
-
VERSION_PROPERTY
public static final java.lang.String VERSION_PROPERTY
- See Also:
- Constant Field Values
-
CODENAME
public static final java.lang.String CODENAME
- See Also:
- Constant Field Values
-
VERSION_REGEXP
private static final java.util.regex.Pattern VERSION_REGEXP
-
-
Method Detail
-
getMajor
public static short getMajor()
-
getMinor
public static short getMinor()
-
getMicro
public static short getMicro()
-
getMajor
public static short getMajor(short v)
-
getMinor
public static short getMinor(short v)
-
getMicro
public static short getMicro(short v)
-
main
public static void main(java.lang.String[] args)
Prints the value of the description and cvs fields to System.out.- Parameters:
args-
-
printDescription
public static java.lang.String printDescription()
Returns the catenation of the description and cvs fields.- Returns:
- String with description
-
printVersion
public static java.lang.String printVersion()
Returns the version field as a String.- Returns:
- String with version
-
isSame
public static boolean isSame(short v)
Compares the specified version number against the current version number.- Parameters:
v- short- Returns:
- Result of == operator.
-
encode
public static short encode(int major, int minor, int micro)Method copied from http://www.jboss.com/index.html?module=bb&op=viewtopic&t=77231
-
print
public static java.lang.String print(short version)
Method copied from http://www.jboss.com/index.html?module=bb&op=viewtopic&t=77231
-
parse
public static short parse(java.lang.String ver)
-
decode
public static short[] decode(short version)
-
isBinaryCompatible
public static boolean isBinaryCompatible(short ver)
Checks whether ver is binary compatible with the current version. The rule for binary compatibility is that the major and minor versions have to match, whereas micro versions can differ.- Parameters:
ver-- Returns:
-
isBinaryCompatible
public static boolean isBinaryCompatible(short ver1, short ver2)
-
-