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.
By request of the eclipse-collections authors, I've implemented deserialization support for pairs (and the twin class).
Jackson can already do the serialization to json fine, since pairs are normal beans, but the deserialization fails because the API consists of interfaces. In this PR, I take a shortcut by implementing ValueInstantiators for the tuple classes that use the
PrimitiveTuples.pair
factory methods. For this purpose, I useCreatorProperty
s - I'm not sure if this is the best approach, but it appears to work very well. If there's a better solution, please suggest it.Tested are all pair classes and the twin class, including both the primitive and the object variants. Additionally, there is one test (for
ObjectIntPair
) that tests subtype serialization to confirm that I didn't screw up type deserializers.The patch was developed and tested against 2.9, but since only the POM changed, I don't see any merge issues against 2.10 - is 2.10 the current branch to develop on?