ArityListOptionBuilder

Builder for arity-based list options that return nullable lists of lists.

This class is created when calling .arity(n) on a list option builder. Each invocation of the option consumes exactly n values to create a sublist. Returns List<List<T>>? (nullable) - use .required() to get non-nullable.

Parameters

T

The element type of the values in the sublists

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Sets a default value for this list arity option, making it non-nullable. The default value should be a List> where each sublist has exactly arityCount elements.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun onValue(callback: (List<T>) -> Unit): ArityListOptionBuilder<T>

Registers a callback to be invoked when this list arity option receives values. The callback receives the complete List>? value.

Link copied to clipboard
open operator override fun provideDelegate(thisRef: Arguments, property: KProperty<*>): ReadOnlyProperty<Arguments, List<List<T>>?>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun <U> requireIfValue(ref: KProperty<U>, predicate: (U?) -> Boolean): ArityListOptionBuilder<T>
Link copied to clipboard
fun validate(message: String = "Invalid arity group for @name: @value", predicate: (List<T>) -> Boolean): ArityListOptionBuilder<T>
Link copied to clipboard
fun validateCollection(message: String = "Invalid collection for @name: @value", predicate: (List<List<T>>?) -> Boolean): ArityListOptionBuilder<T>

Validates the entire collection of arity groups for this list option. The predicate receives the complete List>? value.