Skip to content

Conversation

MuH3gPaB
Copy link

  • zipMap (1,2)
  • some Optional methods with only get and isPresent usage

+ some Optional methods with only get and isPresent usage

public static <T1, T2, R> Optional<R> zipMap2(Optional<T1> o1, Optional<T2> o2, BiFunction<T1, T2, R> f) {
return o1.flatMap(
t1 -> o2.flatMap(
Copy link
Contributor

@senia-psm senia-psm Jun 23, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use map here. optional.map(f) returns empty option in case of null result of f.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants