public abstract class LookupExtractor extends Object
Constructor and Description |
---|
LookupExtractor() |
Modifier and Type | Method and Description |
---|---|
abstract String |
apply(String key)
Apply a particular lookup methodology to the input string
|
Map<String,String> |
applyAll(Iterable<String> keys) |
abstract byte[] |
getCacheKey()
Create a cache key for use in results caching
|
boolean |
isOneToOne() |
abstract List<String> |
unapply(String value)
Provide the reverse mapping from a given value to a list of keys
|
Map<String,List<String>> |
unapplyAll(Iterable<String> values) |
@Nullable public abstract String apply(@NotNull String key)
key
- The value to apply the lookup to. May not be nullpublic Map<String,String> applyAll(Iterable<String> keys)
keys
- set of keys to apply lookup for each elementMap
whose keys are the contents of keys
and whose values are computed on demand using lookup function unapply(String)
or empty map if values
is `null`
User can override this method if there is a better way to perform bulk lookuppublic abstract List<String> unapply(String value)
value
- the value to apply the reverse lookup
Null and empty are considered to be the same value = nullToEmpty(value)public Map<String,List<String>> unapplyAll(Iterable<String> values)
values
- Iterable of values for which will perform reverse lookupMap
whose keys are the contents of values
and whose values are computed on demand using the reverse lookup function unapply(String)
or empty map if values
is `null`
User can override this method if there is a better way to perform bulk reverse lookuppublic abstract byte[] getCacheKey()
public boolean isOneToOne()
Copyright © 2011–2017. All rights reserved.