functionalj.stream.collect.DerivedCollectorToBooleanPlus Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of functionalj-core Show documentation
Show all versions of functionalj-core Show documentation
The module for FunctionalJ Core.
package functionalj.stream.collect;
import java.util.Set;
import java.util.function.BiConsumer;
import java.util.function.BinaryOperator;
import java.util.function.DoubleFunction;
import java.util.function.Function;
import java.util.function.IntFunction;
import java.util.function.LongFunction;
import java.util.function.ObjDoubleConsumer;
import java.util.function.ObjIntConsumer;
import java.util.function.ObjLongConsumer;
import java.util.function.Predicate;
import java.util.function.Supplier;
import java.util.stream.Collector;
import java.util.stream.Collector.Characteristics;
import functionalj.stream.doublestream.collect.DoubleCollectorToBooleanPlus;
import functionalj.stream.intstream.collect.IntCollectorToBooleanPlus;
import functionalj.stream.longstream.collect.LongCollectorToBooleanPlus;
import lombok.val;
abstract public class DerivedCollectorToBooleanPlus {
final CollectorToBooleanPlus, ACCUMULATED> collector;
protected DerivedCollectorToBooleanPlus(CollectorToBooleanPlus, ACCUMULATED> collector) {
this.collector = collector;
}
public Supplier supplier() {
return collector.supplier();
}
public BinaryOperator combiner() {
return collector.combiner();
}
public Predicate finisherToBoolean() {
return collector.finisherToBoolean();
}
public Function finisher() {
return a -> finisherToBoolean().test(a);
}
public Set characteristics() {
return collector.characteristics();
}
//== Implementations ==
public static class FromObj
extends DerivedCollectorToBooleanPlus
implements CollectorToBooleanPlus {
private final Function mapper;
public