public class CommonUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> Optional<T> |
optionalOr(Optional<T>... options) |
static <T> java.util.stream.Stream<T> |
optionalToStream(Optional<T> optional) |
static <T> java.util.stream.Collector<T,?,com.google.common.collect.ImmutableList<T>> |
toImmutableList() |
static <T> java.util.stream.Collector<T,?,com.google.common.collect.ImmutableMultiset<T>> |
toImmutableMultiset() |
static <T> java.util.stream.Collector<T,?,com.google.common.collect.ImmutableSet<T>> |
toImmutableSet() |
static RuntimeException |
unreachableStatement(String message) |
static RuntimeException |
unreachableStatement(String message,
Throwable cause) |
static RuntimeException |
unreachableStatement(Throwable cause) |
public static <T> java.util.stream.Stream<T> optionalToStream(Optional<T> optional)
T - the type in the optionaloptional - the optional to change into a stream@SafeVarargs public static <T> Optional<T> optionalOr(Optional<T>... options)
@CheckReturnValue public static RuntimeException unreachableStatement(Throwable cause)
@CheckReturnValue public static RuntimeException unreachableStatement(String message)
@CheckReturnValue public static RuntimeException unreachableStatement(@Nullable String message, Throwable cause)
public static <T> java.util.stream.Collector<T,?,com.google.common.collect.ImmutableSet<T>> toImmutableSet()
public static <T> java.util.stream.Collector<T,?,com.google.common.collect.ImmutableList<T>> toImmutableList()
public static <T> java.util.stream.Collector<T,?,com.google.common.collect.ImmutableMultiset<T>> toImmutableMultiset()
Copyright © 2017 Grakn Labs Ltd. All rights reserved.