Last active
March 8, 2020 19:50
-
-
Save le0nidas/9133aae3e294b00d9b0829dc8973e49a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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