約18,700件1ページ目

日本語のみで絞り込む

条件を指定して検索しています。すべての条件を解除する

  • 最終更新日:3か月以内
  • 2日前 -The most common Optional anti-pattern is wrapping a potentially null value in an Optional , only to immediately invoke .get() without checking if a value is ...

    2026/9/24 -If the value is null, it returns an empty Optional instead. It is useful when a value might be null and needs to be represented using Optional. Unlike Optional.

    8時間前 -The ofNullable() method returns an Optional that holds the value. If the value is null , it returns an empty Optional . Use it when the value can be null ...

    2026/8/20 -When you see a method returning Optional , it serves as a reminder that the method might return an empty value and we need to be prepared for it. The original ...

    2026/9/16 -A method that returns Optional must never return null . An empty result already has a representation: Optional.empty() . Returning null instead of an empty ...

    2026/9/23 -Learn when Java Optional hides domain meaning and how sealed classes and explicit result types can make your code safer and clearer.

    4日前 -It can return null, or it can return a special empty value. Null is the default in the Java, and it is unchecked. Nothing in the type system warns you that ...

    2026/10/10 -The orElse() method accepts null as the default, and orElseGet() returns whatever the supplier returns, including null. A null supplier is different, because ...

    2026/10/1 -Using null to represent a missing value requires explicit null checks. If these checks are missed, accessing the value can result in a NullPointerException.

    5日前 -When used as intended it can't because it's a return value. Code that returns null instead of Optional breaks contract and must fail it's own tests. Like.