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 voidaddMapping(String key, String value)Adds a key/value mappingStringfromKey(String key)Retrieves the value associated with the given key.StringfromValue(String value)Retrieves the key associated with the given value.StringfromValue(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
nullif 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
nullif 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-trueto perform a case-sensitive lookup,falseotherwise- Returns:
- the key mapped to the given value, or
nullif no mapping exists
-
keyToValueMap
public Map<String,String> keyToValueMap()
Returns an unmodifiable view of the key-to-value mappings.- Returns:
- an unmodifiable
Mapcontaining the key-to-value mappings
-
-