Search in sources :

Example 1 with ContactRoleType

use of org.orcid.core.salesforce.model.ContactRoleType in project ORCID-Source by ORCID.

the class ManageConsortiumController method retrieveContactRoleTypesAsMap.

@ModelAttribute("contactRoleTypes")
public Map<String, String> retrieveContactRoleTypesAsMap() {
    Map<String, String> map = new LinkedHashMap<>();
    for (ContactRoleType type : ContactRoleType.values()) {
        map.put(type.name(), getMessage(buildInternationalizationKey(ContactRoleType.class, type.name())));
    }
    Map<String, String> sorted = new LinkedHashMap<>();
    // @formatter:off
    map.entrySet().stream().sorted(Map.Entry.<String, String>comparingByValue()).forEachOrdered(x -> sorted.put(x.getKey(), x.getValue()));
    // @formatter:on
    return sorted;
}
Also used : ContactRoleType(org.orcid.core.salesforce.model.ContactRoleType) LinkedHashMap(java.util.LinkedHashMap) ModelAttribute(org.springframework.web.bind.annotation.ModelAttribute)

Aggregations

LinkedHashMap (java.util.LinkedHashMap)1 ContactRoleType (org.orcid.core.salesforce.model.ContactRoleType)1 ModelAttribute (org.springframework.web.bind.annotation.ModelAttribute)1