Example usage for org.apache.commons.collections4 MultiValuedMap putAll

List of usage examples for org.apache.commons.collections4 MultiValuedMap putAll

Introduction

In this page you can find the example usage for org.apache.commons.collections4 MultiValuedMap putAll.

Prototype

boolean putAll(K key, Iterable<? extends V> values);

Source Link

Document

Adds a mapping to the specified key for all values contained in the given Iterable.

Usage

From source file:org.phenotips.vocabulary.internal.hpoannotations.AbstractPhenotypeForDiseaseAnnotationsExtension.java

@Override
protected void processCSVRecordRow(@Nonnull final CSVRecord row, @Nonnull final Vocabulary vocabulary) {
    // The annotation source file contains data for several disorder databases. Only want to look at data that is
    // relevant for the current vocabulary.
    final String dbName = getRowItem(row, VOCABULARY_ID_COLUMN);
    if (StringUtils.isNotBlank(dbName)) {
        String diseaseId = getRowItem(row, TERM_ID_COLUMN);
        final String symptomId = getRowItem(row, PHENOTYPE_COLUMN);
        if (StringUtils.isNotBlank(diseaseId) && StringUtils.isNotBlank(symptomId)) {
            diseaseId = vocabularyIdToTermPrefix(dbName) + diseaseId;
            MultiValuedMap<String, String> termData = this.data.get(diseaseId);
            if (termData == null) {
                termData = new HashSetValuedHashMap<>();
                this.data.put(diseaseId, termData);
            }/*from w w w  .ja  v  a  2 s. c  om*/

            termData.put(getDirectPhenotypesLabel(), symptomId);
            termData.putAll(getAllAncestorPhenotypesLabel(), getSelfAndAncestorTermIds(symptomId));
        }
    }
}