public class Optionals extends Object
Modifier and Type | Method and Description |
---|---|
static <T> void |
addIfPresent(Optional<T> optional,
com.google.common.collect.ImmutableCollection.Builder<T> collection) |
static <T,U> Optional<U> |
bind(Optional<? extends T> optional,
java.util.function.Function<? super T,Optional<U>> f) |
static <T extends Comparable<T>> |
compare(Optional<T> first,
Optional<T> second) |
static Optional<Boolean> |
ofBoolean(boolean b) |
static <K,T> void |
putIfPresent(Optional<T> optional,
K key,
com.google.common.collect.ImmutableMap.Builder<K,T> collection) |
static <T> T |
require(Optional<T> optional) |
public static <T> void addIfPresent(Optional<T> optional, com.google.common.collect.ImmutableCollection.Builder<T> collection)
public static <K,T> void putIfPresent(Optional<T> optional, K key, com.google.common.collect.ImmutableMap.Builder<K,T> collection)
public static <T,U> Optional<U> bind(Optional<? extends T> optional, java.util.function.Function<? super T,Optional<U>> f)
public static <T extends Comparable<T>> int compare(Optional<T> first, Optional<T> second)
public static <T> T require(Optional<T> optional)