Package org.opennms.core.config.api
Class ConfigReloadContainer.Builder<V>
- java.lang.Object
-
- org.opennms.core.config.api.ConfigReloadContainer.Builder<V>
-
- Enclosing class:
- ConfigReloadContainer<V>
public static class ConfigReloadContainer.Builder<V> extends Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConfigReloadContainer<V>
build()
ConfigReloadContainer.Builder<V>
withFolder(java.util.function.BiConsumer<V,V> folder)
Note: this method assumes the object being managed by this container is mutable and can be used for accumulation.ConfigReloadContainer.Builder<V>
withInitialConfig(V config)
ConfigReloadContainer.Builder<V>
withLastUpdate(Date lastUpdate)
ConfigReloadContainer.Builder<V>
withProvider(ConfigurationProvider provider)
ConfigReloadContainer.Builder<V>
withReloadCheckInterval(Long reloadCheckIntervalInMs)
-
-
-
Method Detail
-
withInitialConfig
public ConfigReloadContainer.Builder<V> withInitialConfig(V config)
-
withLastUpdate
public ConfigReloadContainer.Builder<V> withLastUpdate(Date lastUpdate)
-
withProvider
public ConfigReloadContainer.Builder<V> withProvider(ConfigurationProvider provider)
-
withFolder
public ConfigReloadContainer.Builder<V> withFolder(java.util.function.BiConsumer<V,V> folder)
Note: this method assumes the object being managed by this container is mutable and can be used for accumulation. This simplifies the usage of clients by allowing them to provide a consumer for accumulation purposes rather than a function. Should this container ever need to manage immutable objects an additional method should be provided which accepts aBinaryOperator
rather than aBiConsumer
.- Parameters:
folder
- a consumer which given an accumulator and the next value, folds the next value into the accumulator such that the accumulator now represents the merger of both objects
-
withReloadCheckInterval
public ConfigReloadContainer.Builder<V> withReloadCheckInterval(Long reloadCheckIntervalInMs)
-
build
public ConfigReloadContainer<V> build()
-
-