public final class MapFactory
extends java.lang.Object
MapFactory provides factory methods for create new Map objects| Modifier and Type | Method and Description |
|---|---|
static java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.lang.String>> |
newAssosiativeArrayMap()
Factory method for
Map that acts like a javascript associative array. |
static <K,V> java.util.concurrent.ConcurrentHashMap<K,V> |
newConcurrentHashMap()
Factory method for create a new
ConcurrentHashMap |
static <K,V> java.util.concurrent.ConcurrentHashMap<K,V> |
newConcurrentHashMap(int initialCapacity)
Factory method for create a new
ConcurrentHashMap |
static <K,V> java.util.concurrent.ConcurrentHashMap<K,V> |
newConcurrentHashMap(java.util.Map<K,V> map)
Factory method for create a new
ConcurrentHashMap |
static <K> java.util.Map<K,java.lang.Integer> |
newCounterMap(java.util.Collection<K> elements)
Factory method for create a map for counting elements of the given collection
|
static <K,V> java.util.Map<K,V> |
newHashMap()
Factory method for create a new
HashMap |
static <K,V> java.util.Map<K,V> |
newHashMap(java.util.Collection<de.alpharogroup.collections.pairs.KeyValuePair<K,V>> keyValuePairs)
Factory method for create a new
HashMap |
static <K,V> java.util.Map<K,V> |
newHashMap(int initialCapacity)
Factory method for create a new
HashMap |
static <K,V> java.util.Map<K,V> |
newHashMap(de.alpharogroup.collections.pairs.KeyValuePair<K,V>... keyValuePairs)
Factory method for create a new
HashMap |
static <K,V> java.util.Map<K,V> |
newHashMap(java.util.Map<K,V> map)
Factory method for create a new
HashMap |
static <K,V> java.util.Map<K,V> |
newInsertionOrderMap()
Factory method for create a new
InsertionOrderMap |
static <K,V> java.util.Map<K,V> |
newInsertionOrderMap(java.util.Collection<de.alpharogroup.collections.pairs.KeyValuePair<K,V>> keyValuePairs)
Factory method for create a new
InsertionOrderMap |
static <K,V> java.util.Map<K,V> |
newInsertionOrderMap(int initialCapacity)
Factory method for create a new
InsertionOrderMap |
static <K,V> java.util.Map<K,V> |
newInsertionOrderMap(de.alpharogroup.collections.pairs.KeyValuePair<K,V>... keyValuePairs)
Factory method for create a new
InsertionOrderMap |
static <K,V> java.util.Map<K,V> |
newInsertionOrderMap(java.util.Map<K,V> map)
Factory method for create a new
InsertionOrderMap |
static <K,V> java.util.Map<K,V> |
newLazyHashMap()
Factory method for create a new
LazyMap from commons-collections4 that encapsulates a
HashMap |
static <K,V> java.util.Map<K,V> |
newLazyHashMap(java.util.HashMap<K,V> map)
Factory method for create a new
LazyMap from commons-collections4 that encapsulates a
HashMap |
static <K,V> java.util.Map<K,V> |
newLazyMap()
Factory method for create a new
LazyMap from commons-collections4 that encapsulates a
HashMap |
static <K,V> java.util.Map<K,V> |
newLazyTreeMap()
Factory method for create a new
LazyMap from commons-collections4 that encapsulates a
TreeMap |
static <K,V> java.util.Map<K,V> |
newLazyTreeMap(java.util.Comparator<? super K> comparator)
Factory method for create a new
LazyMap from commons-collections4 that encapsulates a
TreeMap |
static <K,V> java.util.Map<K,V> |
newLazyTreeMap(java.util.TreeMap<K,V> map)
Factory method for create a new
LazyMap from commons-collections4 that encapsulates a
TreeMap |
static <K,V> java.util.Map<K,V> |
newLinkedHashMap()
Factory method for create a new
LinkedHashMap |
static <K,V> java.util.Map<K,V> |
newLinkedHashMap(java.util.Collection<de.alpharogroup.collections.pairs.KeyValuePair<K,V>> keyValuePairs)
Factory method for create a new
LinkedHashMap |
static <K,V> java.util.Map<K,V> |
newLinkedHashMap(int initialCapacity)
Factory method for create a new
LinkedHashMap |
static <K,V> java.util.Map<K,V> |
newLinkedHashMap(de.alpharogroup.collections.pairs.KeyValuePair<K,V>... keyValuePairs)
Factory method for create a new
LinkedHashMap |
static <K,V> java.util.Map<K,V> |
newLinkedHashMap(java.util.Map<K,V> map)
Factory method for create a new
LinkedHashMap |
static <K,V> java.util.Map<K,V> |
newTreeMap()
Factory method for create a new
TreeMap |
static <K,V> java.util.Map<K,V> |
newTreeMap(java.util.Collection<de.alpharogroup.collections.pairs.KeyValuePair<K,V>> keyValuePairs)
Factory method for create a new
TreeMap |
static <K,V> java.util.Map<K,V> |
newTreeMap(java.util.Comparator<? super K> comparator)
Factory method for create a new
TreeMap |
static <K,V> java.util.Map<K,V> |
newTreeMap(java.util.Comparator<? super K> comparator,
java.util.Collection<de.alpharogroup.collections.pairs.KeyValuePair<K,V>> keyValuePairs)
Factory method for create a new
TreeMap |
static <K,V> java.util.Map<K,V> |
newTreeMap(java.util.Comparator<? super K> comparator,
de.alpharogroup.collections.pairs.KeyValuePair<K,V>... keyValuePairs)
Factory method for create a new
TreeMap |
static <K,V> java.util.Map<K,V> |
newTreeMap(de.alpharogroup.collections.pairs.KeyValuePair<K,V>... keyValuePairs)
Factory method for create a new
TreeMap |
static <K,V> java.util.Map<K,V> |
newTreeMap(java.util.Map<K,V> map)
Factory method for create a new
TreeMap |
public static java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.lang.String>> newAssosiativeArrayMap()
Map that acts like a javascript associative array.
This Map is the counterpart for the associative array in js.
For instance: in js you can create and fetch associative arrays like this:
$arrayObj[0]['firstName'] = 'Albert'; $arrayObj[0]['lastName'] = 'Einstein'; $arrayObj[1]['firstName'] = 'Neil'; $arrayObj[0]['lastName'] = 'Armstrong';With this method you can do the same like this:
final Map<Integer, Map<String, String>> arrayMap = MapExtensions.newAssosiativeArrayMap();
arrayMap.get(0).put("firstName", "Albert");
arrayMap.get(0).put("lastName", "Einstein");
arrayMap.get(1).put("firstName", "Neil");
arrayMap.get(1).put("lastName", "Armstrong");
Map that acts like a javascript associative arraypublic static <K,V> java.util.concurrent.ConcurrentHashMap<K,V> newConcurrentHashMap()
ConcurrentHashMapK - the generic type of the keyV - the generic type of the valueConcurrentHashMappublic static <K,V> java.util.concurrent.ConcurrentHashMap<K,V> newConcurrentHashMap(int initialCapacity)
ConcurrentHashMapK - the generic type of the keyV - the generic type of the valueinitialCapacity - the initial capacityConcurrentHashMappublic static <K,V> java.util.concurrent.ConcurrentHashMap<K,V> newConcurrentHashMap(java.util.Map<K,V> map)
ConcurrentHashMapK - the generic type of the keyV - the generic type of the valuemap - the mapConcurrentHashMappublic static <K> java.util.Map<K,java.lang.Integer> newCounterMap(java.util.Collection<K> elements)
K - the generic type of the elementselements - the elementspublic static <K,V> java.util.Map<K,V> newHashMap()
HashMapK - the generic type of the keyV - the generic type of the valueHashMappublic static <K,V> java.util.Map<K,V> newHashMap(java.util.Collection<de.alpharogroup.collections.pairs.KeyValuePair<K,V>> keyValuePairs)
HashMapK - the generic type of the keyV - the generic type of the valuekeyValuePairs - the collection with the key value pairsHashMappublic static <K,V> java.util.Map<K,V> newHashMap(int initialCapacity)
HashMapK - the generic type of the keyV - the generic type of the valueinitialCapacity - the initial capacityHashMap@SafeVarargs public static <K,V> java.util.Map<K,V> newHashMap(de.alpharogroup.collections.pairs.KeyValuePair<K,V>... keyValuePairs)
HashMapK - the generic type of the keyV - the generic type of the valuekeyValuePairs - the key value pairs to add in the new HashMapHashMappublic static <K,V> java.util.Map<K,V> newHashMap(java.util.Map<K,V> map)
HashMapK - the generic type of the keyV - the generic type of the valuemap - the mapHashMappublic static <K,V> java.util.Map<K,V> newInsertionOrderMap()
InsertionOrderMapK - the generic type of the keyV - the generic type of the valueInsertionOrderMappublic static <K,V> java.util.Map<K,V> newInsertionOrderMap(java.util.Collection<de.alpharogroup.collections.pairs.KeyValuePair<K,V>> keyValuePairs)
InsertionOrderMapK - the generic type of the keyV - the generic type of the valuekeyValuePairs - the collection with the key value pairsInsertionOrderMappublic static <K,V> java.util.Map<K,V> newInsertionOrderMap(int initialCapacity)
InsertionOrderMapK - the generic type of the keyV - the generic type of the valueinitialCapacity - the initial capacityInsertionOrderMap@SafeVarargs public static <K,V> java.util.Map<K,V> newInsertionOrderMap(de.alpharogroup.collections.pairs.KeyValuePair<K,V>... keyValuePairs)
InsertionOrderMapK - the generic type of the keyV - the generic type of the valuekeyValuePairs - the key value pairs to add in the new InsertionOrderMapInsertionOrderMappublic static <K,V> java.util.Map<K,V> newInsertionOrderMap(java.util.Map<K,V> map)
InsertionOrderMapK - the generic type of the keyV - the generic type of the valuemap - the mapInsertionOrderMappublic static <K,V> java.util.Map<K,V> newLazyHashMap()
LazyMap from commons-collections4 that encapsulates a
HashMapK - the generic type of the keyV - the generic type of the valueLazyMappublic static <K,V> java.util.Map<K,V> newLazyHashMap(java.util.HashMap<K,V> map)
LazyMap from commons-collections4 that encapsulates a
HashMapK - the generic type of the keyV - the generic type of the valuemap - the map to initialize with itLazyMappublic static <K,V> java.util.Map<K,V> newLazyMap()
LazyMap from commons-collections4 that encapsulates a
HashMapK - the generic type of the keyV - the generic type of the valueLazyMappublic static <K,V> java.util.Map<K,V> newLazyTreeMap()
LazyMap from commons-collections4 that encapsulates a
TreeMapK - the generic type of the keyV - the generic type of the valueLazyMappublic static <K,V> java.util.Map<K,V> newLazyTreeMap(java.util.Comparator<? super K> comparator)
LazyMap from commons-collections4 that encapsulates a
TreeMapK - the generic type of the keyV - the generic type of the valuecomparator - the comparatorLazyMappublic static <K,V> java.util.Map<K,V> newLazyTreeMap(java.util.TreeMap<K,V> map)
LazyMap from commons-collections4 that encapsulates a
TreeMapK - the generic type of the keyV - the generic type of the valuemap - the mapLazyMappublic static <K,V> java.util.Map<K,V> newLinkedHashMap()
LinkedHashMapK - the generic type of the keyV - the generic type of the valueLinkedHashMappublic static <K,V> java.util.Map<K,V> newLinkedHashMap(java.util.Collection<de.alpharogroup.collections.pairs.KeyValuePair<K,V>> keyValuePairs)
LinkedHashMapK - the generic type of the keyV - the generic type of the valuekeyValuePairs - the collection with the key value pairsLinkedHashMappublic static <K,V> java.util.Map<K,V> newLinkedHashMap(int initialCapacity)
LinkedHashMapK - the generic type of the keyV - the generic type of the valueinitialCapacity - the initial capacityLinkedHashMap@SafeVarargs public static <K,V> java.util.Map<K,V> newLinkedHashMap(de.alpharogroup.collections.pairs.KeyValuePair<K,V>... keyValuePairs)
LinkedHashMapK - the generic type of the keyV - the generic type of the valuekeyValuePairs - the key value pairs to add in the new LinkedHashMapLinkedHashMappublic static <K,V> java.util.Map<K,V> newLinkedHashMap(java.util.Map<K,V> map)
LinkedHashMapK - the generic type of the keyV - the generic type of the valuemap - the mapLinkedHashMappublic static <K,V> java.util.Map<K,V> newTreeMap()
TreeMapK - the generic type of the keyV - the generic type of the valueTreeMappublic static <K,V> java.util.Map<K,V> newTreeMap(java.util.Collection<de.alpharogroup.collections.pairs.KeyValuePair<K,V>> keyValuePairs)
TreeMapK - the generic type of the keyV - the generic type of the valuekeyValuePairs - the collection with the key value pairsTreeMappublic static <K,V> java.util.Map<K,V> newTreeMap(java.util.Comparator<? super K> comparator)
TreeMapK - the generic type of the keyV - the generic type of the valuecomparator - the comparatorTreeMappublic static <K,V> java.util.Map<K,V> newTreeMap(java.util.Comparator<? super K> comparator,
java.util.Collection<de.alpharogroup.collections.pairs.KeyValuePair<K,V>> keyValuePairs)
TreeMapK - the generic type of the keyV - the generic type of the valuecomparator - the comparatorkeyValuePairs - the key value pairsTreeMap@SafeVarargs
public static <K,V> java.util.Map<K,V> newTreeMap(java.util.Comparator<? super K> comparator,
de.alpharogroup.collections.pairs.KeyValuePair<K,V>... keyValuePairs)
TreeMapK - the generic type of the keyV - the generic type of the valuecomparator - the comparatorkeyValuePairs - the key value pairs to add in the new TreeMapTreeMap@SafeVarargs public static <K,V> java.util.Map<K,V> newTreeMap(de.alpharogroup.collections.pairs.KeyValuePair<K,V>... keyValuePairs)
TreeMapK - the generic type of the keyV - the generic type of the valuekeyValuePairs - the key value pairs to add in the new TreeMapTreeMappublic static <K,V> java.util.Map<K,V> newTreeMap(java.util.Map<K,V> map)
TreeMapK - the generic type of the keyV - the generic type of the valuemap - the mapTreeMap