jhalterman/modelmapper — pull request #51 by JoanZapata (2013-04-26 12:50:57+00:00)
Title: #29 add support for inherited mappings

> This is for information more than a real pull request.
It adds very simple integration of inheritance.

Given classes ```Sub1``` and ```Sub2``` both extending a class ```Sup``` and their DTOs.

```java
mapper.createTypeMap(Sub1.class, Sub1DTO.class);
mapper.createTypeMap(Sub2.class, Sub2DTO.class);
Sup sup = new Sub1();
SupDTO supDto = mapper.map(sup, SupDTO.class)
```

In the given example, ```supDto``` is of type ```Sub1DTO``` at the end. :+1:

It works because ```TypeMap``` is now a valid replacement for ```TypeMap``` if ```B``` extends ```C```.