public final class EitherCompanion extends Object
Left/Right.
import static javascalautils.EitherCompanion.Left;
import static javascalautils.EitherCompanion.Right;
Either<InputStream,String> left = Left(new FileInputStream("foo.bar"));
Either<InputStream,String> right = Right("Right is not Left");
| Modifier and Type | Method and Description |
|---|---|
static <L,R> Left<L,R> |
Left(L value)
Creates an instance of
Left. |
static <L,R> Right<L,R> |
Right(R value)
Creates an instance of
Right. |
public static <L,R> Left<L,R> Left(L value)
Left.
import static javascalautils.EitherCompanion.Left;
Either<InputStream,String> left = Left(new FileInputStream("foo.bar"));
L - The type for the Left side (not used for this method)R - The type for the Right sidevalue - The value represented by this LeftLeft.Left(Object)public static <L,R> Right<L,R> Right(R value)
Right.
import static javascalautils.EitherCompanion.Right;
Either<InputStream,String> right = Right("Right is not Left");
L - The type for the Left side (not used for this method)R - The type for the Right sidevalue - The value represented by this RightRight.Right(Object)Copyright © 2015, Peter Nerg Apache License v2.0