li.strolch.search.predicates.ContainsPredicate Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of agent Show documentation
Show all versions of agent Show documentation
Strolch Agent which is the runtime for Strolch
The newest version!
package li.strolch.search.predicates;
import li.strolch.utils.ObjectHelper;
/**
* Implements the contains predicate, delegating to {@link ObjectHelper#contains(Object, Object, boolean, boolean)}
*/
public class ContainsPredicate extends AbstractSearchPredicate {
private final boolean ignoreCase;
private final boolean matchAny;
public ContainsPredicate(Object right, boolean ignoreCase, boolean matchAny) {
super(right);
this.ignoreCase = ignoreCase;
this.matchAny = matchAny;
}
@Override
public boolean matches(Object left) {
return ObjectHelper.contains(left, this.right, this.ignoreCase, !this.matchAny);
}
}