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

li.strolch.search.predicates.CollectionContainsPredicate Maven / Gradle / Ivy

The newest version!
package li.strolch.search.predicates;

import li.strolch.utils.ObjectHelper;

/**
 * Implements the contains predicate, delegating to {@link ObjectHelper#isIn(Object, Object, boolean)}
 */
public class CollectionContainsPredicate extends AbstractSearchPredicate {
	private final boolean ignoreCase;

	public CollectionContainsPredicate(Object right, boolean ignoreCase) {
		super(right);
		this.ignoreCase = ignoreCase;
	}

	@Override
	public boolean matches(Object left) {
		return ObjectHelper.isIn(this.right, left, this.ignoreCase);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy