title: Mapping primitive classes (String, Boolean, etc) to each other with Dozer
body: <p>I'm trying to use Dozer to automatically map from primitive classes to each other. At the end, the code might end up looking like this.</p>
  
  <pre><code>Boolean resultBoolean = mapper.map("true", Boolean.class);
  </code></pre>
  
  <p>While Dozer does support mapping <code>String</code> to <code>Boolean</code> when in a bean, it seems mapping directly to <code>Boolean</code> produces the following exception.</p>
  
  <pre><code>org.dozer.MappingException: java.lang.NoSuchMethodException: java.lang.Boolean.&lt;init&gt;()
  at org.dozer.util.MappingUtils.throwMappingException(MappingUtils.java:88)
  at org.dozer.factory.ConstructionStrategies$ByConstructor.newInstance(ConstructionStrategies.java:261)
  at org.dozer.factory.ConstructionStrategies$ByConstructor.create(ConstructionStrategies.java:245)
  at org.dozer.factory.DestBeanCreator.create(DestBeanCreator.java:65)
  at org.dozer.MappingProcessor.map(MappingProcessor.java:178)
  at org.dozer.MappingProcessor.map(MappingProcessor.java:125)
  at org.dozer.MappingProcessor.map(MappingProcessor.java:120)
  at org.dozer.DozerBeanMapper.map(DozerBeanMapper.java:111)
  
  ...
  
  Caused by: java.lang.NoSuchMethodException: java.lang.Boolean.&lt;init&gt;()
  at java.lang.Class.getConstructor0(Class.java:2706)
  at java.lang.Class.getDeclaredConstructor(Class.java:1985)
  at org.dozer.factory.ConstructionStrategies$ByConstructor.newInstance(ConstructionStrategies.java:257)
  ... 32 more
  </code></pre>
  
  <p>It is clear that Dozer is trying to instantiate the Boolean itself. I'm able to create a customer <code>DozerConverter</code> to convert Boolean to String, but I don't want to re-implement the code that Dozer already has. Is there any way to get Dozer to map to and from primitive types directly?</p>