Class Result<E extends java.lang.Enum<E>,​T>

  • Type Parameters:
    E - Type of the status enumeration.
    T - Type of the result object.
    Direct Known Subclasses:
    SolverResult

    public class Result<E extends java.lang.Enum<E>,​T>
    extends java.lang.Object
    The Result class is base class for describing results of some complex calculations. Includes status enumeration, result object and a list of error messages.
    • Constructor Summary

      Constructors 
      Constructor 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.
    • Constructor Detail

      • Result

        public 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.
        Parameters:
        status - Status enumeration item.
        result - Result object.
        errors - List of error messages.
        Throws:
        java.lang.IllegalArgumentException - if the status or errors argument is null.
    • Method Detail

      • getStatus

        public final E getStatus()
      • getResult

        public final T getResult()
      • hasErrors

        public final boolean hasErrors()
      • getErrors

        public final java.util.List<java.lang.String> getErrors()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object