約41,600件1ページ目

日本語のみで絞り込む

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

  • 最終更新日:1年以内
  • 2025/12/10 -The key goal is to return a value wrapped in an Optional to explicitly signal that it might be absent. This avoids returning null directly and provides fluent ...

    2026/2/26 -The Optional type was introduced in Java 8. It provides a clear and explicit way to convey the message that there may not be a value, without using null.

    2026/4/13 -Optional is not a null eliminator — it is an API contract: a method that returns Optional<T> is telling callers explicitly that no value may exist, forcing them ...

    2026/6/30 -If a method is designed to return null , it is suggested to mark it with the @Nullable annotation - such methods will be ignored by this inspection. Example: ...

    1日前 -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.

    5時間前 -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 ...

    2025/12/8 -The ofNullable() method works the same as of() , except that instead of throwing a NullPointerException , a null value produces an empty . The Kotlin equivalent ...

    2025/12/7 -Optional is a container object that may or may not contain a non-null value. It's designed to represent "optional" return values and avoid NullPointerException ...

    2026/2/15 -This method returns true if the wrapped value is not null. Also, as of Java 11, we can do the opposite with the isEmpty method: @Test public void ...