Skip to content

Instantly share code, notes, and snippets.

@AhmedMourad0
Last active September 4, 2020 00:39
Show Gist options
  • Save AhmedMourad0/93c54a12064978fa8b91f9c464e49e20 to your computer and use it in GitHub Desktop.
Save AhmedMourad0/93c54a12064978fa8b91f9c464e49e20 to your computer and use it in GitHub Desktop.
Code snippets for the `value-based classes and error-handling` Medium article.
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