約3,460件1ページ目

日本語のみで絞り込む

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

  • 最終更新日:1年以内
  • 2026/2/15 -The purpose of the class is to provide a type-level solution for representing optional values instead of null references. To get a deeper understanding of why ...

    2026/4/13 -Any method that previously returned null to indicate "not found" is a candidate for Optional. Map.getOrDefault(key, defaultValue) and Map.compute() are ...

    2026/9/24 -The ofNullable() method of the Optional class creates an Optional containing the specified value when it is non-null. If the value is null, it returns an empty ...

    2025/12/8 -The map() method allows you to transform an Optional to an Optional of another value. The equivalent in Kotlin is let() . Since our example uses a nullable ...

    2026/10/10 -Java Optional guide with examples of of, ofNullable, map, flatMap, orElseThrow, isEmpty, stream and or, plus where not to use Optional.

    2025/12/23 -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/5/1 -In this article, we will walk through the common mistakes developers make with Java's Optional and how to use it correctly in real-world projects.

    2026/11/20 -Reports uses of Optional.ofNullable() where always null or always not-null argument is passed. There's no point in using Optional.ofNullable() in this case: ...

    2026/5/30 -Optional belongs in method return types for values that might be absent — use orElseThrow() , orElse() , map() , and ifPresentOrElse() to handle the absent case ...

    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 ...