com.link_intersystems.util.TransformedPredicate Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lis-commons-util Show documentation
Show all versions of lis-commons-util Show documentation
Link Intersystems Commons Util (lis-commons-util) is collection of reusable software components
that extend the standard java.util components.
package com.link_intersystems.util;
import java.util.function.Predicate;
/**
* @author René Link {@literal }
*/
public class TransformedPredicate implements Predicate {
private Transformer transformer;
private Predicate resultPredicate;
public TransformedPredicate(Transformer transformer, Predicate resultPredicate) {
this.transformer = transformer;
this.resultPredicate = resultPredicate;
}
@Override
public boolean test(S t) {
T transformed = transformer.transform(t);
return resultPredicate.test(transformed);
}
}