Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
sealed class PhoneNumber
object InvalidPhoneNumber : PhoneNumber()
data class ValidPhoneNumber(val value: String) : PhoneNumber() {
init {
require(value.isNotEmpty()) { "the number cannot be empty" }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment