Package com.vaadin.browserless.mocks
Class MockUtils
java.lang.Object
com.vaadin.browserless.mocks.MockUtils
Helpers shared by the mocks in this package.
For internal use only. May be renamed or removed in a future release.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <K,V> void putOrRemove(Map<K, V> map, K key, V value) Stores the value under the key, or removes the key when the value isnull.
-
Method Details
-
putOrRemove
Stores the value under the key, or removes the key when the value isnull.This is what the servlet API asks for: setting an attribute to
nullremoves it. It also keeps the mocks usable with a map that rejects null values, such asConcurrentHashMap.- Type Parameters:
K- the key typeV- the value type- Parameters:
map- the map to modifykey- the key to store under or removevalue- the value to store, ornullto remove the key
-