Package gaiasky.util.update
Class VersionChecker
java.lang.Object
gaiasky.util.update.VersionChecker
- All Implemented Interfaces:
Runnable
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
correctVersionNumber
(int versionNumber) Adapts to the new min.maj.rev-seq format automagically.void
run()
void
setListener
(com.badlogic.gdx.scenes.scene2d.EventListener listener) static Integer
Attempts to convert a tag string (maj.min.rev-seq) to an integer number: num = maj*1000000 + min*10000 + rev*100 + seq
-
Field Details
-
MAX_VERSION_NUMBER
public static final int MAX_VERSION_NUMBER- See Also:
-
MIN_VERSION_NUMBER
public static final int MIN_VERSION_NUMBER- See Also:
-
-
Constructor Details
-
VersionChecker
-
-
Method Details
-
stringToVersionNumber
Attempts to convert a tag string (maj.min.rev-seq) to an integer number: num = maj*1000000 + min*10000 + rev*100 + seqSo, for instance: 1.6.2 -> 01060200 2.2.0 -> 02020000 3.5.3-2 -> 03050302
Things like 2.4.0-RC4 are also detected, but the -RC4 suffix is ignored. If no conversion is possible (no maj.min.rev is detected in the string), the version is assumed to be a development branch and the maximum version number (100000000) is given.
- Parameters:
tag
- The tag string.- Returns:
- The integer.
-
run
public void run() -
setListener
public void setListener(com.badlogic.gdx.scenes.scene2d.EventListener listener) -
correctVersionNumber
public static int correctVersionNumber(int versionNumber) Adapts to the new min.maj.rev-seq format automagically.- Parameters:
versionNumber
- The configuration version.- Returns:
- The new version number, corrected for the new format.
-