Class NlpResult
- java.lang.Object
-
- com.restfb.types.webhook.messaging.NlpResult
-
-
Constructor Summary
Constructors Constructor Description NlpResult()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
convertRawEntites(JsonMapper mapper)
List<BaseNlpEntity>
getEntities()
returns the complete list of all found entities.<T extends BaseNlpEntity>
List<T>getEntities(Class<T> clazz)
returns a subset of the found entities.List<NlpError>
getErrors()
returns the complete list of all found errorsboolean
hasErrors()
checks if the returned JSON contains the error field
-
-
-
Constructor Detail
-
NlpResult
public NlpResult()
-
-
Method Detail
-
convertRawEntites
public void convertRawEntites(JsonMapper mapper)
-
getEntities
public List<BaseNlpEntity> getEntities()
returns the complete list of all found entities.- Returns:
- the complete list of all found entities.
-
getErrors
public List<NlpError> getErrors()
returns the complete list of all found errors- Returns:
- the complete list of all found errors
-
hasErrors
public boolean hasErrors()
checks if the returned JSON contains the error field- Returns:
true
if the NLP result found errors,false
otherwise
-
getEntities
public <T extends BaseNlpEntity> List<T> getEntities(Class<T> clazz)
returns a subset of the found entities. Only entities that are of typeT
are returned. T needs to extend theBaseNlpEntity
.- Parameters:
clazz
- the filter class- Returns:
- List of entites, only the filtered elements are returned.
-
-