Package com.evolveum.midpoint.prism.path
Class PathKeyedMap<T>
- java.lang.Object
-
- com.evolveum.midpoint.prism.path.PathKeyedMap<T>
-
- All Implemented Interfaces:
Serializable
,Map<ItemPath,T>
@Experimental public class PathKeyedMap<T> extends Object implements Map<ItemPath,T>, Serializable
Special case of a map that has ItemPath as a key. The main issue with path-keyed maps is that comparing item paths using equals/hashCode is unreliable. UniformItemPath was conceived as way to improve that, but even it does not solve this issue completely. An alternative design to this class would be to use some wrapper class for ItemPath that would provide equals() method with the same semantics as equivalent(). But what about hashCode then? This map does _not_ support null keys. Also, collections returned by keySet(), values(), entrySet() are not modifiable.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PathKeyedMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
boolean
containsKey(Object key)
boolean
containsValue(Object value)
@NotNull Set<Map.Entry<ItemPath,T>>
entrySet()
T
get(Object key)
boolean
isEmpty()
@NotNull Set<ItemPath>
keySet()
T
put(ItemPath key, T value)
void
putAll(@NotNull Map<? extends ItemPath,? extends T> m)
T
remove(Object key)
int
size()
@NotNull Collection<T>
values()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Method Detail
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKey
in interfaceMap<ItemPath,T>
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValue
in interfaceMap<ItemPath,T>
-
values
@NotNull public @NotNull Collection<T> values()
-
-