title: How to have MapStruct not generate wrapper object if property is null?
body: <p>I have some code that uses MapStruct to map a <code>from.id</code> to a <code>to.ref.id</code> structure. When <code>from.id</code> is null, MapStruct will create a new <code>Reference</code> instance and set its <code>id</code> to <code>null</code>. How do I instead make it not generate the wrapper class, and set <code>to.ref</code> to null?</p>
  
  <p>I've tried different values for the mapping's <code>nullValueCheckStrategy</code> and <code>nullValuePropertyMappingStrategy</code>, but those don't seem to make any difference for this case.</p>
  
  <p>This is my code, getters and setters omitted for brevity.</p>
  
  <pre><code>public class Example {
      public static void main(String[] args) {
          System.out.println(Mappers.getMapper(MyMapper.class).get(new From()));
      }
  }
  
  @Mapper
  interface MyMapper {
      @Mapping(source = "id", target = "ref.id")
      To get(From from);
  }
  
  class From {
      private String id;
  }
  
  class To {
      private Reference ref;
  }
  
  class Reference {
      private String id;
  }
  </code></pre>