Package org.geotools.jdbc
Class EnumMapping
- Object
-
- EnumMapping
-
public class EnumMapping extends Object
Helper class for enums.
-
-
Constructor Summary
Constructors Constructor Description EnumMapping()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMapping(String key, String value)
Adds a key/value mappingString
fromKey(String key)
Retrieves the value associated with the given key.String
fromValue(String value)
Retrieves the key associated with the given value.String
fromValue(String value, boolean matchCase)
Retrieves the key associated with the given value.Map<String,String>
keyToValueMap()
Returns an unmodifiable view of the key-to-value mappings.Map<String,String>
valueToKeyMap()
Returns an unmodifiable view of the value-to-key mappings.
-
-
-
Method Detail
-
fromKey
public String fromKey(String key)
Retrieves the value associated with the given key.- Parameters:
key
- the key to look up- Returns:
- the value mapped to the given key, or
null
if no mapping exists
-
fromValue
public String fromValue(String value)
Retrieves the key associated with the given value.- Parameters:
value
- the value to look up- Returns:
- the key mapped to the given value, or
null
if no mapping exists
-
fromValue
public String fromValue(String value, boolean matchCase)
Retrieves the key associated with the given value.- Parameters:
value
- the value to look upmatchCase
-true
to perform a case-sensitive lookup,false
otherwise- Returns:
- the key mapped to the given value, or
null
if no mapping exists
-
keyToValueMap
public Map<String,String> keyToValueMap()
Returns an unmodifiable view of the key-to-value mappings.- Returns:
- an unmodifiable
Map
containing the key-to-value mappings
-
-