ArityOptionBuilder

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

This class is created when calling .arity(n) on an option builder and provides a fluent API for configuring multi-value options that must consume exactly n values. Returns List<T>? (nullable) - use .required() to get non-nullable List<T>.

Parameters

T

The element type of the values in the returned list

Functions

Link copied to clipboard

Marks this arity option as required with a minimum number of occurrences. For arity options, atLeast(n) implies required().

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

Sets a default value for this arity option, making it non-nullable. The default value should be a List with 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): ArityOptionBuilder<T>

Registers a callback to be executed when this arity option receives a value. The callback receives List? - null if the option was not provided, List if it was.

Link copied to clipboard
open operator override fun provideDelegate(thisRef: Arguments, property: KProperty<*>): ReadOnlyProperty<Arguments, List<T>?>
Link copied to clipboard

Marks this arity option as required, making it non-nullable. Returns a NonNullableArityOptionBuilder that preserves arity functionality.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun <U> requireIfValue(ref: KProperty<U>, predicate: (U?) -> Boolean): ArityOptionBuilder<T>
Link copied to clipboard
fun validate(message: String = "Invalid arity group for @name: @value", predicate: (List<T>) -> Boolean): ArityOptionBuilder<T>