Skip to content

Instantly share code, notes, and snippets.

@hadilq
Created January 10, 2021 22:58
Show Gist options
  • Save hadilq/2c9d27d8624aae6063f2e70b6fb38904 to your computer and use it in GitHub Desktop.
Save hadilq/2c9d27d8624aae6063f2e70b6fb38904 to your computer and use it in GitHub Desktop.
The result of validate method
sealed class ValidationResult
data class ValidationSuccess(val email: Email): ValidationResult()
data class InvalidEmailAddress(val errorMessage: String): ValidationResult()
data class EmptySubject(val errorMessage: String): ValidationResult()
data class EmptyBody(val errorMessage: String): ValidationResult()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment