日本語のみで絞り込む
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 ...
2020/2/8 -Optional is supposed to change that by forcing the receiver to test. But I still don't feel that has enough value to make the extra complexity ...
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 ...
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, ...
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 ...
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.
2021/5/27 -Optionals are often used unnecessarily as tools to perform local null checks instead of using regular if-else statements.
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.
2025/3/20 -✓ Prevents NullPointerException — Instead of returning null , Optional<> ensures the absence of a value is handled gracefully. ✓ Improves ...
If a value is present, apply the provided mapping function to it, and if the result is non-null, return an Optional describing the result. Otherwise return an ...