title: How to map class fields to another class?
body: <p>I'm not looking for the <em>best</em> way to do this, but rather for <em>any</em> way to do what i need while adhering to the DRY principle.</p>
  
  <p>Let's say I have a class <code>Source</code> as follows. <code>Source</code> contains thirty strings.</p>
  
  <pre><code>class Source {
      private String sourceAttrOne = "sourceValueOne";
      private String sourceAttrTwo = "sourceValueTwo";
      ...
      private String sourceAttrThirty = "sourceValueThirty";
  }
  </code></pre>
  
  <p>This information is to be used to create a new object of class <code>Destination</code>. 25 of <code>Destination</code>'s attributes have a name in a similar format (but not the <em>same</em> name). 10 of these are Strings, while 5 are Dates, and 5 are Integers. The last 5 fields, however, are totally different.</p>
  
  <pre><code>class Destination {
      private String AttrOne;
      ...
      private Date AttrSixteen;
      ...
      private Integer AttrTwentyOne;
      ...
      // Last 5 fields are different
      private SomeOtherClass someOtherName;
      private TheBestClass imAlsoSpecial;
  
      // Standard getters and setters
  }
  </code></pre>
  
  <p>For the 25 "normal" attributes, I need to use a helper method to get from the source value to the result. The helper method used depends on the destination type:</p>
  
  <pre><code>destination.setAttrOne(getResultingString(source.getSourceAttrOne()));
  destination.setAttrSixteen(getResultingDate(source.getSourceAttrSixteen());
  destination.setAttrSeventeen(getResultingDate(source.getSourceAttrSeventeen()/*, custom Date format for AttrSeventeen */));
  </code></pre>
  
  <p>The remaining 5 attributes need custom (individual) logic.</p>
  
  <p>Any pointers in the right direction would be much appreciated, I don't need a complete solution :)</p>