@Immutable
public class Validation<T,E>
extends java.lang.Object
Constructor and Description |
---|
Validation(T value,
E error) |
Modifier and Type | Method and Description |
---|---|
E |
getError()
If this is a successful result, returns the value.
|
T |
getValue()
If this is a successful result, returns the value.
|
boolean |
isError()
Returns true if this is an erroneous result.
|
boolean |
isSuccess()
Returns true if this is a successful result.
|
java.lang.String |
toString() |
public boolean isSuccess()
public boolean isError()
public T getValue()
isSuccess
before calling this method.public E getError()
isSuccess
before calling this method.public java.lang.String toString()
toString
in class java.lang.Object