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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear the mapGet an item from the map.booleanisEmpty()Check whether this map is empty.iterator()voidPut an item in the mapvoidputAll(KeyValueMap<T> map) Put all items from the other map in this mapRemove an item from the mapintsize()Get the size of the map.toString()Methods inherited from class org.apache.sling.provisioning.model.Commentable
getComment, setCommentMethods inherited from class org.apache.sling.provisioning.model.Traceable
getLocation, setLocationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:
trueif the map is empty.
-
toString
- Overrides:
toStringin 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
-