![JAR search and dependency download from the Maven repository](/logo.png)
com.github.protobufel.multikeymap.MultiKeyMaps Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of multikeymapjava Show documentation
Show all versions of multikeymapjava Show documentation
Java 8 implementation of the multi-key map. It behaves like a regular generic Map with the additional ability of getting its values by any combination of partial keys.
The newest version!
/*
* Copyright 2017 David Tesler
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.github.protobufel.multikeymap;
import java.util.Map;
import java.util.Objects;
import java.util.function.Supplier;
/**
* Provides the factory methods of the generic MultiKeyMap implementations.
*
* @author David Tesler
*/
public final class MultiKeyMaps {
private MultiKeyMaps() {
}
/**
* Creates a new MultiKeyMap based on the provided map supplier.
* The returned MultiKeyMap is Serializable if the provided map is Serializable.
* NOTE: Use with caution. This is the advanced functionality.
*
* @param mapSupplier a supplier of {@code Map} this MultiKeyMap is based on
* @param concurrent create a concurrent instance if true, un-synchronized, regular instance, otherwise
* @param the type of a sub-key the key consist of
* @param the type of a full key, which is an Iterable of its sub-keys, with usage as in a
* regular Map
* @param the type of a value which stored in the MultiKeyMap under the corresponding key
* @return a new instance of the implementation of MultiKeyMap
*/
public static , V> MultiKeyMap newMultiKeyMap(
final Supplier
© 2015 - 2025 Weber Informatics LLC | Privacy Policy