Skip to content

Instantly share code, notes, and snippets.

@lucapiccinelli
Last active April 12, 2021 06:18
Show Gist options
  • Select an option

  • Save lucapiccinelli/2a6b6118a4695dc11e544c40daf1ff65 to your computer and use it in GitHub Desktop.

Select an option

Save lucapiccinelli/2a6b6118a4695dc11e544c40daf1ff65 to your computer and use it in GitHub Desktop.
inline class NotEmptyString
@Deprecated(level = DeprecationLevel.ERROR, message = "use companion method 'of'")
constructor(val value: String){
@Suppress("DEPRECATION_ERROR")
companion object{
fun of(value: String): NotEmptyString = validate(NotEmptyString(value)){
validate(NotEmptyString::value).isNotBlank()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment