All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.sphere.sdk.categories.Multimap Maven / Gradle / Ivy

There is a newer version: 1.0.0-M12
Show newest version
package io.sphere.sdk.categories;

import java.util.*;

final class Multimap {
    private final Map> underlyingMap = new HashMap<>();

    public void put(final K key, final V value) {
        final List entriesForKey = underlyingMap.getOrDefault(key, new LinkedList<>());
        entriesForKey.add(value);
        underlyingMap.put(key, entriesForKey);
    }

    public Collection get(final K key) {
        return underlyingMap.getOrDefault(key, new LinkedList<>());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy