java.lang.Object
nextapp.echoservlet.util.Version
- public final class Version
- extends java.lang.Object
Utility class for comparing version numbers in String format. This class
may be used to determine if a version number is greater than another to
make a hypothesis about whether the version is compatible with a
requirement.
|
Constructor Summary |
private |
Version()
Non-instantiable class. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Version
private Version()
- Non-instantiable class.
meetsRequirement
public static final boolean meetsRequirement(java.lang.String requiredVersion,
java.lang.String testVersion)
- Tests to see if a version number meets or exceeds a requirement.
For example, if version 1.4 is required, 1.4, 1.4.0, 1.4.1, 1.5,
and 2.0 would meet the requirement. 0.7, 1, 1.0, 1.3, and
1.3.5 would not. Warning: At this time all versions must be numeric and
separated by periods. Any deviation will result in .0 versions, such as
1.5.3b being calculated as 1.5.0.
getTokenValue
private static final int getTokenValue(java.lang.String token)
- Returns a best guess translation of a string to an integer.
If the string is not numeric, zero is returned.