-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 #2636: provide overloadings of ObjectReader.readValue() taking Class valueType #2637
Conversation
… Class valueType
Hmmh. I think this is against the design goals of |
@cowtowncoder thanks for your comment. Note that all of the valueOf() methods return |
@cowtowncoder, from my (user not developer) perspective, ObjectReader serves to provide a read-side view of ObjectMapper, specifically one which is based on immutable config (c.f. mutant factory as noted in its JavaDoc). Minimising the read-side API would not seem to be the primary objective of this class. |
Noting that this just missed 2.10.3 (published yesterday), I'd appreciate it if this PR could form part of 2.10.4. |
Acknowledging here that an API addition such as this would target a minor release (2.11.0) and not a point release. |
Ok, I will think about this. Number of overloads that would be necessary for full coverage of input types is rather big. |
I only use the overloading of String argument-type, and added the others for completeness. |
As per my note on issue, I'll accept this patch: thank you for providing it! Just one last process thing: unless I have asked for and received (apologies if so; I tried to check) CLA, I would need that now from: https://github.com/FasterXML/jackson/blob/master/contributor-agreement.pdf (or Corporate CLA, CCLA, if you prefer, in same repo) and usually it's easiest to print, fill, sign & scan, email to Looking forward to merging this! |
(to fix #2636)
This PR provides additional overloadings of ObjectReader.readValue() which take the "Class valueType" argument.
This serves to make a typecast unnecessary when the result of readValue is being passed to an overloaded method.
I also introduced a test, without assertions (!), which shows that the code compiles.