| Constructor and Description |
|---|
Eithers() |
| Modifier and Type | Method and Description |
|---|---|
static <LT,RT> Iterator<LT> |
lefts(Iterable<Either<LT,RT>> eithers)
Creates an iterator yielding only left wrapped values from an
iterable of Either.
|
static <LT,RT> Iterator<LT> |
lefts(Iterator<Either<LT,RT>> eithers)
Creates an iterator yielding only left wrapped values from an
iterator of Either.
|
static <LT,RT,LR,RR> |
lift(Function<LT,LR> left,
Function<RT,RR> right)
Lifts functions working on the components of an
Either<LT, RT> into a single function working on either
monadic values.
|
static <LT,RT> Either<LT,RT> |
pure(Class<LT> leftClass,
RT value)
Yields Either.pure() of a get.
|
static <LT,RT> Either<LT,RT> |
pure(RT value)
Yields Either.pure() of a get.
|
static <LT,RT> Iterator<Either<LT,RT>> |
pures(Iterable<RT> values)
Creates an iterator transforming values from the source iterable into
pure() Either
|
static <LT,RT> Iterator<Either<LT,RT>> |
pures(Iterator<RT> values)
Creates an iterator transforming values from the source iterator into
pure() Either
|
static <LT,RT> Iterator<Either<LT,RT>> |
pures(RT... values)
Creates an iterator transforming values from the source array into
pure() Either
|
static <LT,RT> Iterator<Either<LT,RT>> |
pures(RT value)
Creates a singleton iterator yielding pure() Either
|
static <LT,RT> Iterator<Either<LT,RT>> |
pures(RT first,
RT second)
Creates an iterator yielding pure() Either
|
static <LT,RT> Iterator<Either<LT,RT>> |
pures(RT first,
RT second,
RT third)
Creates an iterator yielding pure() Either
|
static <LT,RT> Iterator<RT> |
rights(Iterable<Either<LT,RT>> eithers)
Creates an iterator yielding only right wrapped values from an
iterable of Either.
|
static <LT,RT> Iterator<RT> |
rights(Iterator<Either<LT,RT>> eithers)
Creates an iterator yielding only right wrapped values from an
iterator of Either.
|
public static <LT,RT> Either<LT,RT> pure(RT value)
Eithers.pure(1) -> Either.right(1)LT - the left typeRT - the right typevalue - the get to be transformedpublic static <LT,RT> Either<LT,RT> pure(Class<LT> leftClass, RT value)
Eithers.pure(1) -> Either.right(1)LT - the left typeRT - the right typeleftClass - the left type (used for type inference)value - the get to be transformedpublic static <LT,RT> Iterator<Either<LT,RT>> pures(Iterator<RT> values)
Eithers.pures([1,2,3]) -> [Right 1, Right 2, Right 3]LT - the left typeRT - the right typevalues - the source iteratorpublic static <LT,RT> Iterator<Either<LT,RT>> pures(Iterable<RT> values)
Eithers.pures([1,2,3]) -> [Right 1, Right 2, Right 3]LT - the left typeRT - the right typevalues - the source iterablepublic static <LT,RT> Iterator<Either<LT,RT>> pures(RT value)
Eithers.pures(1) -> [Right 1]LT - the left typeRT - the right typevalue - the get to be transformedpublic static <LT,RT> Iterator<Either<LT,RT>> pures(RT first, RT second)
Eithers.pures(1, 2) -> [Right 1, Right 2]LT - the left typeRT - the right typefirst - the first getsecond - the second getpublic static <LT,RT> Iterator<Either<LT,RT>> pures(RT first, RT second, RT third)
Eithers.pures(1, 2, 3) -> [Right 1, Right 2, Right 3]LT - the left typeRT - the right typefirst - the first getsecond - the second getthird - the third getpublic static <LT,RT> Iterator<Either<LT,RT>> pures(RT... values)
Eithers.pures([1,2,3]) -> [Right 1, Right 2, Right 3]LT - the left typeRT - the right typevalues - the source arraypublic static <LT,RT,LR,RR> Function<Either<LT,RT>,Either<LR,RR>> lift(Function<LT,LR> left, Function<RT,RR> right)
LT - the left source typeRT - the right source typeLR - the left result typeRR - the right result typeleft - the function to apply to the left elementright - the function to apply to the right elementpublic static <LT,RT> Iterator<LT> lefts(Iterator<Either<LT,RT>> eithers)
Eithers.lefts([Right 1, Left 2, Right 3, Left 4]) -> [2, 4]LT - the left typeRT - the right typeeithers - the source iteratorpublic static <LT,RT> Iterator<LT> lefts(Iterable<Either<LT,RT>> eithers)
Eithers.lefts([Right 1, Left 2, Right 3, Left 4]) -> [2, 4]LT - the left typeRT - the right typeeithers - the source iterablepublic static <LT,RT> Iterator<RT> rights(Iterator<Either<LT,RT>> eithers)
Eithers.rights([Right 1, Left 2, Right 3, Left 4]) -> [1, 3]LT - the left typeRT - the right typeeithers - the source iteratorpublic static <LT,RT> Iterator<RT> rights(Iterable<Either<LT,RT>> eithers)
Eithers.rights([Right 1, Left 2, Right 3, Left 4]) -> [1, 3]LT - the left typeRT - the right typeeithers - the source iterableCopyright © 2017. All rights reserved.