Package groovy.lang
Class SpreadMap
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap
groovy.lang.SpreadMap
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.util.Map
public class SpreadMap
extends java.util.HashMap
Helper to turn a list with an even number of elements into a Map.
- See Also:
- Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,V extends java.lang.Object>
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K extends java.lang.Object,V extends java.lang.Object>
-
Constructor Summary
-
Method Summary
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, putIfAbsent, remove, replace, replace, replaceAll, size, values
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
SpreadMap
public SpreadMap(java.lang.Object[] values) -
SpreadMap
public SpreadMap(java.util.Map map) -
SpreadMap
public SpreadMap(java.util.List list)- Parameters:
list
- the list to make spreadable- Since:
- 1.8.0
-
-
Method Details
-
put
public java.lang.Object put(java.lang.Object key, java.lang.Object value)- Specified by:
put
in interfacejava.util.Map
- Overrides:
put
in classjava.util.HashMap
-
remove
public java.lang.Object remove(java.lang.Object key)- Specified by:
remove
in interfacejava.util.Map
- Overrides:
remove
in classjava.util.HashMap
-
putAll
public void putAll(java.util.Map t)- Specified by:
putAll
in interfacejava.util.Map
- Overrides:
putAll
in classjava.util.HashMap
-
equals
public boolean equals(java.lang.Object that)- Specified by:
equals
in interfacejava.util.Map
- Overrides:
equals
in classjava.util.AbstractMap
-
equals
-
hashCode
public int hashCode()- Specified by:
hashCode
in interfacejava.util.Map
- Overrides:
hashCode
in classjava.util.AbstractMap
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.util.AbstractMap
- Returns:
- the string expression of
this
-