@Immutable public final class SphereResultRaw<T> extends Validation<T,SphereBackendException>
error, value
Modifier and Type | Method and Description |
---|---|
<R> SphereResultRaw<R> |
castError()
If error, creates a new error result of given type (doesn't transform anything, just changes the type).
|
static <T> SphereResultRaw<T> |
error(SphereBackendException exception)
Creates a new erroneous result.
|
T |
getValue()
If this is a successful result, returns the value.
|
static <T> SphereResultRaw<T> |
success(T value)
Creates a new successful result.
|
java.lang.String |
toString() |
<R> SphereResultRaw<R> |
transform(com.google.common.base.Function<T,R> successFunc)
If successful, transforms the success value.
|
getError, isError, isSuccess
public static <T> SphereResultRaw<T> success(T value)
public static <T> SphereResultRaw<T> error(SphereBackendException exception)
public T getValue()
Validation
isSuccess
before calling this method.getValue
in class Validation<T,SphereBackendException>
public <R> SphereResultRaw<R> transform(@Nonnull com.google.common.base.Function<T,R> successFunc)
public <R> SphereResultRaw<R> castError()
public java.lang.String toString()
toString
in class Validation<T,SphereBackendException>