K
- Type of the keys.V
- Type of the values.@ThreadSafety(level=NOT_THREAD_SAFE, doc="Please initialize your maps with a static initializer") public final class BiDirectionalMap<K,V> extends Object
EnumMapper
when mapping two enumerated types.Constructor and Description |
---|
BiDirectionalMap(Class<K> keyClass,
Class<V> valueClass)
Constructs this BiDirectionalMap from the supplied keyClass and
valueClass.
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(K key)
Determines whether the supplied key is mapped to a value.
|
boolean |
containsValue(V value)
Determines whether the supplied value is mapped to a key.
|
K |
getKey(V value)
Gets the key that is mapped to the supplied value.
|
V |
getValue(K key)
Gets the value that is mapped to the supplied key.
|
void |
map(K key,
V value)
Maps the supplied key to the supplied value and vice versa.
|
public BiDirectionalMap(Class<K> keyClass, Class<V> valueClass)
keyClass
- The class type of the keys.valueClass
- The class type of the values.NullPointerException
- When either the supplied keyClass or the
supplied valueClass is null.public void map(K key, V value)
key
- The key.value
- The value.NullPointerException
- When either the supplied key or value is
null.public boolean containsKey(K key)
key
- The key to check for a mapped value.public V getValue(K key)
key
- The key to get the mapped value of.IllegalArgumentException
- When the supplied key has not been
mapped.NullPointerException
- when the supplied key is null.public boolean containsValue(V value)
value
- The value to check for a mapped key.public K getKey(V value)
value
- The value to get the mapped key of.IllegalArgumentException
- When the supplied value has not been
mapped.NullPointerException
- when the supplied value is null.Copyright © 2008–2018. All rights reserved.