Interface FolderConfigSnapshot<T>

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

public interface FolderConfigSnapshot<T>
Immutable read-only snapshot of a folder-based configuration.

A snapshot represents the state of a folder config at a specific point in time. All operations are lock-free as the underlying data is immutable.

  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    contains(@NotNull String id)
    Checks if an item with the given ID exists.
    @NotNull Collection<T>
    Returns only enabled items if enabled filtering is configured.
    find(@NotNull String id)
    Finds an item by its ID.
    get(@NotNull String id)
    Gets an item by its ID.
    @NotNull String
    Gets the folder config name.
    @NotNull Class<T>
    Gets the item type class.
    @NotNull Set<String>
    ids()
    Returns all item IDs in the folder config.
    boolean
    Returns true if this snapshot contains no items.
    int
    Returns the number of items in this snapshot.
    @NotNull Collection<T>
    Returns all items in the folder config in their configured order.
  • Method Details

    • get

      @NotNull T get(@NotNull @NotNull String id)
      Gets an item by its ID.
      Parameters:
      id - the item ID (filename without extension)
      Returns:
      the item
      Throws:
      IllegalArgumentException - if no item with this ID exists
    • find

      @Nullable T find(@NotNull @NotNull String id)
      Finds an item by its ID.
      Parameters:
      id - the item ID (filename without extension)
      Returns:
      the item, or null if not found
    • values

      @NotNull @NotNull Collection<T> values()
      Returns all items in the folder config in their configured order.
      Returns:
      an unmodifiable collection of all items
    • ids

      @NotNull @NotNull Set<String> ids()
      Returns all item IDs in the folder config.
      Returns:
      an unmodifiable set of all IDs
    • enabled

      @NotNull @NotNull Collection<T> enabled()
      Returns only enabled items if enabled filtering is configured.

      If enabled filtering is not configured (enabledField is empty or the field doesn't exist), this returns the same as values().

      Returns:
      an unmodifiable collection of enabled items
    • contains

      boolean contains(@NotNull @NotNull String id)
      Checks if an item with the given ID exists.
      Parameters:
      id - the item ID to check
      Returns:
      true if an item with this ID exists
    • size

      int size()
      Returns the number of items in this snapshot.
      Returns:
      the item count
    • isEmpty

      boolean isEmpty()
      Returns true if this snapshot contains no items.
      Returns:
      true if empty
    • getItemType

      @NotNull @NotNull Class<T> getItemType()
      Gets the item type class.
      Returns:
      the item class
    • getFolderConfigName

      @NotNull @NotNull String getFolderConfigName()
      Gets the folder config name.
      Returns:
      the folder config name