public final class Optional<T> extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> Optional<T> |
absent() |
boolean |
equals(Object o) |
Optional<T> |
filter(Predicate<? super T> predicate) |
static <T> Optional<T> |
fromNullable(T nullableReference) |
T |
get() |
int |
hashCode() |
boolean |
isEmpty() |
boolean |
isPresent() |
<F> Optional<F> |
map(Function<? super T,F> mapper) |
static <T> Optional<T> |
of(T arg) |
T |
or(T defaultValue) |
T |
orNull() |
<X extends Throwable> |
orThrow(Supplier<? extends X> exceptionFunction) |
String |
toString() |
public static <T> Optional<T> of(T arg)
public static <T> Optional<T> fromNullable(T nullableReference)
public static <T> Optional<T> absent()
public T get()
public T orNull()
public boolean isEmpty()
public boolean isPresent()
public <X extends Throwable> T orThrow(Supplier<? extends X> exceptionFunction) throws X extends Throwable
X extends ThrowableCopyright © 2020. All rights reserved.