Package io.bdeploy.common.util
Class VersionHelper
java.lang.Object
io.bdeploy.common.util.VersionHelper
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic intCompares the two versions takingnullinto account.static intParses and compares the two version object.static booleanCompares whether or not the two versions are equal.static Propertiesstatic Versionstatic Stringstatic booleanReturns whether or not the currently running version is undefined.static booleanisUndefined(Version version) Returns whether or not the given version represents the undefined version.static VersionParses the given string into a version.static VersionTries to parse the given string into a version object.
-
Field Details
-
UNDEFINED
-
-
Method Details
-
getVersion
-
getVersionAsString
-
getProperties
-
compare
Parses and compares the two version object. An exception is thrown if one of the strings does not represent a valid version.- Parameters:
a- first version to compareb- second version to compare- Returns:
- a negative integer, zero, or a positive integer as this version is less than, equal to, or greater than the specified version.
-
compare
Compares the two versions takingnullinto account. If both versions arenullthen they are assumed to be equal. Otherwisenullis treated as lower than any other version.- Parameters:
a- first version to compareb- second version to compare- Returns:
- a negative integer, zero, or a positive integer as this version is less than, equal to, or greater than the specified version.
-
equals
Compares whether or not the two versions are equal. -
parse
Parses the given string into a version. Throws an exception if parsing fails.- Parameters:
v- the string to parse- Returns:
- the version object. Never
null
-
tryParse
Tries to parse the given string into a version object.- Parameters:
v- the string to parse- Returns:
- the version object or
nullin case that the string is not a version
-
isRunningUndefined
public static boolean isRunningUndefined()Returns whether or not the currently running version is undefined. Typically happens when starting the minion in the development environment. -
isUndefined
Returns whether or not the given version represents the undefined version.
-