Package com.dslplatform.compiler.client
Class Either<T>
- java.lang.Object
-
- com.dslplatform.compiler.client.Either<T>
-
public final class Either<T> extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringexplainError()static <F> Either<F>fail(java.lang.Exception error)static <F> Either<F>fail(java.lang.String error)static <F> Either<F>fail(java.lang.String description, java.lang.Exception error)Tget()booleanisSuccess()static <S> Either<S>success(S value)java.lang.ExceptionwhyNot()
-
-
-
Field Detail
-
value
private final T value
-
error
private final java.lang.Exception error
-
-
Constructor Detail
-
Either
private Either(T value, java.lang.Exception error)
-
-
Method Detail
-
isSuccess
public boolean isSuccess()
-
get
public T get()
-
whyNot
public java.lang.Exception whyNot()
-
explainError
public java.lang.String explainError()
-
success
public static <S> Either<S> success(S value)
-
fail
public static <F> Either<F> fail(java.lang.String error)
-
fail
public static <F> Either<F> fail(java.lang.Exception error)
-
fail
public static <F> Either<F> fail(java.lang.String description, java.lang.Exception error)
-
-