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 boolean |
canIterate()
Returns true if this lookup extractor's
iterable() method will return a valid iterator. |
abstract byte[] |
getCacheKey()
Create a cache key for use in results caching
|
boolean |
isOneToOne() |
abstract Iterable<Map.Entry<String,String>> |
iterable()
Returns an Iterable that iterates over the keys and values in this lookup extractor.
|
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(@Nullable String key)
key - The value to apply the lookup to.public 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(@Nullable String value)
value - the value to apply the reverse lookuppublic 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 boolean canIterate()
iterable() method will return a valid iterator.public abstract Iterable<Map.Entry<String,String>> iterable()
UnsupportedOperationException - if canIterate() returns false.public abstract byte[] getCacheKey()
public boolean isOneToOne()
Copyright © 2011–2020 The Apache Software Foundation. All rights reserved.