question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No getter/setter dozer map failed

See original GitHub issue
 @Test
  public void test_map_no_setter_and_getter_object() {
    Foo f = new Foo();
    f.id = 1;
    f.name = "foo";

    Foo dest = BeanMapper.map(f, Foo.class);
    Assert.assertEquals(f.name, dest.name);
    Assert.assertEquals(f.id, dest.id);
  }

  public static class Foo {
    public int id;
    public String name;
  }

Check result: java.lang.AssertionError: expected:<foo> but was:<null>

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
garethahealycommented, Apr 5, 2017

Solution provided.

0reactions
zhugwcommented, Jan 12, 2016

yeah, got it. I’ll try it . Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error in mapping nested list - Dozer / Discussion / Help
Hi All,. I'm having issue in mapping a list in the nested class having custom getter/setter. The mapping looks like the following. <mapping>...
Read more >
Is there a way to make Dozer map fields without getter or ...
It's a mapper that uses reflection to map same-name fields from one object to another (of a completely unrelated class). I was wondering...
Read more >
5.21.1. Bean Mapping (Dozer) - terasoluna.org
These objects can be mapped by calling getter/setter of Bean and passing the ... Dozer can perform mapping by default without creating mapping...
Read more >
mapstruct/mapstruct-users - Gitter
DozerBeanMapper.map(Object, Class<T>) without declaring a method representing the ... But this gives me an error when mapstruct try to generate the classes:
Read more >
MapStruct — Reliable Predictable Fast Java Bean mapper
We can do this manually or use few different available approaches like Dozer, ModelMapper, Orika, JMapper, MapStruct etc. which aims to simplify this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found