2 ms·
The code ends up looking like: Optional<Integer> foo; //.... if (foo != null) { foo.and_then(new Consumer () { function accept(Intege
by richardwhiuk 6y ago
The code ends up looking like:
Optional<Integer> foo;
//....
if (foo != null) {
foo.and_then(new Consumer () {
function accept(Integer foo) {
}
});
}
- karmakaze 6y agoI would never assign null to an Optional nor use a library that returned one. To ensure assignment before use make it final.