String
- key as string because we provide case-insensitive operationsV
- value to be looking uppublic class LookupMap<String,V> extends Object implements Map<String,V>
Map
implementation that supports case-sensitive and
case-insensitive operations.Constructor and Description |
---|
LookupMap(Map<String,V> backingMap)
Creates a new instance of a lookup map backed by the specified map.
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
V |
compute(String key,
BiFunction<? super String,? super V,? extends V> remappingFunction) |
V |
computeIfAbsent(String key,
Function<? super String,? extends V> mappingFunction) |
V |
computeIfPresent(String key,
BiFunction<? super String,? super V,? extends V> remappingFunction) |
boolean |
containsKey(Object key) |
boolean |
containsKeyCaseInsensitive(String key)
Searches the map and determines if a case-insensitive key exists.
|
boolean |
containsValue(Object value) |
Set<Map.Entry<String,V>> |
entrySet() |
boolean |
equals(Object o) |
void |
forEach(BiConsumer<? super String,? super V> action) |
V |
get(Object key) |
V |
getOrDefault(Object key,
V defaultValue) |
V |
getWithCaseInsensitiveKey(String key)
Searches the map for a value by a case-insensitive key.
|
int |
hashCode() |
boolean |
isEmpty() |
Set<String> |
keySet() |
Set<String> |
lowercaseKeySet() |
V |
merge(String key,
V value,
BiFunction<? super V,? super V,? extends V> remappingFunction) |
V |
put(String key,
V value) |
void |
putAll(Map<? extends String,? extends V> m) |
V |
putIfAbsent(String key,
V value) |
V |
remove(Object key) |
boolean |
remove(Object key,
Object value) |
V |
replace(String key,
V value) |
boolean |
replace(String key,
V oldValue,
V newValue) |
void |
replaceAll(BiFunction<? super String,? super V,? extends V> function) |
int |
size() |
Collection<V> |
values() |
public boolean containsKeyCaseInsensitive(String key)
key
- case-insensitive keypublic V getWithCaseInsensitiveKey(String key)
key
- case-insensitive keypublic boolean containsKey(Object key)
containsKey
in interface Map<String,V>
public boolean containsValue(Object value)
containsValue
in interface Map<String,V>
public boolean equals(Object o)
public int hashCode()
public V getOrDefault(Object key, V defaultValue)
getOrDefault
in interface Map<String,V>
public void forEach(BiConsumer<? super String,? super V> action)
public void replaceAll(BiFunction<? super String,? super V,? extends V> function)
replaceAll
in interface Map<String,V>
public V putIfAbsent(String key, V value)
putIfAbsent
in interface Map<String,V>
public V computeIfAbsent(String key, Function<? super String,? extends V> mappingFunction)
computeIfAbsent
in interface Map<String,V>
public V computeIfPresent(String key, BiFunction<? super String,? super V,? extends V> remappingFunction)
computeIfPresent
in interface Map<String,V>
public V compute(String key, BiFunction<? super String,? super V,? extends V> remappingFunction)
Copyright © 2012–2018 Joyent. All rights reserved.