public final class MapFactory extends Object
| Constructor and Description |
|---|
MapFactory() |
| Modifier and Type | Method and Description |
|---|---|
static Map<Integer,Map<String,String>> |
newAssosiativeArrayMap()
Factory method for
Map that acts like a javascript associative array. |
static <K,V> ConcurrentHashMap<K,V> |
newConcurrentHashMap()
Factory method for create a new
ConcurrentHashMap. |
static <K,V> ConcurrentHashMap<K,V> |
newConcurrentHashMap(int initialCapacity)
Factory method for create a new
ConcurrentHashMap. |
static <K,V> Map<K,V> |
newHashMap()
Factory method for create a new
HashMap. |
static <K,V> Map<K,V> |
newHashMap(int initialCapacity)
Factory method for create a new
HashMap. |
static <K,V> Map<K,V> |
newInsertionOrderMap()
Factory method for create a new
InsertionOrderMap. |
static <K,V> Map<K,V> |
newLazyMap()
Factory method for create a new
LazyMap from commons-collections4 that encapsulates a
HashMap. |
static <K,V> Map<K,V> |
newLazyTreeMap()
Factory method for create a new
LazyMap from commons-collections4 that encapsulates a
TreeMap. |
static <K,V> Map<K,V> |
newLazyTreeMap(Comparator<? super K> comparator)
Factory method for create a new
LazyMap from commons-collections4 that encapsulates a
TreeMap. |
static <K,V> Map<K,V> |
newLinkedHashMap()
Factory method for create a new
LinkedHashMap. |
static <K,V> Map<K,V> |
newLinkedHashMap(int initialCapacity)
Factory method for create a new
LinkedHashMap. |
static <K,V> Map<K,V> |
newTreeMap()
Factory method for create a new
TreeMap. |
static <K,V> Map<K,V> |
newTreeMap(Comparator<? super K> comparator)
Factory method for create a new
TreeMap. |
public static <K,V> Map<K,V> newInsertionOrderMap()
InsertionOrderMap.K - the generic type of the keyV - the generic type of the valueInsertionOrderMap.public static Map<Integer,Map<String,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 array.public static <K,V> ConcurrentHashMap<K,V> newConcurrentHashMap()
ConcurrentHashMap.K - the generic type of the keyV - the generic type of the valueConcurrentHashMap.public static <K,V> ConcurrentHashMap<K,V> newConcurrentHashMap(int initialCapacity)
ConcurrentHashMap.K - the generic type of the keyV - the generic type of the valueinitialCapacity - the initial capacityConcurrentHashMap.public static <K,V> Map<K,V> newHashMap()
HashMap.K - the generic type of the keyV - the generic type of the valueHashMap.public static <K,V> Map<K,V> newLinkedHashMap()
LinkedHashMap.K - the generic type of the keyV - the generic type of the valueLinkedHashMap.public static <K,V> Map<K,V> newLinkedHashMap(int initialCapacity)
LinkedHashMap.K - the generic type of the keyV - the generic type of the valueinitialCapacity - the initial capacityLinkedHashMap.public static <K,V> Map<K,V> newHashMap(int initialCapacity)
HashMap.K - the generic type of the keyV - the generic type of the valueinitialCapacity - the initial capacityHashMap.public static <K,V> Map<K,V> newLazyMap()
LazyMap from commons-collections4 that encapsulates a
HashMap.K - the generic type of the keyV - the generic type of the valueLazyMap.public static <K,V> Map<K,V> newLazyTreeMap()
LazyMap from commons-collections4 that encapsulates a
TreeMap.K - the generic type of the keyV - the generic type of the valueLazyMap.public static <K,V> Map<K,V> newLazyTreeMap(Comparator<? super K> comparator)
LazyMap from commons-collections4 that encapsulates a
TreeMap.K - the generic type of the keyV - the generic type of the valuecomparator - the comparatorLazyMap.public static <K,V> Map<K,V> newTreeMap()
TreeMap.K - the generic type of the keyV - the generic type of the valueTreeMap.public static <K,V> Map<K,V> newTreeMap(Comparator<? super K> comparator)
TreeMap.K - the generic type of the keyV - the generic type of the valuecomparator - the comparatorTreeMap.Copyright © 2015–2018 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.