Last active
September 4, 2020 00:39
-
-
Save AhmedMourad0/93c54a12064978fa8b91f9c464e49e20 to your computer and use it in GitHub Desktop.
Code snippets for the `value-based classes and error-handling` Medium article.
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
val password = Password.of("Some34Really434Hard21Password!").orThrow() //Throw on violation just for demonstration | |
val haha = password.copy(value = "gotcha") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment