java.lang.Object
org.fuin.cqrs4j.AbstractResult<DATA>
- Type Parameters:
DATA- Type of data returned.
- All Implemented Interfaces:
Serializable,Result<DATA>
- Direct Known Subclasses:
DataResult,SimpleResult
Result of a request. The type signals if the execution was successful or not. In case the the result is not
ResultType.OK, the
fields code and message should contain unique information to help the user identifying the cause of the problem. A result may carry some
optional data.- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedProtected default constructor for de-serialization.AbstractResult(@NotNull Exception exception) Constructor with exception.AbstractResult(@NotNull ResultType type, String code, String message) Constructor with all data. -
Method Summary
Modifier and TypeMethodDescriptionfinal StringgetCode()Returns the result code.final StringReturns the result message.final ResultTypegetType()Returns the result type.
-
Constructor Details
-
AbstractResult
protected AbstractResult()Protected default constructor for de-serialization. -
AbstractResult
public AbstractResult(@NotNull @NotNull ResultType type, @Nullable String code, @Nullable String message) Constructor with all data.- Parameters:
type- Type.code- Code.message- Message.
-
AbstractResult
Constructor with exception. An exception of typeExceptionShortIdentifablewill be used to fill thecodefield with the identifier value. If it's not aExceptionShortIdentifablethecodefield will be set using the full qualified class name of the exception.- Parameters:
exception- The message for the result is equal to the exception message or the simple name of the exception class if the exception message isnull.
-
-
Method Details