Interface FolderConfigEditor<T>

Type Parameters:
T - the item type
All Known Implementing Classes:
DefaultFolderConfigEditor

public interface FolderConfigEditor<T>
Editor interface for modifying a folder-based configuration.

All operations persist changes to disk and update the in-memory snapshot atomically. Listeners are notified of all changes.

  • Method Details

    • create

      @NotNull @NotNull EditResult<T> create(@NotNull @NotNull String id, @NotNull T value)
      Creates a new item in the folder config.
      Parameters:
      id - the item ID (will be used as filename without extension)
      value - the item value
      Returns:
      the edit result
    • save

      @NotNull @NotNull EditResult<T> save(@NotNull @NotNull String id, @NotNull T value)
      Saves (overwrites) an item in the folder config.

      If the item doesn't exist, it will be created.

      Parameters:
      id - the item ID
      value - the new item value
      Returns:
      the edit result
    • update

      @NotNull @NotNull EditResult<T> update(@NotNull @NotNull String id, @NotNull @NotNull UnaryOperator<T> mutator)
      Updates an existing item in the folder config.

      The mutator receives a copy of the current item and should return the modified version. The original item is not modified.

      Parameters:
      id - the item ID
      mutator - the function to apply to the item copy
      Returns:
      the edit result
    • delete

      @NotNull @NotNull EditResult<Void> delete(@NotNull @NotNull String id)
      Deletes an item from the folder config.
      Parameters:
      id - the item ID
      Returns:
      the edit result (value is null for delete operations)