-
-
Notifications
You must be signed in to change notification settings - Fork 337
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
Implement @RegisterCollector
#2357
Conversation
Hi @TheRealRyGuy, Thank you for opening a PR with the Jdbi project. This seems a useful addition to our code base. As you pointed out, it would be good to have some tests (and also add some documentation). I will see if I can address this later this week. |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this - I agree, we should have a test case.
|
||
try { | ||
Type type = null; //resultant type | ||
for(Type t : registerCollector.value().getGenericInterfaces()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it could be something along the lines of GenericTypes.findGenericParameter(registerCollector.value(), Collector.class).orElseThrow(...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This calls Class#getGenericSuperclass
instead of Class#getGenericInterfaces
, not applicable as far as I know
Adds an annotation call to
JdbiCollectors#registerCollector(Type, Collector)
, allowing for QoL complex collectors as an alternative to making aCollectorFactory
for use in interface DAOs.This could probably use some tests though