public final class SerializableOptional<T extends Serializable> extends Object implements Serializable
Optional
.Modifier and Type | Method and Description |
---|---|
static <T extends Serializable> |
empty() |
T |
get() |
void |
ifPresent(java.util.function.Consumer<? super T> consumer) |
boolean |
isPresent() |
<R extends Serializable> |
map(java.util.function.Function<? super T,? extends R> mapper) |
static <T extends Serializable> |
of(T value) |
static <T extends Serializable> |
ofNullable(T value) |
Optional<T> |
toOptional() |
public T get()
public boolean isPresent()
public void ifPresent(java.util.function.Consumer<? super T> consumer)
public <R extends Serializable> SerializableOptional<R> map(java.util.function.Function<? super T,? extends R> mapper)
public static <T extends Serializable> SerializableOptional<T> of(@Nonnull T value)
public static <T extends Serializable> SerializableOptional<T> ofNullable(@Nullable T value)
public static <T extends Serializable> SerializableOptional<T> empty()
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.