E - Registered EntryC - Registered Entry Configpublic interface Registry<E,C> extends Iterable<E>
fixme 根据 config 生成 Entry 的功能,以便恢复 Entry.
| Modifier and Type | Method and Description |
|---|---|
void |
addConfiguration(String configName,
C configuration)
Adds a configuration to the registry.
|
boolean |
exist(String name)
Return named entry whether exists in the Registry.
|
Optional<E> |
find(String name)
Find a named entry in the Registry
|
Optional<C> |
getConfiguration(String configName)
Get a configuration by name
|
C |
getDefaultConfig()
Get the default configuration
|
void |
registerListener(RegistryListener<E> listener)
Register entry event such as add, remove or replace
|
Optional<E> |
remove(String name)
Remove an entry from the Registry
|
Optional<E> |
replace(String name,
E newEntry)
Replace an existing entry in the Registry by a new one.
|
forEach, iterator, spliteratorOptional<E> remove(String name)
name - the nameOptional<E> replace(String name, E newEntry)
name - the existing namenewEntry - a new entryboolean exist(String name)
name - the nameOptional<C> getConfiguration(String configName)
configName - the configuration namevoid addConfiguration(String configName, C configuration)
configName - the configuration nameconfiguration - the added configurationC getDefaultConfig()
void registerListener(RegistryListener<E> listener)
listener - the listenerCopyright © 2022. All rights reserved.