public class VersionUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
MAVEN_SNAPSHOT_TOKEN |
| Constructor and Description |
|---|
VersionUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
asSanitizedString(Version version)
2.4.0-beta1-SNAPSHOT -> 240BETA1
|
protected static String |
getQualifier(String trimmed,
String[] tokens) |
static String |
getSanitizedQualifier(String qualifier)
Convert dots and dashes to underscores and convert to uppercase
|
static Version |
getVersion(String version)
Parse a
Version object from the version string. |
static boolean |
isSnapshot(String version)
Return true if
version ends with -SNAPSHOT or .SNAPSHOT (case insensitive). |
protected static String |
sanitize(String s)
Convert dots and dashes to underscores and convert to uppercase
|
static String |
trimSnapshot(String version)
Return
version with .SNAPSHOT or -SNAPSHOT removed from the end (if present) |
public static final String MAVEN_SNAPSHOT_TOKEN
public VersionUtils()
public static final boolean isSnapshot(String version)
version ends with -SNAPSHOT or .SNAPSHOT (case insensitive).public static final String trimSnapshot(String version)
version with .SNAPSHOT or -SNAPSHOT removed from the end (if present)
1.0.0-SNAPSHOT returns 1.0.0 1.0.0.SNAPSHOT returns 1.0.0 1.0.0 returns 1.0.0 1.0.0SNAPSHOT returns 1.0.0SNAPSHOT
public static final Version getVersion(String version)
Version object from the version string. The logic here is crudely simple. First SNAPSHOT is trimmed off the end of the string
(if it exists). Whatever remains is then split into tokens using . and - as delimiters. The first 3 tokens encountered are major,
minor, and incremental, respectively. Anything after that is the qualifierpublic static String asSanitizedString(Version version)
protected static String sanitize(String s)
public static final String getSanitizedQualifier(String qualifier)
protected static final String getQualifier(String trimmed, String[] tokens)
Copyright © 2010–2014 The Kuali Foundation. All rights reserved.