Would this Validation System work?
I have this validation system I wanted to implement for absolutely no reason what so ever other than waste my time but essentially it just validates objects that are going to be created. Say you are creating an class called
Tenant
and this tenant is using the builder pattern. before the Tenant object is created it would validate it which would look something like this: for the cove above its just a simple example of what you can do but it should work with different datatypes (primitive or reference) with their own set of rules.7 Replies
⌛
This post has been reserved for your question.
Hey @verbose! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
here is the validator class
and the validate interface:
Unknown User•7mo ago
Message Not Public
Sign In & Join Server To View
yeah you're right it would be pretty whack now that I look at it, but I can see this being much better actually
this code was references from another repository on github but it had the same construct you are talking about with Rule interface
ill try this thanks!
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.
Post Closed
This post has been closed by <@400463761011507212>.