2 ms·
orElseThrow does return a String, not an Optional. You also could use orElse(null) or orElse("null") depending on the use case (eg. using as a part of toString)
by chopin 7y ago
orElseThrow does return a String, not an Optional. You also could use orElse(null) or orElse("null") depending on the use case (eg. using as a part of toString).
- oftenwrong 7y agoI'm useless without a compiler to check my types!