use of org.motechproject.mds.web.comparator.EntityNameComparator in project motech by motech.
the class EntityController method getEntities.
@RequestMapping(value = "/selectEntities", method = RequestMethod.GET)
@PreAuthorize(Roles.HAS_DATA_OR_SCHEMA_ACCESS)
@ResponseBody
public SelectResult<EntityDto> getEntities(SelectData data) {
List<EntityDto> list = entityService.listEntities();
CollectionUtils.filter(list, new EntityMatcher(data.getTerm()));
Collections.sort(list, new EntityNameComparator());
return new SelectResult<>(data, list);
}
Aggregations