ListNone
Used to iterate over a delimited list and test whether NONE item meets the test callback.
This is the opposite of {@link ListSome}.
The function will be passed 3 arguments: the value, the index, and the list. You can alternatively pass a Java Predicate which will only receive the 1st arg. The function should return true if the item meets the test, and false otherwise.
Note: This operation is a short-circuit operation, meaning it will stop iterating as soon as it finds the first item that does not meet the test condition.
Parallel Execution
If the parallel
argument is set to true, and no max_threads
are sent, the filter will be executed in parallel using a ForkJoinPool with parallel streams.
If max_threads
is specified, it will create a new ForkJoinPool with the specified number of threads to run the filter in parallel, and destroy it after the operation is complete.
This allows for efficient processing of large lists, especially when the test function is computationally expensive or the list is large.
Method Signature
ListNone(list=[string], callback=[function:Predicate], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean], parallel=[boolean], maxThreads=[integer])
Arguments
list
string
true
string list to test against the callback.
callback
function:Predicate
true
delimiter
string
false
string the list delimiter
,
includeEmptyFields
boolean
false
boolean whether to include empty fields in the returned result
false
multiCharacterDelimiter
boolean
false
boolean whether the delimiter is multi-character
true
parallel
boolean
false
Whether to run the filter in parallel. Defaults to false. If true, the filter will be run in parallel using a ForkJoinPool.
false
maxThreads
integer
false
The maximum number of threads to use when running the filter in parallel. If not passed it will use the default number of threads for the ForkJoinPool. If parallel is false, this argument is ignored.
Examples
Related
Last updated
Was this helpful?