public class VersionUtils extends Object
Constructor and Description |
---|
VersionUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
areVersionsEqual(String version1,
String version2,
boolean allowEmptyVersions)
Compares two version for equality, allows empty versions
|
static int |
compareVersions(String version1,
String version2)
Compares two versions strings of the form N.N.N.N
|
static int |
compareVersions(String version1,
String version2,
boolean allowEmptyVersions)
Compares two versions strings of the form N.N.N.N
|
static int |
compareVersions(String version1,
String version2,
int maxLengthToCompare)
Compares two versions strings of the form N.N.N.N
|
static String |
getVersionSubstring(String version)
Return N.N.N from N.N.N.xyz
|
public static int compareVersions(String version1, String version2, int maxLengthToCompare) throws IllegalArgumentException
version1
- version2
- maxLengthToCompare
- The maximum length to compare - 2 means only Major and Minor
0 to compare the whole version stringsIllegalArgumentException
public static int compareVersions(String version1, String version2, boolean allowEmptyVersions)
version1
- version2
- allowEmptyVersions
- Allow one or both version values to be null or empty stringpublic static int compareVersions(String version1, String version2)
version1
- version2
- public static boolean areVersionsEqual(String version1, String version2, boolean allowEmptyVersions)
version1
- version2
- allowEmptyVersions
- Allow one or both version values to be null or empty stringCopyright © 2017. All rights reserved.