public FindDefinitionResult read(JsonReaderExt jsonParser) throws GenieCommandException, IOException {
HashMap<String, Object> response = JsonReaderExt.readJsonObject(jsonParser);
String errorMessage = getStringOrNull(response, "error");
if(errorMessage != null) {
return new FindDefinitionResult(errorMessage);
}
List<?> jsonResults = blindCast(response.get("results"));
ArrayList<FindDefinitionResultEntry> results = new ArrayList<>();
for (Object jsonResultEntry : nullToEmpty(jsonResults)) {
results.add(findDefResult(jsonResultEntry));
}
return new FindDefinitionResult(results);
}