io.github.geraldnguyen.excel.Predicates Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of excel-formula Show documentation
Show all versions of excel-formula Show documentation
Implementation of popular excel formula in Java
The newest version!
package io.github.geraldnguyen.excel;
import lombok.NonNull;
import java.util.function.Predicate;
public class Predicates {
public static Predicate isEqual(@NonNull T constant) {
return Predicate.isEqual(constant);
}
public static Predicate isTrue() {
return isEqual(Boolean.TRUE);
}
public static Predicate isFalse() {
return isEqual(Boolean.FALSE);
}
public static Predicate notEqual(@NonNull T constant) {
return Predicate.not(Predicate.isEqual(constant));
}
public static > Predicate greaterThan(@NonNull T constant) {
return t -> t.compareTo(constant) > 0;
}
public static > Predicate greaterThanOrEqual(@NonNull T constant) {
return t -> t.compareTo(constant) >= 0;
}
public static > Predicate lessThan(@NonNull T constant) {
return t -> t.compareTo(constant) < 0;
}
public static > Predicate lessThanOrEqual(@NonNull T constant) {
return t -> t.compareTo(constant) <= 0;
}
public static Predicate startWith(@NonNull String constant) {
return s -> s.startsWith(constant);
}
}