Package de.aristaflow.adept2.util
Class Version
- java.lang.Object
-
- de.aristaflow.adept2.util.Version
-
public final class Version extends Object
-
-
Constructor Summary
Constructors Constructor Description Version()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SerialisablePair<String,String>
getParsedVersionInformation(Class<?> cls)
Gets the version information from the version file that is part of the class bundle containing the designated class and parses the information.static String[]
getReleaseInformation(String release)
Parses the release information from the designated string.static Pair<String,Boolean>
getVersionInformation(Class<?> cls)
Gets the version information from the version file that is part of the class bundle containing the designated class.static Comparator<String>
getVersionStringComparatorInstance()
Returns a comparator that can be used to compare version strings like1.5.1
.
-
-
-
Method Detail
-
getVersionStringComparatorInstance
public static Comparator<String> getVersionStringComparatorInstance()
Returns a comparator that can be used to compare version strings like1.5.1
.- Returns:
- a comparator to compare version strings
-
getVersionInformation
public static Pair<String,Boolean> getVersionInformation(Class<?> cls)
Gets the version information from the version file that is part of the class bundle containing the designated class. The first element will be the version string (version, build, build date or not available), the second element indicates whether this is a pre-release and not a final one.- Parameters:
cls
- The class relative to which to load the version file.- Returns:
- The version string (version, build and build date or not available) and whether the version is a pre-release.
-
getParsedVersionInformation
public static SerialisablePair<String,String> getParsedVersionInformation(Class<?> cls)
Gets the version information from the version file that is part of the class bundle containing the designated class and parses the information. The elements will be the version and the build date or<unknown>
if not available.- Parameters:
cls
- The class relative to which to load the version file.- Returns:
- The version and the build date or
<unknown>
if not available. - See Also:
getVersionInformation(Class)
-
getReleaseInformation
public static String[] getReleaseInformation(String release)
Parses the release information from the designated string. This is the string that is printed to console by the applications.- Parameters:
release
- The release information as printed on console.- Returns:
- The version, the prebuild-string (may be
null
) and the build date parsed from the release or 3null
elements if the release information cannot be parsed.
-
-