Replies: 1 comment
-
This idea is duplicated by #315. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
🤔 The problem
Today, we provide type converters for creating types (e.g. toNotBlankString).
This approach brings the two following problems:
💡 The idea
The idea is to introduce static builders named
of
in the companion object of each type for creating their instances.Here's an example for the
PositiveInt
type:For improving the documentation discovery and reducing the noise in it, we should define these static builders as member functions instead of extension functions.
Thanks to polymorphism, the return type of these functions could variate depending on their input type. Here's our strategy:
null
.✅ Checklist
Here's the checklist to address for implementing this idea:
of
for all types.of
for all types.🙏 Help needed
Please give this post a reaction if you are interested in this change and comment below your thoughts on it.
We would love to have your feedback!
Beta Was this translation helpful? Give feedback.
All reactions