class User(val name: String)
I know that in constructor will be added this check
Intrinsics.checkParameterIsNotNull(name)
To make sure that name
do not store null.
Is there a way to instrument to not generate such checks? Maybe an annotation?
We need this in Spring, when map json string to a class.
The validation is done by @NotNull
and @Valid
from javax
class User(@field:NotNull @field:Email val name: String)
so, checks are performed immediately after object creation, but since exceptions are thrown from constructor this is not possible.