Package org.apache.commons.text
Class StrLookup.MapStrLookup<V>
- java.lang.Object
-
- org.apache.commons.text.StrLookup<V>
-
- org.apache.commons.text.StrLookup.MapStrLookup<V>
-
- Type Parameters:
V- the type of the values supported by the lookup
- All Implemented Interfaces:
StringLookup
static class StrLookup.MapStrLookup<V> extends StrLookup<V>
Lookup implementation that uses a Map.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.commons.text.StrLookup
StrLookup.MapStrLookup<V>
-
-
Constructor Summary
Constructors Constructor Description MapStrLookup(Map<String,V> map)Creates a new instance backed by a Map.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringlookup(String key)Looks up a String key to a String value using the map.StringtoString()-
Methods inherited from class org.apache.commons.text.StrLookup
mapLookup, noneLookup, resourceBundleLookup, systemPropertiesLookup
-
-
-
-
Method Detail
-
lookup
public String lookup(String key)
Looks up a String key to a String value using the map.If the map is null, then null is returned. The map result object is converted to a string using toString().
- Parameters:
key- the key to be looked up, may be null- Returns:
- The matching value, null if no match
-
-