日本語のみで絞り込む
A container object which may or may not contain a non-null value. If a value is present, isPresent() will return true and get() will return the value.
2025/7/12 -The isPresent() method of the java.util.Optional class is used to check if a value is present in the Optional object.
2016/11/24 -The value of Optional is it's rich api to deal with the empty case in a safe way, e.g. .map() , .ifPresent() , etc.
2024/4/1 -In Java's Optional class, isPresent() and isEmpty() are methods used to check the presence of a value within an Optional object. isPresent(). It ...
2026/2/15 -Note that we used the isPresent() method to check if there is a value inside the Optional object. A value is present only if we have created ...
2019/11/22 -Optional.isPresent() は、値が存在する場合は true 、存在しない場合は false を返すメソッドです。 if~else文と組み合わせて使うことで、従来のnull ...
2026/2/5 -One thing worth keeping in mind: isPresent() makes no distinction about what the value is. An Optional containing an empty string, a zero, or a ...
You should do this by checking if the Optional is present using methods like isPresent() or by using methods like orElse() or orElseGet() to provide a default ...
2022/7/12 -With Optional, you can choose to get its value only if it is present, return a default value if the object that it holds is not present or null ...
2016/4/28 -I love to use optionals that way isPresent() or ifPresent(Runnable) are another great way of dealing with things. If we get rid of get() we may ...