title: Dozer deep mapping Set<ComplexObject> to Set<String>
body: <p>Disclaimer: the same question has already been asked here <a href="https://stackoverflow.com/questions/2196680/mapping-deep-properties-with-intermediate-collections-in-dozer">Mapping deep properties with intermediate collections in dozer</a>, but it has no accepted answer (and no proper answer for my case).<br />
  <br />
  So the question. I have a realm composed by a ComplexObject like the following</p>
  
  <pre><code>public class ComplexObject {
    private Set&lt;AnotherComplexObject&gt; inner;
    ... //other fields, setters and getters
  }
  public Class AnotherComplexObject {
    private String property;
    ... //other fields, setters and getters
  }
  </code></pre>
  
  <p>Now, I am mapping <code>ComplexObject</code> to <code>Target</code>, where Target has a <code>Set&lt;String&gt;</code> property.</p>
  
  <pre><code>public class Target {
    private Set&lt;String&gt; targetString;
    ... //other fields, setters and getters
  }
  </code></pre>
  
  <p>I want to map each ComplexObject inner.property onto one Target targetString. Something that semantically looks like (this does not work of course, property is not a member of Set and Dozer generates a MappingException):</p>
  
  <pre><code>&lt;mapping&gt;
    &lt;class-a&gt;ComplexObject&lt;/class-a&gt;
    &lt;class-b&gt;Target&lt;/class-b&gt;
    &lt;field&gt;
      &lt;a&gt;inner.property&lt;/a&gt;
      &lt;b&gt;targetString&lt;/b&gt;
    &lt;/field&gt;
  &lt;/mapping&gt;
  </code></pre>
  
  <p><br />
  I can accomplish my goal if I modify the <code>toString</code> method of <code>AnotherComplexObject</code> to</p>
  
  <pre><code>public class AnotherComplexObject {
    public String toString(){
      return property;
    }
  }
  </code></pre>
  
  <p>Then, Dozer will detect the source Set is of "type" AnotherComplexObject while the target Set is of String and will use the method toString during the conversion. Unfortunately, this is not quite a solution since I will need a method in my POJO just to let Dozer doing the conversion. 
  <br /><br />
  What does work is to write a custom converter which overrides the convert method to check if source is a Set and then supposes the objects in the set are AnotherComplexObject and doing the conversion from this point on but somehow I feel this is not best nor the more elegant solution. <br />
  Any other idea about how to solve this problem?</p>