You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to support value classes from Kotlin.
It will provide more convenient way to validate data and will be consistent with the domain model.
For example:
@JvmInline
value classPassword(privatevals:String) {
init {
require(s.length >=6) { "Password is too short" }
require(s.contains(Regex("[a-z]"))) { "Password must contain at least one lowercase letter" }
require(s.contains(Regex("[A-Z]"))) { "Password must contain at least one uppercase letter" }
require(s.contains(Regex("[0-9]"))) { "Password must contain at least one digit" }
// etc
}
}
As I can see from the decompiled code, the value class uses the hashCode() and equals() methods of the incapsulated class.
It would be nice to support value classes from Kotlin.
It will provide more convenient way to validate data and will be consistent with the domain model.
For example:
As I can see from the decompiled code, the value class uses the hashCode() and equals() methods of the incapsulated class.
The text was updated successfully, but these errors were encountered: