We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
stackoverflow: https://stackoverflow.com/questions/51625677/model-mapper-mapping-mapstring-object-to-class-which-extends-another-generic-c
unit test
@Test public class GenericElementMapping2 extends AbstractTest { static class Field { } static class SourceField extends Field { String value; public SourceField(String value) { this.value = value; } } static class DestField extends Field { String value; } static class BaseClass<T extends Field> { List<T> fields; } static class Destination extends BaseClass<DestField> { String name; } public void shouldMap() { List<SourceField> sourceFields = Collections.singletonList(new SourceField("foo")); Map<String, Object> source = new HashMap<String, Object>(); source.put("fields", sourceFields); source.put("name", "bar"); Destination destination = modelMapper.map(source, Destination.class); assertEquals(destination.name, "bar"); assertNotNull(destination.fields); assertEquals(destination.fields.size(), 1); assertEquals(destination.fields.get(0).getClass(), DestField.class); assertEquals(destination.fields.get(0).value, "foo"); } }
The text was updated successfully, but these errors were encountered:
Fixes MapValueReader get wrong field type
1a59c5b
Resolved: #370
Fixes MapValueReader get wrong field type (#371)
fbc99db
I just release v2.1.1, please have a look, thanks.
Sorry, something went wrong.
No branches or pull requests
stackoverflow: https://stackoverflow.com/questions/51625677/model-mapper-mapping-mapstring-object-to-class-which-extends-another-generic-c
unit test
The text was updated successfully, but these errors were encountered: