com.wavefront.predicates.ExpressionPredicate Maven / Gradle / Ivy
package com.wavefront.predicates;
import java.util.function.Predicate;
import static com.wavefront.predicates.PredicateEvalExpression.isTrue;
/**
* {@link PredicateEvalExpression} to {@link Predicate} adapter.
*
* @author [email protected].
*/
public class ExpressionPredicate implements Predicate {
private final PredicateEvalExpression wrapped;
public ExpressionPredicate(PredicateEvalExpression wrapped) {
this.wrapped = wrapped;
}
@Override
public boolean test(T t) {
return isTrue(wrapped.getValue(t));
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy