Commit 47582db0 authored by Abzal Kultayev's avatar Abzal Kultayev

[TASK #CMER] Рефакторинг АПИ метода

parent 0fb507c5
......@@ -65,6 +65,19 @@ public class AsFormService {
));
}
public AdvancedSearchResult advancedSearchOne(String formID, String field, String value) throws IOException {
List<AdvancedSearchResult> result = advancedSearch(formID, field, value);
if (result.size() == 0) {
throw new IllegalStateException("Запись не найдена");
}
if (result.size() > 1) {
throw new IllegalStateException("Найдены несколько записей по условию");
}
return result.get(0);
}
public <T extends AsForm> T getData(Class<T> formClass, String dataUUID) throws IOException {
return asFormConverter.toAsForm(formClass, getData(dataUUID));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment