Package de.aristaflow.adept2.util
Class Version
java.lang.Object
de.aristaflow.adept2.util.Version
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int[]getParsedVersion(String version) Parses a version string consisting of digits separated by.into an integer array whereas each array element is the number represented between the..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 Comparator<int[]>Gets a comparator that can be used to compare parsed version strings like1.5.1(being[1, 5, 1]).static String[]getReleaseInformation(String release) Parses the release information from the designated string.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>Returns a comparator that can be used to compare version strings like1.5.1.
-
Constructor Details
-
Version
public Version()
-
-
Method Details
-
getVersionStringComparatorInstance
Returns a comparator that can be used to compare version strings like1.5.1.- Returns:
- a comparator to compare version strings
-
getParsedVersionStringComparatorInstance
Gets a comparator that can be used to compare parsed version strings like1.5.1(being[1, 5, 1]).- Returns:
- A comparator to compare parsed version strings.
-
getVersionInformation
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
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:
-
getParsedVersion
Parses a version string consisting of digits separated by.into an integer array whereas each array element is the number represented between the.. If one of the parts between the.is no validPATTERN, it will be ignored.- Parameters:
version- The version string which to parse.- Returns:
- The numbers parsed from the designated version string containing digits separated by
.ornullif the designated string contains no.and contains non-digit characters.
-
getReleaseInformation
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 3nullelements if the release information cannot be parsed.
-