title: Using ModelMapper on different data types with same attribute name
body: <p>I have two classes say <code>Animal</code> &amp; <code>AnimalDto</code><br />
  I want to use <code>ModelMapper</code> to convert Entity to DTO and vice verca.<br />
  But the classes are supposed to have different data types for a few attributes having similar name.<br />
  How do I achieve this?</p>
  <p><strong>Animal.java</strong></p>
  <pre><code>public class Animal {    
      int category;    
      String color;    
      int age;
  }    
   
  </code></pre>
  <p><strong>AnimalDto.java</strong></p>
  <pre><code>public class AnimalDto {    
      String category;    
      int color;    
      int age;
  }
  </code></pre>
  <hr />
  <p>currently I'm manually transforming as such:</p>
  <pre><code>class AnimalTransformer {
      private static Category[] categories = Category.values();    
      private static Color[] colors = Color.values();    
  
      animalEntityToDto(Animal animal) {
            AnimalDto animalDto = new AnimalDto();    
            animalDto.setAge(animal.getAge());
            animalDto.setCategory(categories[animal.getCategory()].toString());
            animalDto.setColor(Color.valueOf(animal.getColor()).ordinal());
      }
  
      animalDtoToEntity(AnimalDto animalDto) {
            Animal animal = new Animal();    
            animal.setAge(animalDto.getAge());
            animal.setCategory(Category.valueOf(animalDto.getCategory()).ordinal());
            animal.setColor(colors[animalDto.getColor()].toString());
      }
  }
  </code></pre>