Somnath Musib
1 min readFeb 9, 2020

--

Hi Rashmi Shehana

Thanks for your response. As per the specification, the purpose of orElseGetis to invoke the supplier interface to retrieve a value if the optional does not contain a value. The main observation here is that the supplier is invoked iff the optional does not contain any value. Thus, it has little to do with async nature we see in promise.

--

--

Somnath Musib
Somnath Musib

Written by Somnath Musib

4X AWS | Staff Software Engineer, Cloud Architect | Author "Spring Boot In Practice" | Find more at https://musibs.github.io

No responses yet