Closed floatdrop closed 3 months ago
For now minItems and maxItems defined on T type and checks T inside. It is more concise to define them like this:
minItems
maxItems
T
@JvmName("minItemsIterable") fun <T, E> ValidationBuilder<out Iterable<T>, E>.minItems( minSize: Int ) = addConstraint( "must have at least {0} items", minSize.toString() ) { it.count() >= minSize } @JvmName("maxItemsIterable") fun <T, E> ValidationBuilder<out Iterable<T>, E>.maxItems( maxSize: Int, ) = addConstraint( "must have at most {0} items", maxSize.toString() ) { it.count() <= maxSize }
I don't immediately see the advantage of this or the impact API. Will reconsider if those are listed
For now
minItems
andmaxItems
defined onT
type and checksT
inside. It is more concise to define them like this: