public class CustomMap<K,V> extends Object implements Map<K,V>, Serializable
hash()
and equals()
can be customized for all the Map.Modifier and Type | Class and Description |
---|---|
protected static class |
CustomMap.DefaultMapKey<K>
A default implementation of the Map with customized hash() and equals() functions.
|
Constructor and Description |
---|
CustomMap()
The same mapper as a
HashMap |
CustomMap(Function<K,MapKeyProxy<K>> keyFactory)
Mapper with a required equals and hasCode maker
|
CustomMap(HashMap<MapKeyProxy<K>,V> impl,
Function<K,MapKeyProxy<K>> keyFactory)
Full configuration mapper
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<K,V>> |
entrySet()
Deprecated.
Method is not implemented yet.
|
V |
get(Object key) |
boolean |
isEmpty() |
Set<K> |
keySet() |
Set<MapKeyProxy<K>> |
keySetProxy()
Returns a set fo the proxy key
|
V |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> m) |
V |
remove(Object key) |
int |
size() |
Collection<V> |
values() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
public CustomMap()
HashMap
public CustomMap(@Nonnull Function<K,MapKeyProxy<K>> keyFactory)
public CustomMap(@Nonnull HashMap<MapKeyProxy<K>,V> impl, @Nonnull Function<K,MapKeyProxy<K>> keyFactory)
public boolean containsKey(@Nullable Object key)
containsKey
in interface Map<K,V>
public boolean containsValue(@Nullable Object value)
containsValue
in interface Map<K,V>
public Set<MapKeyProxy<K>> keySetProxy()
Copyright 2019-2022, Pavel Ponec