public final class Optional<T> extends Object
Modifier and Type | Method | Description |
---|---|---|
static <T> Optional<T> |
absent() |
|
boolean |
equals(Object o) |
|
static <T> Optional<T> |
fromNullable(T nullableReference) |
|
T |
get() |
|
int |
hashCode() |
|
boolean |
isPresent() |
|
<U> Optional<U> |
map(Function<? super T,? extends U> 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 isPresent()
public <X extends Throwable> T orThrow(Supplier<? extends X> exceptionFunction) throws X extends Throwable
X extends Throwable
Copyright © 2018. All rights reserved.