public class Optional<T> extends Object implements Serializable
| Modifier and Type | Method and Description |
|---|---|
static <T> Optional<T> |
empty() |
boolean |
equals(Object obj) |
T |
get() |
int |
hashCode() |
void |
ifPresent(java.util.function.Consumer<? super T> action) |
boolean |
isEmpty() |
boolean |
isPresent() |
static <T> Optional<T> |
of(T value) |
static <T> Optional<T> |
ofNullable(T value) |
Optional<T> |
toStandardOptional() |
String |
toString() |
public static <T> Optional<T> of(T value)
public static <T> Optional<T> ofNullable(T value)
public static <T> Optional<T> empty()
public boolean isEmpty()
public boolean isPresent()
public T get()
public void ifPresent(java.util.function.Consumer<? super T> action)
Copyright © 2025. All rights reserved.