Koltin, Sealed Classes In Kotlin, Android.
input, you can streamline validation logic and provide meaningful error messages. sealed class EmailValidation { object Valid : EmailValidation() data class Invalid(val reason: String) : EmailValidation() } fun validateEmail(email: String): EmailValidation { // ... validation logic if