Open LVMVRQUXL opened 1 year ago
Here is the new code sample to provide in the README documentation while releasing this version:
import kotools.types.number.StrictlyPositiveInt
import kotools.types.number.toStrictlyPositiveInt
import kotools.types.text.NotBlankString
import kotools.types.text.toNotBlankString
data class Person(val name: NotBlankString, val age: StrictlyPositiveInt)
fun main() {
val name: NotBlankString = "Somebody".toNotBlankString()
.getOrThrow()
val age: StrictlyPositiveInt = 42.toStrictlyPositiveInt()
.getOrThrow()
val somebody = Person(name, age)
println(somebody) // Person(name=Somebody, age=42)
}
Here is the new code sample to provide in the README documentation while releasing this version:
import kotools.types.number.StrictlyPositiveInt import kotools.types.number.toStrictlyPositiveInt import kotools.types.text.NotBlankString import kotools.types.text.toNotBlankString data class Person(val name: NotBlankString, val age: StrictlyPositiveInt) fun main() { val name: NotBlankString = "Somebody".toNotBlankString() .getOrThrow() val age: StrictlyPositiveInt = 42.toStrictlyPositiveInt() .getOrThrow() val somebody = Person(name, age) println(somebody) // Person(name=Somebody, age=42) }
Done while releasing the beta version (see #146).
Dependencies
Issues of this new version should be done before resolving this issue.
Checklist