optional

fun <V, R : ValidationRule<T>> R.optional(value: (T?) -> V?, rule: R.() -> R): R(source)

Validate rule only if the evaluated result of value is not null.

Return

The original rule on which this method has been invoked.

Parameters

value

The value which, if not null, determines if rule should be valid.

rule

The rule which should hold after date.