use of org.phoenicis.repository.dto.TypeDTO in project POL-POM-5 by PlayOnLinux.
the class VerbsManager method fetchAvailableVerbs.
/**
* Fetches the available Verbs
*
* @param repositoryDTO
* @param callback
*/
public void fetchAvailableVerbs(RepositoryDTO repositoryDTO, Consumer<Map<String, ApplicationDTO>> callback) {
Map<String, ApplicationDTO> verbs = new HashMap<>();
// get engine CategoryDTOs
List<CategoryDTO> categoryDTOS = new ArrayList<>();
for (TypeDTO typeDTO : repositoryDTO.getTypes()) {
if (typeDTO.getId().equals("engines")) {
categoryDTOS = typeDTO.getCategories();
}
}
for (CategoryDTO engine : categoryDTOS) {
for (ApplicationDTO applicationDTO : engine.getApplications()) {
if (applicationDTO.getId().equals(engine.getId() + ".verbs")) {
verbs.put(engine.getId().replaceAll("^.*\\.", ""), applicationDTO);
}
}
}
callback.accept(verbs);
}
Aggregations