@Test public void shouldBeAbleToExtractWithBuild() throws Exception { Version version = VersionUtil.extract("1.2.50.A"); Assert.assertEquals(1, version.getMajor()); Assert.assertEquals(2, version.getMinor()); }
public static Version extract(String version) { if (version == null || !version.matches(expression)) { return new Version(0, 0); } return new Version( Integer.parseInt(version.replaceAll(expression, "$1")), Integer.parseInt(version.replaceAll(expression, "$2"))); }
VersionUtil { public static Version extract(String version) { if (version == null || !version.matches(expression)) { return new Version(0, 0); } return new Version( Integer.parseInt(version.replaceAll(expression, "$1")), Integer.parseInt(version.replaceAll(expression, "$2"))); } }
VersionUtil { public static Version extract(String version) { if (version == null || !version.matches(expression)) { return new Version(0, 0); } return new Version( Integer.parseInt(version.replaceAll(expression, "$1")), Integer.parseInt(version.replaceAll(expression, "$2"))); } private  VersionUtil(); }
VersionUtil { public static Version extract(String version) { if (version == null || !version.matches(expression)) { return new Version(0, 0); } return new Version( Integer.parseInt(version.replaceAll(expression, "$1")), Integer.parseInt(version.replaceAll(expression, "$2"))); } private  VersionUtil(); static Version extract(String version); static boolean isGreaterThenOrEqual(String greater, String then); static boolean isGreaterThenOrEqual(Version greater, Version then); static boolean isLessThenOrEqual(String less, String then); static boolean isLessThenOrEqual(Version less, Version then); }
VersionUtil { public static Version extract(String version) { if (version == null || !version.matches(expression)) { return new Version(0, 0); } return new Version( Integer.parseInt(version.replaceAll(expression, "$1")), Integer.parseInt(version.replaceAll(expression, "$2"))); } private  VersionUtil(); static Version extract(String version); static boolean isGreaterThenOrEqual(String greater, String then); static boolean isGreaterThenOrEqual(Version greater, Version then); static boolean isLessThenOrEqual(String less, String then); static boolean isLessThenOrEqual(Version less, Version then);  }