Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introduce
Converter
injunit-platform-commons
#4219New 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
base: main
Are you sure you want to change the base?
Introduce
Converter
injunit-platform-commons
#4219Changes from all commits
d3675e2
61494f9
b70f763
6001a2c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I wonder if the deprecated
convert
should delegate to the otherconvert
method or should invokeDefaultConverter
directly, skipping the new service loader logic. For now, I went with the former.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.
Didn't we decide to make this
generic
as inConverter<S, T>
?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.
I guess for that to make sense, we'd have to parameterize
TypeDescriptor
as well.@scordio @sbrannen WDYT?
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.
I had the same in mind but wasn't entirely confident about this direction yesterday, especially before refactoring
StringToObjectConversion
.But now the refactoring is done so I can sketch it and see what happens 🙂
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.
Initially, this was:
However, I couldn't see the benefit of the
ClassLoader
parameter here, so I deleted it. Let me know if you see some use cases that could benefit from it.Plus, I'm not entirely sure if this should rather be:
The way
Converter
is currently integrated intoConversionSupport
makes it easy to provide the source instance, but I wonder if this will be flexible enough with a bit of foresight.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.
I think we should pass an additional
TypeDescriptor sourceType
to bothcanConvert
andconvert
.