Package com.atlassian.bamboo.util
Class OptionUnpackingMap<K,V>
- java.lang.Object
-
- com.atlassian.bamboo.util.OptionUnpackingMap<K,V>
-
- All Implemented Interfaces:
ConcurrentMap<K,V>,Map<K,V>
@ExperimentalApi public class OptionUnpackingMap<K,V> extends Object implements ConcurrentMap<K,V>
This class provides an adapter between a Map containing Option values and a map providing direct nullable values. It's meant to be used for Google nullable Caches, which do not have mutability. If you're planning on using it, make sure you UT the method you're using! It says experimental in the annotation below!
-
-
Constructor Summary
Constructors Constructor Description OptionUnpackingMap(ConcurrentMap<K,io.atlassian.fugue.Option<V>> mapWithOptions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()booleancontainsKey(Object key)booleancontainsValue(Object value)Set<Map.Entry<K,V>>entrySet()booleanequals(Object o)Vget(Object key)inthashCode()booleanisEmpty()Set<K>keySet()Vput(K key, V value)voidputAll(Map<? extends K,? extends V> m)VputIfAbsent(K key, V value)Vremove(Object key)booleanremove(Object key, Object value)Vreplace(K key, V value)booleanreplace(K key, V oldValue, V newValue)intsize()Collection<V>values()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.concurrent.ConcurrentMap
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, replaceAll
-
-
-
-
Constructor Detail
-
OptionUnpackingMap
public OptionUnpackingMap(ConcurrentMap<K,io.atlassian.fugue.Option<V>> mapWithOptions)
-
-
Method Detail
-
putIfAbsent
@Nullable public V putIfAbsent(K key, V value)
- Specified by:
putIfAbsentin interfaceConcurrentMap<K,V>- Specified by:
putIfAbsentin interfaceMap<K,V>
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKeyin interfaceMap<K,V>
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValuein interfaceMap<K,V>
-
equals
public boolean equals(Object o)
-
-