- java.lang.Object
-
- org.wildfly.plugin.tools.VersionComparator
-
- All Implemented Interfaces:
Comparator<String>
public class VersionComparator extends Object implements Comparator<String>
Compares two versions.- Author:
- James R. Perkins
-
-
Constructor Summary
Constructors Constructor Description VersionComparator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(String o1, String o2)static intcompareVersion(String v1, String v2)Compares the first version against the second version.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Method Detail
-
compareVersion
public static int compareVersion(String v1, String v2)
Compares the first version against the second version.- Parameters:
v1- first versionv2- second version- Returns:
0if the versions are equal,-1if version first version is less than the second version or1if the first version is greater than the second version- See Also:
Comparator.compare(Object, Object)
-
compare
public int compare(String o1, String o2)
- Specified by:
comparein interfaceComparator<String>
-
-