-
Enhancement
-
Resolution: Done
-
Major
-
None
-
None
-
2020 Week 07-09 (from Feb 10)
-
5
-
NEW
-
NEW
This might work:
public final class ConstraintCollectors { public static <A> UniConstraintCollector<A, ?, List<A>> toList() { return new DefaultUniConstraintCollector<>( () -> new ArrayList<A>(), (resultContainer, a) -> { resultContainer.add(a); return (() -> resultContainer.remove(a)); }, resultContainer -> resultContainer); }
I doubt if the order of the list is stable... but it should be... even incrementally.
Maybe we should just do a Set instead? But then we'll need to keep track of the number of additions per element.
PS: we'll also want
public static <A, Property_> UniConstraintCollector<A, ?, List<Property_>> toList(Function<A,Property_> groupValueMapping)
- is cloned by
-
PLANNER-1863 ConstraintStreams: Add collector for toMap()
- Resolved