E
- Type of the status enumeration.T
- Type of the result object.public class Result<E extends java.lang.Enum<E>,T>
extends java.lang.Object
Result
class is base class for describing results of some complex calculations.
Includes status enumeration, result object and a list of error messages.Constructor and Description |
---|
Result(E status,
T result,
java.util.List<java.lang.String> errors)
Constructs a
Result object on the basis of status, object representing the result
and the list of error messages. |
Modifier and Type | Method and Description |
---|---|
java.util.List<java.lang.String> |
getErrors() |
T |
getResult() |
E |
getStatus() |
boolean |
hasErrors() |
java.lang.String |
toString() |
public Result(E status, T result, java.util.List<java.lang.String> errors)
Result
object on the basis of status, object representing the result
and the list of error messages.status
- Status enumeration item.result
- Result object.errors
- List of error messages.java.lang.IllegalArgumentException
- if the status
or errors
argument
is null
.