Class IncludedItems
Helper class to manage inclusion and exclusion of items by ID. Can work in two modes: inclusion mode (whitelist) or exclusion mode (blacklist).
Inherited Members
Namespace:
Assembly: .dll
Syntax
public class IncludedItems
Constructors
IncludedItems()
Declaration
public IncludedItems()
Methods
<T>getIncludedItems(List<T> allItems)
Returns included items by filtering the provided list
Declaration
public List<T> <T>getIncludedItems(List<T> allItems)
Parameters
| Type | Name | Description |
|---|---|---|
| List<T> | allItems | The complete list of items |
Returns
| Type | Description |
|---|---|
| List<T> | A filtered list of included items |
<T>reconcile(List<T> allItems)
Reconciles the items set with the all items array by removing items that are no longer present
Declaration
public void <T>reconcile(List<T> allItems)
Parameters
| Type | Name | Description |
|---|---|---|
| List<T> | allItems | The array of all items |
exclude(String itemId)
Excludes one item. Returns true if the included items list has changed after the operation.
Declaration
public boolean exclude(String itemId)
Parameters
| Type | Name | Description |
|---|---|---|
| String | itemId | The ID of the item to exclude |
Returns
| Type | Description |
|---|---|
| boolean | True if the list was modified |
excludeAll()
Clears and switches to inclusion set (excludes all items by default)
Declaration
public void excludeAll()
excludeList(List<String> itemIds)
Excludes the list of items. Returns true if the included items list has changed after the operation.
Declaration
public boolean excludeList(List<String> itemIds)
Parameters
| Type | Name | Description |
|---|---|---|
| List<String> | itemIds | The list of item IDs to exclude |
Returns
| Type | Description |
|---|---|
| boolean | True if the list was modified |
getExcludedItemIds()
Returns excluded item IDs. Useful for serialization.
Declaration
public List<String> getExcludedItemIds()
Returns
| Type | Description |
|---|---|
| List<String> | List of excluded item IDs |
getIncludedItemIds()
Returns included item IDs. Useful for serialization.
Declaration
public List<String> getIncludedItemIds()
Returns
| Type | Description |
|---|---|
| List<String> | List of included item IDs |
getItemIdsSetSize()
Returns the size of the item IDs set. Mostly for testing.
Declaration
public int getItemIdsSetSize()
Returns
| Type | Description |
|---|---|
| int | The size of the internal set |
include(String itemId)
Includes one item. Returns true if the included items list has changed after the operation.
Declaration
public boolean include(String itemId)
Parameters
| Type | Name | Description |
|---|---|---|
| String | itemId | The ID of the item to include |
Returns
| Type | Description |
|---|---|
| boolean | True if the list was modified |
includeAll()
Clears and switches to exclusion set (includes all items by default)
Declaration
public void includeAll()
includeList(List<String> itemIds)
Includes the list of items. Returns true if the included items list has changed after the operation.
Declaration
public boolean includeList(List<String> itemIds)
Parameters
| Type | Name | Description |
|---|---|---|
| List<String> | itemIds | The list of item IDs to include |
Returns
| Type | Description |
|---|---|
| boolean | True if the list was modified |
removeId(String id)
Removes an ID. Used when you need to remove an item, for example when removing an axis.
Declaration
public void removeId(String id)
Parameters
| Type | Name | Description |
|---|---|---|
| String | id | The ID to remove |
testIsIncluded(String itemId)
Tests if the item is included
Declaration
public boolean testIsIncluded(String itemId)
Parameters
| Type | Name | Description |
|---|---|---|
| String | itemId | The ID of the item to test |
Returns
| Type | Description |
|---|---|
| boolean | True if the item is included |