MapperFacade

O que a interface MapperFacade, faz ?

<dependency>
    <groupId>ma.glasnost.orika</groupId>
    <artifactId>orika-core</artifactId>
    <version>1.5.4</version>
</dependency>

http://javadox.com/ma.glasnost.orika/orika-core/1.3.5/ma/glasnost/orika/MapperFacade.html

public interface MapperFacade

The main runtime interface between a Java application and Orika. This is the central interface abstracting the service of a Java bean mapping.

The main operation of MapperFacade is map() that copy from a deeply structured one object to an other.

MapperFacade manages the state of a mapping operation through MappingContext.
The operation of mapping may include :

  • Creation of new objects : newObject()
  • Conversion object to another type: convert()
  • Mapping recursively an object to an other class : map()

Example of code to map an instance of Entity ( entity ) to DTO class:

… DTO newDTO = mapperFacade.map(entity, DTO.class); …

Author:

S.M. El Aatifi

Pelo que entendi então por exemplo.

Tenho uma entidade EstadoEntity e EstadoDTO, eu converto de um para o outro, mesmo que nela exista objetos diferentes com o mesmo nome ?