Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@TristonianJones
Copy link
Collaborator

The optional optMap() macro takes an optional value as input and performs a transformation on the value if it has a value.

The following expressions are equivalent:

value.optMap(v, v + 1)
value.hasValue() ? optional.of(value.value() + 1) : optional.none()

@TristonianJones
Copy link
Collaborator Author

PTAL

@TristonianJones TristonianJones merged commit afe0a6c into google:master May 30, 2023
@TristonianJones TristonianJones deleted the optional-macros branch May 30, 2023 19:38
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