org.kuali.common.util
Class VersionUtils
java.lang.Object
org.kuali.common.util.VersionUtils
public class VersionUtils
- extends Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MAVEN_SNAPSHOT_TOKEN
public static final String MAVEN_SNAPSHOT_TOKEN
- See Also:
- Constant Field Values
VersionUtils
public VersionUtils()
isSnapshot
public static final boolean isSnapshot(String version)
- Return true if
version
ends with -SNAPSHOT
or .SNAPSHOT
(case insensitive).
trimSnapshot
public static final String trimSnapshot(String version)
- Return
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
getVersion
public static final Version getVersion(String version)
- Parse a
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 qualifier
getQualifier
protected static final String getQualifier(String trimmed,
String[] tokens)
Copyright © 2010-2013 The Kuali Foundation. All Rights Reserved.