Package org.openhab.core.voice.text
Class InterpretationResult
java.lang.Object
org.openhab.core.voice.text.InterpretationResult
Bundles results of an interpretation. Represents final outcome and user feedback. This class is immutable.
- Author:
- Tilman Kamp - Initial contribution
-
Field Summary
Modifier and TypeFieldDescriptionstatic final InterpretationResult
Represents successful parsing and interpretation.static final InterpretationResult
Represents a problem in the interpretation step after successful parsing.static final InterpretationResult
Represents a syntactical problem during parsing. -
Constructor Summary
ConstructorDescriptionInterpretationResult
(boolean success, String response) Constructs a result.InterpretationResult
(String response) Constructs a successful result.InterpretationResult
(InterpretationException exception) Constructs an unsuccessful result. -
Method Summary
-
Field Details
-
OK
Represents successful parsing and interpretation. -
SYNTAX_ERROR
Represents a syntactical problem during parsing. -
SEMANTIC_ERROR
Represents a problem in the interpretation step after successful parsing.
-
-
Constructor Details
-
InterpretationResult
Constructs a successful result.- Parameters:
response
- the textual response. Should be short, localized and understandable by non-technical users.
-
InterpretationResult
Constructs an unsuccessful result.- Parameters:
exception
- the responsible exception
-
InterpretationResult
Constructs a result.- Parameters:
success
- if the result represents a successful or unsuccessful interpretationresponse
- the textual response. Should be short, localized and understandable by non-technical users.
-
-
Method Details
-
isSuccess
public boolean isSuccess()- Returns:
- if interpretation was successful
-
getException
- Returns:
- the exception
-
getResponse
- Returns:
- the response
-