@Test public void simpleTest() throws Exception { ReflectivePredicateEvaluator evaluator = new ReflectivePredicateEvaluator( "SELECT anInt = 1 FROM myInterface", MyInterface.class); Assert.assertTrue(evaluator.evaluate(new MyImplementation(1, "foo"))); Assert.assertFalse(evaluator.evaluate(new MyImplementation(2, "foo"))); Assert.assertTrue(evaluator.evaluate("SELECT anInt = 1 OR aString = 'foo' FROM myInterface", new MyImplementation(1, "bar"))); Assert.assertTrue(evaluator.evaluate("SELECT anInt = 1 OR aString = 'foo' FROM myInterface", new MyImplementation(2, "foo"))); Assert.assertFalse(evaluator.evaluate("SELECT anInt = 1 OR aString = 'foo' FROM myInterface", new MyImplementation(2, "bar"))); }
public boolean evaluate(Object... objects) throws SQLException{ return evaluate(Lists.newArrayList(objects), null); }
ReflectivePredicateEvaluator implements Closeable { public boolean evaluate(Object... objects) throws SQLException{ return evaluate(Lists.newArrayList(objects), null); } }
ReflectivePredicateEvaluator implements Closeable { public boolean evaluate(Object... objects) throws SQLException{ return evaluate(Lists.newArrayList(objects), null); } ReflectivePredicateEvaluator(String sql, Class<?>... referenceInterfaces); }
ReflectivePredicateEvaluator implements Closeable { public boolean evaluate(Object... objects) throws SQLException{ return evaluate(Lists.newArrayList(objects), null); } ReflectivePredicateEvaluator(String sql, Class<?>... referenceInterfaces); boolean evaluate(Object... objects); boolean evaluate(String sql, Object... objects); boolean evaluate(List<Object> objects); boolean evaluate(List<Object> objects, String sql); @Override void close(); }
ReflectivePredicateEvaluator implements Closeable { public boolean evaluate(Object... objects) throws SQLException{ return evaluate(Lists.newArrayList(objects), null); } ReflectivePredicateEvaluator(String sql, Class<?>... referenceInterfaces); boolean evaluate(Object... objects); boolean evaluate(String sql, Object... objects); boolean evaluate(List<Object> objects); boolean evaluate(List<Object> objects, String sql); @Override void close();  }