validateCollection

open override fun validateCollection(message: String, predicate: (Set<T>) -> Boolean): OptionSetBuilder<T>(source)

Adds a validator that checks the entire set against the given predicate.

Parameters

message

Template message for validation errors. Supports:

  • @name: property name

  • @value: the set (properly formatted)

  • @switches: option switches (e.g. "--port|-p")

predicate

Function that returns true if the set is valid