Package me.a8kj.config.context
Interface ConfigExecutionContext<K>
- Type Parameters:
K- the type of data keys used in the configuration.
- All Known Implementing Classes:
BasicConfigExecutionContext
public interface ConfigExecutionContext<K>
Interface defining the execution context for configuration operations.
Allows developers to implement custom execution logic while maintaining a fluent API.
-
Method Summary
Modifier and TypeMethodDescriptionconfig()Retrieves the underlying configuration file.execute(Function<CRUDOperations<K>, ConfigOperation<K>> task) Executes a specific operation within this context.Retrieves the operations handler (operator) used by this context.
-
Method Details
-
execute
ConfigExecutionContext<K> execute(Function<CRUDOperations<K>, ConfigOperation<K>> task) throws IOExceptionExecutes a specific operation within this context.- Parameters:
task- a function that provides the operation from the available CRUD operations.- Returns:
- the current context for chaining.
- Throws:
IOException- if the execution fails.
-
config
ConfigFile<K> config()Retrieves the underlying configuration file.- Returns:
- the
ConfigFileinstance.
-
operations
CRUDOperations<K> operations()Retrieves the operations handler (operator) used by this context.- Returns:
- the
CRUDOperationsinstance.
-