'CompletableFuture<List<CardItem>> to Mono object

i have an api that returns CompletableFuture

where CardItem{ cardType cardStatus cardDetails }

but i'd like to iterate through the CompletableFuture and build a parent children object class where if cardType = Header is the parent. and the rest of the CardItems are children.

like Mono

where CardItemRO { cardType= header cardStatus cardDetails List }



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source