Search in sources :

Example 1 with TypeDesignationStatusFilter

use of eu.etaxonomy.cdm.api.service.dto.TypeDesignationStatusFilter in project cdmlib by cybertaxonomy.

the class NameServiceImpl method getTypeDesignationStatusFilterTerms.

@Override
public Collection<TypeDesignationStatusFilter> getTypeDesignationStatusFilterTerms(List<Language> preferredLanguages) {
    List<TypeDesignationStatusBase> termList = typeDesignationDao.getTypeDesignationStatusInUse();
    Map<String, TypeDesignationStatusFilter> filterMap = new HashMap<>();
    for (TypeDesignationStatusBase term : termList) {
        TypeDesignationStatusFilter filter = new TypeDesignationStatusFilter(term, preferredLanguages, true);
        String key = filter.getKey();
        if (filterMap.containsKey(key)) {
            filterMap.get(key).addStatus(term);
        } else {
            filterMap.put(key, filter);
        }
    }
    return filterMap.values();
}
Also used : TypeDesignationStatusFilter(eu.etaxonomy.cdm.api.service.dto.TypeDesignationStatusFilter) HashMap(java.util.HashMap) TypeDesignationStatusBase(eu.etaxonomy.cdm.model.name.TypeDesignationStatusBase)

Aggregations

TypeDesignationStatusFilter (eu.etaxonomy.cdm.api.service.dto.TypeDesignationStatusFilter)1 TypeDesignationStatusBase (eu.etaxonomy.cdm.model.name.TypeDesignationStatusBase)1 HashMap (java.util.HashMap)1