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 TypeMethodDescriptionbooleanChecks if an item with the given ID exists.@NotNull Collection<T>enabled()Returns only enabled items if enabled filtering is configured.Finds an item by its ID.Gets an item by its ID.@NotNull StringGets the folder config name.Gets the item type class.ids()Returns all item IDs in the folder config.booleanisEmpty()Returns true if this snapshot contains no items.intsize()Returns the number of items in this snapshot.@NotNull Collection<T>values()Returns all items in the folder config in their configured order.
-
Method Details
-
get
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
Finds an item by its ID.- Parameters:
id- the item ID (filename without extension)- Returns:
- the item, or null if not found
-
values
Returns all items in the folder config in their configured order.- Returns:
- an unmodifiable collection of all items
-
ids
Returns all item IDs in the folder config.- Returns:
- an unmodifiable set of all IDs
-
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
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
Gets the item type class.- Returns:
- the item class
-
getFolderConfigName
Gets the folder config name.- Returns:
- the folder config name
-