Package org.derive4j.processor
Class Eithers
- java.lang.Object
-
- org.derive4j.processor.Eithers
-
final class Eithers extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Eithers.CaseOfMatchers
static class
Eithers.CasesMatchers
private static class
Eithers.Lazy<A,B>
private static class
Eithers.Left<A,B>
private static class
Eithers.Right<A,B>
-
Constructor Summary
Constructors Modifier Constructor Description private
Eithers()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <A,B>
Eithers.CaseOfMatchers.TotalMatcher_Left<A,B>caseOf(Either<A,B> either)
static <A,B>
Eithers.CasesMatchers.TotalMatcher_Left<A,B>cases()
static <A,B>
java.util.Optional<A>getLeft(Either<A,B> either)
static <A,B>
java.util.Optional<B>getRight(Either<A,B> either)
static <A,B>
Either<A,B>lazy(java.util.function.Supplier<Either<A,B>> either)
static <A,B>
Either<A,B>left(A left)
static <A,B,XA>
java.util.function.Function<Either<A,B>,Either<XA,B>>modLeft(java.util.function.Function<A,XA> leftMod)
static <A,B,XB>
java.util.function.Function<Either<A,B>,Either<A,XB>>modRight(java.util.function.Function<B,XB> rightMod)
static <A,B>
Either<A,B>right(B right)
static <A,B,XA>
java.util.function.Function<Either<A,B>,Either<XA,B>>setLeft(XA newLeft)
static <A,B,XB>
java.util.function.Function<Either<A,B>,Either<A,XB>>setRight(XB newRight)
-
-
-
Method Detail
-
left
public static <A,B> Either<A,B> left(A left)
-
right
public static <A,B> Either<A,B> right(B right)
-
cases
public static <A,B> Eithers.CasesMatchers.TotalMatcher_Left<A,B> cases()
-
caseOf
public static <A,B> Eithers.CaseOfMatchers.TotalMatcher_Left<A,B> caseOf(Either<A,B> either)
-
getLeft
public static <A,B> java.util.Optional<A> getLeft(Either<A,B> either)
-
getRight
public static <A,B> java.util.Optional<B> getRight(Either<A,B> either)
-
setLeft
public static <A,B,XA> java.util.function.Function<Either<A,B>,Either<XA,B>> setLeft(XA newLeft)
-
modLeft
public static <A,B,XA> java.util.function.Function<Either<A,B>,Either<XA,B>> modLeft(java.util.function.Function<A,XA> leftMod)
-
setRight
public static <A,B,XB> java.util.function.Function<Either<A,B>,Either<A,XB>> setRight(XB newRight)
-
-