require If Value
fun <U> requireIfValue(ref: KProperty<U>, predicate: (U?) -> Boolean): NonNullableOptionBuilder<T>(source)
Makes this option required if the referenced option's value matches the predicate. This creates a value-based conditional requirement.
Return
This builder for method chaining
Parameters
ref
Property reference to the option whose value triggers this requirement
predicate
Function that returns true if this option should be required