Reusable Java library of general tools with minimal external dependencies.
For questions or support, please contact us:
Email: support@aoindustries.com
Phone: 1-800-519-9541
Phone: +1-251-607-9556
Web: https://www.aoindustries.com/contact
public class MinimalMap extends Object
Insertion order is maintained.
size=0: null
size=1: Collections.singletonMap
size=2: LinkedHashMap
| Modifier and Type | Method and Description |
|---|---|
static <K,V> boolean |
containsKey(Map<K,V> map,
K key)
Checks if a key is contained in the map.
|
static <K,V> Map<K,V> |
copy(Map<K,V> map)
Performs a shallow copy of a map.
|
static <K,V> V |
get(Map<K,V> map,
K key)
Gets an element from a map.
|
static <K,V> Map<K,V> |
put(Map<K,V> map,
K key,
V value)
Puts a new element in a map, returning the (possibly new) map.
|
static <K,V> Map<K,V> |
remove(Map<K,V> map,
K key)
Removes an element from a map, returning the (possibly new) map.
|
static <K,V> Map<K,V> |
unmodifiable(Map<K,V> map)
Gets an unmodifiable wrapper around this list.
|
static <K,V> Collection<V> |
values(Map<K,V> map)
Gets the value collection.
|
static <K,V> Collection<V> |
valuesCopy(Map<K,V> map)
Performs a shallow copy of the value collection.
|
public static <K,V> Map<K,V> put(Map<K,V> map, K key, V value)
public static <K,V> Map<K,V> remove(Map<K,V> map, K key)
public static <K,V> V get(Map<K,V> map, K key)
public static <K,V> boolean containsKey(Map<K,V> map, K key)
public static <K,V> Collection<V> values(Map<K,V> map)
public static <K,V> Collection<V> valuesCopy(Map<K,V> map)
public static <K,V> Map<K,V> copy(Map<K,V> map)
Copyright © 2000–2016 AO Industries, Inc.. All rights reserved.