by mbizzle88 · 10y ago · 0 comments
That's inaccurate. In fact Optional makes this situation (having to check if data is not null and valid) even easier, because you can simply filter/map the value without having to first check that it is non-null. For example:
possibleResult.filter(res -> isValid(res))
.ifPresent(res -> doSomething(res));No comments yet.