Class InterpretationResult


  • public final class InterpretationResult
    extends Object
    Bundles results of an interpretation. Represents final outcome and user feedback. This class is immutable.
    Author:
    Tilman Kamp - Initial contribution
    • Field Detail

      • SYNTAX_ERROR

        public static final InterpretationResult SYNTAX_ERROR
        Represents a syntactical problem during parsing.
      • SEMANTIC_ERROR

        public static final InterpretationResult SEMANTIC_ERROR
        Represents a problem in the interpretation step after successful parsing.
    • Constructor Detail

      • InterpretationResult

        public InterpretationResult​(String response)
        Constructs a successful result.
        Parameters:
        response - the textual response. Should be short, localized and understandable by non-technical users.
      • InterpretationResult

        public InterpretationResult​(InterpretationException exception)
        Constructs an unsuccessful result.
        Parameters:
        exception - the responsible exception
      • InterpretationResult

        public InterpretationResult​(boolean success,
                                    String response)
        Constructs a result.
        Parameters:
        success - if the result represents a successful or unsuccessful interpretation
        response - the textual response. Should be short, localized and understandable by non-technical users.
    • Method Detail

      • isSuccess

        public boolean isSuccess()
        Returns:
        if interpretation was successful
      • getResponse

        public String getResponse()
        Returns:
        the response