Skip to content

Commit 8146f34

Browse files
committed
Major refactor to the packages and include the gatherer.
1 parent b2401d6 commit 8146f34

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

src/test/java/com/github/streams/learn/b_advanced/gatherers/B_What is gatherer.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,5 @@
22

33
- The **Gatherer** is a new **intermediate operation** introduced to the `java.util.stream.Stream` API in **Java 22**.
44

5-
- Gatherer provides a way to implement **custom intermediate operations** that go beyond the fixed one-to-one (`map`), one-to-zero/one (`filter`), and one-to-many (`flatMap`) transformations.
6-
75
- It's designed to solve problems that were previously cumbersome or awkward to handle with the existing API by allowing the operation to maintain **internal state** and inspect **multiple upstream elements** before producing an output.
86
-
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
When to use Custom Gatherers?
2+
3+
1. When you're not able to solve the problem using filter, map or flatMap.
4+
2. When there exists no solution in the Gatherers even in latest JDK.
5+
3. When you're sure that's what you need.

src/test/java/com/github/streams/learn/b_advanced/gatherers/C_When to use gatherer.md

Whitespace-only changes.

0 commit comments

Comments
 (0)