Class SolverResultBuilder


  • public final class SolverResultBuilder
    extends java.lang.Object
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addError​(java.lang.String error)
      Adds an error description to the list of errors.
      void addVariable​(Variable variable)
      Adds a variable to the list of variables.
      SolverResult build()
      Creates a solver result object basing attributes hold by the builder.
      boolean hasErrors()
      Checks whether any errors have been registered.
      void setStatus​(SolverResult.Status status)
      Sets the status of the result.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SolverResultBuilder

        public SolverResultBuilder​(SolverResult.Status status)
        Constructs a SolverResultBuilder object.
        Parameters:
        status - The initial status of the result.
    • Method Detail

      • build

        public SolverResult build()
        Creates a solver result object basing attributes hold by the builder.
        Returns:
        A new solver result object.
      • setStatus

        public void setStatus​(SolverResult.Status status)
        Sets the status of the result.
        Parameters:
        status - Result status.
      • addError

        public void addError​(java.lang.String error)
        Adds an error description to the list of errors.
        Parameters:
        error - An error description.
      • addVariable

        public void addVariable​(Variable variable)
        Adds a variable to the list of variables.
        Parameters:
        variable - A variable object.
      • hasErrors

        public boolean hasErrors()
        Checks whether any errors have been registered.
        Returns:
        true if any errors have been reported or false otherwise.