Package tools.set
Class CustomMap<K,V>
java.lang.Object
tools.set.CustomMap<K,V>
- All Implemented Interfaces:
Serializable,Map<K,V>
Implementation of the Map interface where methods
hash() and equals() can be customized for all the Map.- Author:
- Pavel Ponec
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classA default implementation of the Map with customized hash() and equals() functions. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleancontainsKey(@Nullable Object key) booleancontainsValue(@Nullable Object value) entrySet()Deprecated.Method is not implemented yet.booleanisEmpty()keySet()Set<MapKeyProxy<K>>Returns a set fo the proxy keyvoidintsize()values()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
CustomMap
public CustomMap()The same mapper as aHashMap -
CustomMap
Mapper with a required equals and hasCode maker -
CustomMap
public CustomMap(@NotNull @NotNull HashMap<MapKeyProxy<K>, V> impl, @NotNull @NotNull Function<K, MapKeyProxy<K>> keyFactory) Full configuration mapper
-
-
Method Details
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKeyin interfaceMap<K,V>
-
containsValue
- Specified by:
containsValuein interfaceMap<K,V>
-
get
-
put
-
remove
-
putAll
-
clear
public void clear() -
keySet
-
keySetProxy
Returns a set fo the proxy key -
values
-
entrySet
Deprecated.Method is not implemented yet.
-