Interface ConfigOperation<K>

Type Parameters:
K - the type of data keys used in the configuration file.
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ConfigOperation<K>
A functional interface representing a single operation to be performed on a ConfigFile. This follows the Command Pattern, allowing various actions (like CRUD) to be encapsulated and passed around as objects.
Since:
0.1
Author:
a8kj7sea
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    execute(ConfigFile<K> config)
    Executes the specific logic of the operation on the provided configuration file.
    default String
    Returns a human-readable name for the operation, primarily used for logging and debugging.
  • Method Details

    • execute

      void execute(ConfigFile<K> config) throws IOException
      Executes the specific logic of the operation on the provided configuration file.
      Parameters:
      config - the ConfigFile instance to operate on.
      Throws:
      IOException - if an I/O error occurs during the operation execution.
      Since:
      0.1
    • getName

      default String getName()
      Returns a human-readable name for the operation, primarily used for logging and debugging. By default, it returns "AnonymousProcess" for lambdas or anonymous classes, and the simple class name for concrete implementations.
      Returns:
      the string name of the operation.
      Since:
      0.1