Skip to content

Why don't you support...

Todd Ginsberg edited this page Jan 26, 2025 · 5 revisions

A list of ideas and why Gatherers4j does not currently support them.

firstBy(fn)

Because this can be done with existing functions:

Stream.of("A", "B")
    .filter(it -> it.length() == 1)
    .findFirst();

// Optional["A"]

lastBy(fn)

Because this can be done with existing functions:

Stream.of("A", "B")
    .filter(it -> it.length() == 1)
    .gather(Gatherers4j.last(1))
    .toList();

// ["B"]

mapWithOriginal(fn)

Mapping and including the original can be done with map:

Stream.of("A", "B")
    .map(it -> new WithOriginal(it, it.toLowerCase())
    .toList();

// [WithOrginal("A", "a"), WithOriginal("B", "b")]

dropUntil(fn)

To go with `takeUntil(fn), which is supported.

Because this can be implemented with standard JDK functions:

Stream.of(1, 2, 3, 4, 5)
    .dropWhile(it -> it < 3).skip(1)
    .toList();

// [4, 5]
Clone this wiki locally