T - The type of a successful value.E - The type of the error value.public final class Result<T,E>
extends java.lang.Object
Result[T, E] type, or Scala's Either[A, B]
.| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
static <T,E> Result<T,E> |
error(E value) |
<C> C |
fold(java.util.function.Function<T,C> onOk,
java.util.function.Function<E,C> onError) |
E |
getErrorOrThrow() |
T |
getOrThrow() |
int |
hashCode() |
boolean |
isError() |
boolean |
isOk() |
<C> Result<C,E> |
map(java.util.function.Function<T,C> fn) |
static <T,E> Result<T,E> |
ok(T value) |
java.lang.String |
toString() |
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic <C> C fold(java.util.function.Function<T,C> onOk, java.util.function.Function<E,C> onError)
public boolean isOk()
public boolean isError()
public T getOrThrow()
public E getErrorOrThrow()
public static <T,E> Result<T,E> ok(T value)
public static <T,E> Result<T,E> error(E value)