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

org.openclover.util.function.Predicates Maven / Gradle / Ivy

Go to download

Clover is an award winning code coverage and testing tool for Java and Groovy. It integrates easily with Maven, Ant, Grails, Eclipse and IntelliJ IDEA as well as with continuous integration servers such as Bamboo, Jenkins or Hudson. Note: before Clover 4.0 this artifact was named com.cenqua.clover:clover.

The newest version!
package org.openclover.util.function;

/**
 * @deprecated Will be replaced by {@see java.util.function.Predicate#negate()} once JDK7 is dropped.
 */
public abstract class Predicates {
    public static  Predicate negate(Predicate predicate) {
        return new Not(predicate);
    }

    private static class Not implements Predicate {
        private final Predicate predicate;

        public Not(Predicate predicate) {
            this.predicate = predicate;
        }

        @Override
        public boolean test(S data) {
            return !predicate.test(data);
        }
    }
}