Created
June 12, 2014 09:36
-
-
Save alorma/48f7cd6fc4bb69209e34 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private boolean checkMinVersion(String currentVersion) { | |
int[] currentVersionInts = convertToIntArray(currentVersion); | |
int[] minVersionInts = convertToIntArray(minimunVersion); | |
if ((currentVersionInts != null && currentVersionInts.length == 3) && | |
(minVersionInts != null && minVersionInts.length == 3)) { | |
int majorC = currentVersionInts[0]; | |
int minorC = currentVersionInts[1]; | |
int patchC = currentVersionInts[2]; | |
int majorM = minVersionInts[0]; | |
int minorM = minVersionInts[1]; | |
int patchM = minVersionInts[2]; | |
boolean isMajor = majorC >= majorM; | |
boolean isMinor = minorC >= minorM; | |
boolean isPatch = patchC >= patchM; | |
return isMajor && isMinor && isPatch; | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment