Class KeyValueMap<T>
java.lang.Object
org.apache.sling.provisioning.model.Traceable
org.apache.sling.provisioning.model.Commentable
org.apache.sling.provisioning.model.KeyValueMap<T>
Helper class to hold key value pairs.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clear the mapGet an item from the map.boolean
isEmpty()
Check whether this map is empty.iterator()
void
Put an item in the mapvoid
putAll
(KeyValueMap<T> map) Put all items from the other map in this mapRemove an item from the mapint
size()
Get the size of the map.toString()
Methods inherited from class org.apache.sling.provisioning.model.Commentable
getComment, setComment
Methods inherited from class org.apache.sling.provisioning.model.Traceable
getLocation, setLocation
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
KeyValueMap
public KeyValueMap()
-
-
Method Details
-
get
Get an item from the map.- Parameters:
key
- The key of the item.- Returns:
- The item or
null
.
-
put
Put an item in the map- Parameters:
key
- The key of the item.value
- The value
-
remove
Remove an item from the map- Parameters:
key
- The key of the item.- Returns:
- The previously stored value for the key or
null
. - Since:
- 1.1
-
putAll
Put all items from the other map in this map- Parameters:
map
- The other map
-
iterator
-
isEmpty
public boolean isEmpty()Check whether this map is empty.- Returns:
true
if the map is empty.
-
toString
- Overrides:
toString
in classCommentable
-
size
public int size()Get the size of the map.- Returns:
- The size of the map.
- Since:
- 1.1
-
clear
public void clear()Clear the map- Since:
- 1.7
-