com.github.andyshao.util.function.PredicateOperation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Gear Show documentation
Show all versions of Gear Show documentation
Enhance and formating the coding of JDK
The newest version!
package com.github.andyshao.util.function;
import com.github.andyshao.lang.Convert;
import java.util.function.Predicate;
/**
*
* Title:
* Descript:
* Copyright: Copryright(c) Nov 1, 2019
* Encoding: UNIX UTF-8
*
* @author Andy.Shao
*
*/
public final class PredicateOperation {
private PredicateOperation() {
throw new AssertionError("Does not support construction");
}
/**
* lambda
* @param predicate {@link Predicate}
* @return origin {@link Predicate}
* @param data type
*/
public static final Predicate lambda(Predicate predicate) {
return predicate;
}
/**
* negate operation
* @param predicate {@link Predicate}
* @return negate {@link Predicate}
* @param data type
*/
public static final Predicate negate(Predicate predicate) {
return predicate.negate();
}
/**
* {@link Convert} to {@link Predicate}
* @param convert {@link Convert}
* @return {@link Predicate}
* @param data type
*/
public static final Predicate predicate(Convert convert) {
return t -> convert.convert(t);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy