約120件1ページ目

日本語のみで絞り込む

2015/3/2 -An Optional always contains a non-null value or is empty, yes, but you don't have an Optional, you have a reference of type Optional ...

2017/6/14 -If null handling is very important, use an Optional. If null is a valid return that does not indicate unavailability or failure, use an Optional ...

2026/2/26 -While we can use Optional type as a hint that there might be no non-null value, we should be careful not to overuse the Optional return type, ...

2016/2/3 -Optional is used with the convention that methods with return type Optional never return null and usually also with the (less strong) convention ...

2025/3/20 -✓ Prevents NullPointerException — Instead of returning null , Optional<> ensures the absence of a value is handled gracefully. ✓ Improves ...

2023/2/1 -For example, if you have a method that returns a value that might be null, you can return an Optional instead and then use Optional methods to ...

2021/5/27 -Optionals are often used unnecessarily as tools to perform local null checks instead of using regular if-else statements.

2019/6/7 -The basic concept of Optional is to prevent null value references, by providing an alternative values instead of the null value. Consider this ...

2022/2/6 -A look at how Optional works, and how it isn't really about Null values - at least not if you were doing it right before Optional.

The Null Object pattern is The Correct Answer (for Java like languages). Java's Optional is a bad idea implemented badly made even more bad by bad usage.