public final class VersionUtil extends Object
Modifier and Type | Field and Description |
---|---|
static Pattern |
VERSION_PATTERN
The version must begin with a bloc of numbers, and then it can have one
or more bloc of numbers separated by '.' and then it can have alpha
numeric bloc separated by '.' or '-'
|
Modifier and Type | Method and Description |
---|---|
static int |
compare(String versionLeft,
String versionRight)
Compare 2 versions
|
static boolean |
isSnapshot(String version)
Check if a version is a SNAPSHOT (development) version.
|
static boolean |
isValid(String version)
Check if a version is valid
|
static Version |
parseVersion(String version)
Parse the version's text to produce a comparable version object
|
public static final Pattern VERSION_PATTERN
public static boolean isSnapshot(String version)
version
- The actual version string.public static boolean isValid(String version)
version
- version string to parsepublic static Version parseVersion(String version)
version
- version text to parseApplicationVersionException
- if the version text is not following the defined version
patternCopyright © 2017. All rights reserved.