@Test public void testInvalidExpressionSatisfiesShouldReturnFalse() throws Exception { { Version version = new Version("27.0.0"); Assert.assertFalse(version.satisfies("=27.0.0")); } { Version version = new Version("27.0.0"); Assert.assertFalse(version.satisfies("==27.0.0")); } { Version version = new Version("27.0.0"); Assert.assertFalse(version.satisfies(">27.0.0")); } { Version version = new Version("27.0.0"); Assert.assertFalse(version.satisfies("<27.0.0")); } { Version version = new Version("27.0.0"); Assert.assertFalse(version.satisfies("<=27.0.0")); } { Version version = new Version("27.0.0"); Assert.assertFalse(version.satisfies("!=27.0.0")); } { Version version = new Version("27.0.0"); Assert.assertFalse(version.satisfies("27.0.0-prerelease")); } }
public boolean satisfies(String expr) { try { return ExpressionParser.INSTANCE.parse(expr).interpret(this); } catch (ParseException e) { e.printStackTrace(); return false; } }
Version implements Comparable<Version> { public boolean satisfies(String expr) { try { return ExpressionParser.INSTANCE.parse(expr).interpret(this); } catch (ParseException e) { e.printStackTrace(); return false; } } }
Version implements Comparable<Version> { public boolean satisfies(String expr) { try { return ExpressionParser.INSTANCE.parse(expr).interpret(this); } catch (ParseException e) { e.printStackTrace(); return false; } } Version(String version); }
Version implements Comparable<Version> { public boolean satisfies(String expr) { try { return ExpressionParser.INSTANCE.parse(expr).interpret(this); } catch (ParseException e) { e.printStackTrace(); return false; } } Version(String version); boolean satisfies(String expr); int compareTo(Version o); String toString(); boolean equals(Object o); int hashCode(); boolean greaterThan(Version other); boolean greaterThanOrEqualTo(Version other); boolean lessThan(Version other); boolean lessThanOrEqualTo(Version other); }
Version implements Comparable<Version> { public boolean satisfies(String expr) { try { return ExpressionParser.INSTANCE.parse(expr).interpret(this); } catch (ParseException e) { e.printStackTrace(); return false; } } Version(String version); boolean satisfies(String expr); int compareTo(Version o); String toString(); boolean equals(Object o); int hashCode(); boolean greaterThan(Version other); boolean greaterThanOrEqualTo(Version other); boolean lessThan(Version other); boolean lessThanOrEqualTo(Version other);  }