public final class EitherUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static <L,R> io.atlassian.fugue.Pair<List<L>,List<R>> |
splitEithers(Iterable<io.atlassian.fugue.Either<L,R>> eithers)
Transforms list of Eithers into two lists, which contains left and right values.
|
static <L extends RuntimeException,R> |
unwrapEither(io.atlassian.fugue.Either<L,R> either)
Gets the right value from an
Either or throws its left value. |
public static <L,R> io.atlassian.fugue.Pair<List<L>,List<R>> splitEithers(Iterable<io.atlassian.fugue.Either<L,R>> eithers)
public static <L extends RuntimeException,R> R unwrapEither(io.atlassian.fugue.Either<L,R> either)
Either or throws its left value. Requires the left type to be a
RuntimeException so that it can be used directly with higher-order functions like Optional.map(java.util.function.Function<? super T, ? extends U>)
without needing to handle checked exceptions explicitly.L - the left type of the eitherR - the right type of the eithereither - the Either to unwrapL - if the either has a left valueCopyright © 2002-2024 Atlassian. All Rights Reserved.