public class VersionComparator extends Object implements Comparator<String>
.
(dots).
Date: 09.11.2011Modifier and Type | Field and Description |
---|---|
static VersionComparator |
INSTANCE |
Modifier and Type | Method and Description |
---|---|
int |
compare(String o1,
String o2) |
static int |
compareVersion(String version1,
String version2)
Compares the first version to the second version and returns, 0 if they are equal, a value less than 0 if the
first version is less than the second version or a value greater than 0 if the first version is greater than
the second version.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public static VersionComparator INSTANCE
public static int compareVersion(String version1, String version2)
version1
- the first version to compare.version2
- the second version to compare.version1
is less than version2
,
a value greater than 0 if version1
is greater than version2
.public int compare(String o1, String o2)
compare
in interface Comparator<String>
Copyright © 2023 JBoss by Red Hat. All rights reserved.