All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.wavefront.predicates.ExpressionPredicate Maven / Gradle / Ivy

There is a newer version: 2023-22.3
Show newest version
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