Package com.seeq.utilities.configuration
Interface Configuration
public interface Configuration
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static class
static interface
static interface
-
Method Summary
Modifier and TypeMethodDescriptionstatic Configuration.Option<Boolean>
booleanOption
(String path) <T> T
get
(Configuration.Option<T> option) Retrieve the currently configured value of the provided option.static Map<String,
Configuration.Option<?>> getDoubleSupplier
(Configuration.Option<Number> option) Retrieve a supplier that is always up to date with the latest configured value.getIntSupplier
(Configuration.Option<Number> option) Retrieve a supplier that is always up to date with the latest configured value.getLongSupplier
(Configuration.Option<Number> option) Retrieve a supplier that is always up to date with the latest configured value.<T> Supplier<T>
getValueSupplier
(Configuration.Option<T> option) Retrieve a supplier that is always up to date with the latest configured value.default <T> void
listen
(Configuration.Option<T> option, Consumer<T> listener) <T> void
listen
(Configuration.Option<T> option, Consumer<T> listener, Boolean sendImmediately) Register a consumer to be invoked when the given configuration option changes value.<T> void
listenToAll
(Configuration.Listener<T> listener) Register a callback that will be invoked when any configuration option changes value.static Configuration.Option<Number>
numberOption
(String path) static Configuration.Option<String>
stringOption
(String path) default void
-
Method Details
-
get
Retrieve the currently configured value of the provided option. Note, this operation involves a map lookup and shouldn't be used in performance critical or frequently accessed code paths. In such instances, prefer insteadgetValueSupplier(Option)
or one of the other functions that returns a supplier. -
getValueSupplier
Retrieve a supplier that is always up to date with the latest configured value. Retrieving the value from the returned supplier is quick and can be used in performance critical areas. -
getIntSupplier
Retrieve a supplier that is always up to date with the latest configured value. Retrieving the value from the returned supplier is quick and can be used in performance critical areas. -
getLongSupplier
Retrieve a supplier that is always up to date with the latest configured value. Retrieving the value from the returned supplier is quick and can be used in performance critical areas. -
getDoubleSupplier
Retrieve a supplier that is always up to date with the latest configured value. Retrieving the value from the returned supplier is quick and can be used in performance critical areas. -
listen
Register a consumer to be invoked when the given configuration option changes value. Note that the consumer is held as a strong reference, so do not register a consumer that is expected to fall out of scope. Because of this restriction, use this method only when the other forms of access are insufficient.- Parameters:
option
- The configuration option to listen to for changes.listener
- The callback to run when the option changes.sendImmediately
- If true, the consumer will be immediately invoked with the current value of the configuration option.
-
listen
-
listenToAll
Register a callback that will be invoked when any configuration option changes value. Note that the listener is held as a strong reference, so do not register a listener that is expected to fall out of scope. Because of this restriction, use this method only when the other forms of access are insufficient. Note: The listener will _not_ be immediately invoked with the current value of any configuration options. Rather, the listener will be invoked on any changes going forward. -
stringOption
-
numberOption
-
booleanOption
-
wireThreadPoolSizeToConfiguration
default void wireThreadPoolSizeToConfiguration(Configuration.Option<Number> option, ThreadPoolExecutor pool) -
getAllOptions
-