Add Flow#collectNonNull operator
Open
t:stream
- Dominant language
- Scala
- Stars
- 1.6k
- Forks
- 211
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 89
Description
This operator is been used in Spring ai, and I think it's actually useful than a map to Optional/Option and a then filter/collect
```java
return doGetObservableFluxChatResponse(this.request)
.mapNotNull(ChatClientResponse::chatResponse)
.map(r -> Optional.ofNullable(r.getResult())
.map(Generation::getOutput)
.map(AbstractMessage::getText)
.orElse(""))
.filter(StringUtils::hasLength);
```
Contributor guide
Assessment
This issue has not been assessed yet.