public class DataLoaderRegistry
extends java.lang.Object
Constructor and Description |
---|
DataLoaderRegistry() |
Modifier and Type | Method and Description |
---|---|
DataLoaderRegistry |
combine(DataLoaderRegistry registry)
This will combine all the current data loaders in this registry and all the data loaders from the specified registry
and return a new combined registry
|
<K,V> DataLoader<K,V> |
computeIfAbsent(java.lang.String key,
java.util.function.Function<java.lang.String,DataLoader<?,?>> mappingFunction)
Computes a data loader if absent or return it if it was
already registered at that key.
|
void |
dispatchAll()
This will called
DataLoader.dispatch() on each of the registered
DataLoader s |
<K,V> DataLoader<K,V> |
getDataLoader(java.lang.String key)
Returns the dataloader that was registered under the specified key
|
java.util.List<DataLoader<?,?>> |
getDataLoaders() |
java.util.Set<java.lang.String> |
getKeys() |
Statistics |
getStatistics() |
DataLoaderRegistry |
register(java.lang.String key,
DataLoader<?,?> dataLoader)
This will register a new dataloader
|
DataLoaderRegistry |
unregister(java.lang.String key)
This will unregister a new dataloader
|
public DataLoaderRegistry register(java.lang.String key, DataLoader<?,?> dataLoader)
key
- the key to put the data loader underdataLoader
- the data loader to registerpublic <K,V> DataLoader<K,V> computeIfAbsent(java.lang.String key, java.util.function.Function<java.lang.String,DataLoader<?,?>> mappingFunction)
K
- the type of keysV
- the type of valueskey
- the key of the data loadermappingFunction
- the function to compute a data loaderpublic DataLoaderRegistry combine(DataLoaderRegistry registry)
registry
- the registry to combine into this registrypublic java.util.List<DataLoader<?,?>> getDataLoaders()
public DataLoaderRegistry unregister(java.lang.String key)
key
- the key of the data loader to unregisterpublic <K,V> DataLoader<K,V> getDataLoader(java.lang.String key)
K
- the type of keysV
- the type of valueskey
- the key of the data loaderpublic java.util.Set<java.lang.String> getKeys()
public void dispatchAll()
DataLoader.dispatch()
on each of the registered
DataLoader
spublic Statistics getStatistics()