@Test public void testInvalidVersionParse() { Assert.assertNull(GuacamoleProtocolVersion.parseVersion("potato")); Assert.assertNull(GuacamoleProtocolVersion.parseVersion("VERSION_")); Assert.assertNull(GuacamoleProtocolVersion.parseVersion("VERSION___")); Assert.assertNull(GuacamoleProtocolVersion.parseVersion("VERSION__2_3")); Assert.assertNull(GuacamoleProtocolVersion.parseVersion("VERSION_1__3")); Assert.assertNull(GuacamoleProtocolVersion.parseVersion("VERSION_1_2_")); Assert.assertNull(GuacamoleProtocolVersion.parseVersion("VERSION_A_2_3")); Assert.assertNull(GuacamoleProtocolVersion.parseVersion("VERSION_1_B_3")); Assert.assertNull(GuacamoleProtocolVersion.parseVersion("VERSION_1_2_C")); Assert.assertNull(GuacamoleProtocolVersion.parseVersion("_1_2_3")); Assert.assertNull(GuacamoleProtocolVersion.parseVersion("version_1_2_3")); }
public static GuacamoleProtocolVersion parseVersion(String version) { Matcher versionMatcher = VERSION_PATTERN.matcher(version); if (!versionMatcher.matches()) return null; return new GuacamoleProtocolVersion( Integer.parseInt(versionMatcher.group(1)), Integer.parseInt(versionMatcher.group(2)), Integer.parseInt(versionMatcher.group(3)) ); }
GuacamoleProtocolVersion { public static GuacamoleProtocolVersion parseVersion(String version) { Matcher versionMatcher = VERSION_PATTERN.matcher(version); if (!versionMatcher.matches()) return null; return new GuacamoleProtocolVersion( Integer.parseInt(versionMatcher.group(1)), Integer.parseInt(versionMatcher.group(2)), Integer.parseInt(versionMatcher.group(3)) ); } }
GuacamoleProtocolVersion { public static GuacamoleProtocolVersion parseVersion(String version) { Matcher versionMatcher = VERSION_PATTERN.matcher(version); if (!versionMatcher.matches()) return null; return new GuacamoleProtocolVersion( Integer.parseInt(versionMatcher.group(1)), Integer.parseInt(versionMatcher.group(2)), Integer.parseInt(versionMatcher.group(3)) ); } GuacamoleProtocolVersion(int major, int minor, int patch); }
GuacamoleProtocolVersion { public static GuacamoleProtocolVersion parseVersion(String version) { Matcher versionMatcher = VERSION_PATTERN.matcher(version); if (!versionMatcher.matches()) return null; return new GuacamoleProtocolVersion( Integer.parseInt(versionMatcher.group(1)), Integer.parseInt(versionMatcher.group(2)), Integer.parseInt(versionMatcher.group(3)) ); } GuacamoleProtocolVersion(int major, int minor, int patch); int getMajor(); int getMinor(); int getPatch(); boolean atLeast(GuacamoleProtocolVersion otherVersion); static GuacamoleProtocolVersion parseVersion(String version); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); }
GuacamoleProtocolVersion { public static GuacamoleProtocolVersion parseVersion(String version) { Matcher versionMatcher = VERSION_PATTERN.matcher(version); if (!versionMatcher.matches()) return null; return new GuacamoleProtocolVersion( Integer.parseInt(versionMatcher.group(1)), Integer.parseInt(versionMatcher.group(2)), Integer.parseInt(versionMatcher.group(3)) ); } GuacamoleProtocolVersion(int major, int minor, int patch); int getMajor(); int getMinor(); int getPatch(); boolean atLeast(GuacamoleProtocolVersion otherVersion); static GuacamoleProtocolVersion parseVersion(String version); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); static final GuacamoleProtocolVersion VERSION_1_0_0; static final GuacamoleProtocolVersion VERSION_1_1_0; static final GuacamoleProtocolVersion LATEST; }