@Test public void testApply() { Resource resource = new ResourceImpl(Resource.Type.HostComponent); String propertyId = PropertyHelper.getPropertyId("category1", "foo"); EqualsPredicate predicate = new EqualsPredicate<String>(propertyId, "bar"); NotPredicate notPredicate = new NotPredicate(predicate); resource.setProperty(propertyId, "monkey"); Assert.assertTrue(notPredicate.evaluate(resource)); resource.setProperty(propertyId, "bar"); Assert.assertFalse(notPredicate.evaluate(resource)); }
@Override public boolean evaluate(Resource resource) { return !getPredicate().evaluate(resource); }
NotPredicate extends UnaryPredicate { @Override public boolean evaluate(Resource resource) { return !getPredicate().evaluate(resource); } }
NotPredicate extends UnaryPredicate { @Override public boolean evaluate(Resource resource) { return !getPredicate().evaluate(resource); } NotPredicate(Predicate predicate); }
NotPredicate extends UnaryPredicate { @Override public boolean evaluate(Resource resource) { return !getPredicate().evaluate(resource); } NotPredicate(Predicate predicate); @Override boolean evaluate(Resource resource); @Override String getOperator(); }
NotPredicate extends UnaryPredicate { @Override public boolean evaluate(Resource resource) { return !getPredicate().evaluate(resource); } NotPredicate(Predicate predicate); @Override boolean evaluate(Resource resource); @Override String getOperator();  }