約91,000件1ページ目

日本語のみで絞り込む

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

  • 最終更新日:1年以内
  • 2026/2/15 -The map method returns the result of the computation wrapped inside Optional. ... We also learned how to get the value of an Optional, or a default one if ...

    11時間前 -Java Optional map() Method: changes the value with a function and returns the result in a new Optional. Syntax, parameters and an example.

    2025/12/7 -Use Optional for return types when absence is a valid result ; Use ofNullable() instead of of() unless you're 100% sure value is not null ; Chain operations using ...

    2026/8/23 -Use flatMap() when you have an Optional object and the mapping function returns another Optional object. Example 5. For this example, consider a class ...

    2026/9/18 -or() method of the Optional class returns the current Optional when a value is present. If the Optional is empty, it uses the supplied Supplier to obtain ...

    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.

    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/8/22 -The map method applies a function to the contained value when it is present. The function returns an ordinary value, which Java wraps in a new Optional . An ...

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

    4日前 -In the HashMap chapter, you used get() to find a value by its key. But what if the key does not exist? Then get() returns null , which means "no value". If ...