Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@Value.Check and @Value.Style(of = "new") could be mostly supported #955

Open
cjhopman opened this issue Apr 12, 2019 · 2 comments
Open

Comments

@cjhopman
Copy link

Most use of @Value.Check doesn't actually do normalization, it just does checking. This should be fairly easy to support even when the constructors are directly exposed.

This might also be an indication that the ad-hoc normalization deserves its own annotation rather than reusing @Value.Check (which is quite non-obvious itself).

@elucash
Copy link
Member

elucash commented Apr 12, 2019

Thank you for creating a request. If I understand correctly, the suggestion is to allow calling precondition checking methods from within constructors (at the end of construction). I guess we can frame it as when we don't do normalization and have a check method we call it at the end of construction for of="new" style.
I understand and somewhat share your thinking around separate annotation/feature for normalization, but it's, probably, not worth it at the moment wrt compatibility and cost-to-benefit ratio

@cjhopman
Copy link
Author

I guess we can frame it as when we don't do normalization and have a check method we call it at the end of construction for of="new" style.

Yeah, that's exactly what I was thinking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants