Created
April 17, 2021 14:57
-
-
Save zivce/e7b075a8d21b83454a4bbd92b8c288c3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getValue(x).orElse(getValue(y) | |
.orElseThrow(() -> new NotFoundException("value not present"))); | |
public Optional<Value> getValue(Source s) | |
{ | |
System.out.println("Source: " + s.getName()); | |
// returns value from s source | |
} | |
// when getValue(x) is present system will output | |
Source: x | |
Source: y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment