public class VersionComparator extends Object implements Comparator<Version>, Serializable
Version.
You may be before this the documentation of Version object...
Version.NumberVersionComponant).
String componants use preRelease flag order (preRelease is before any other string componant) then natural character ordering of the lowerCase componant value. (see Version.StringVersionComponant).
alpha == Alpha, aa > rc
snapshot version is before the exact same version without the flag.
1.1-SNAPSHOT < 1.1
1 < 1.0If the next componant is a classifier, we consider the componant
preRelease flag,
if setted then the longuest version is before the other one, if no, after:
1-alpha < 1 < 1-aa
0-SNAPSHOT 0 0.1 0.2 0.2-alpha 0.2-alpha-1 0.2-alpha-2-SNAPSHOT 0.2-alpha-2 0.2-beta 0.2-beta-1 0.2-rc-1 0.2 0.2-aaCreated on 7/11/14.
Version,
Serialized Form| Constructor and Description |
|---|
VersionComparator() |
| Modifier and Type | Method and Description |
|---|---|
int |
compare(Version o1,
Version o2) |
static void |
main(String... args)
Sort in reverse order the given versions and print them to the standard output.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitequalsCopyright © 2016 CodeLutin. All rights reserved.