Provide some conditional helpers #21
Labels
core
The core of the library is involved
DSL
API design and its DSL
enhancement
New feature or request
We could provide some conditional helpers :
ifNotNull
ifInstanceOf
Instead of:
we could write:
prop.ifNotNull { // this: Validatable<SomeClass> constrain { it.someBool } }
We avoid calling
unwrap
, the receiver is automatically defined, and it's no longer nullable.Some helpers unrelated to type casting could be useful too:
ifNotEmpty
(CharSequence
and iterables)ifNotBlank
ifNotNullOrEmpty
ifNotNullOrBlank
The text was updated successfully, but these errors were encountered: