V
- the value typepublic static class ReturnValue.ReturnValueImpl<V> extends java.lang.Object implements ReturnValue<V>
ReturnValue.ReturnValueImpl<V>, ReturnValue.State
Modifier and Type | Field and Description |
---|---|
@Nullable java.lang.String |
message
A message in case of a state different than OK or CANCEL
|
@NonNull ReturnValue.State |
state
The state
|
@Nullable java.lang.Throwable |
throwable
An exception in case one was the reason for the failure
|
V |
value
The value in case of a OK state
|
Constructor and Description |
---|
ReturnValueImpl(@NonNull ReturnValue.State state,
@Nullable java.lang.String message,
V value,
@Nullable java.lang.Throwable throwable)
Create a new return value
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getMessage() |
ReturnValue.State |
getState() |
java.lang.Throwable |
getThrowable() |
V |
getValue() |
public final @NonNull ReturnValue.State state
public final @Nullable java.lang.String message
public final @Nullable java.lang.Throwable throwable
public final V value
public ReturnValueImpl(@NonNull ReturnValue.State state, @Nullable java.lang.String message, V value, @Nullable java.lang.Throwable throwable)
state
- the statemessage
- the messagevalue
- the valuethrowable
- the exceptionpublic java.lang.String getMessage()
getMessage
in interface ReturnValue<V>
public java.lang.Throwable getThrowable()
getThrowable
in interface ReturnValue<V>
public ReturnValue.State getState()
getState
in interface ReturnValue<V>
public V getValue()
getValue
in interface ReturnValue<V>