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 void
clear()
boolean
containsKey(Object key)
boolean
containsValue(Object value)
Set<Map.Entry<K,V>>
entrySet()
boolean
equals(Object o)
V
get(Object key)
int
hashCode()
boolean
isEmpty()
Set<K>
keySet()
V
put(K key, V value)
void
putAll(Map<? extends K,? extends V> m)
V
putIfAbsent(K key, V value)
V
remove(Object key)
boolean
remove(Object key, Object value)
V
replace(K key, V value)
boolean
replace(K key, V oldValue, V newValue)
int
size()
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:
putIfAbsent
in interfaceConcurrentMap<K,V>
- Specified by:
putIfAbsent
in interfaceMap<K,V>
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKey
in interfaceMap<K,V>
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValue
in interfaceMap<K,V>
-
equals
public boolean equals(Object o)
-
-