use of ma.glasnost.orika.MapperFacade in project useful-java-links by Vedenin.
the class OrikaHelloWorld method main.
public static void main(String[] args) {
// init mapper
MapperFactory mapperFactory = new DefaultMapperFactory.Builder().build();
mapperFactory.classMap(Source.class, Destination.class).field("message", "text").register();
MapperFacade mapper = mapperFactory.getMapperFacade();
// convert
Source source = new Source("Hello World!");
Destination destObject = mapper.map(source, Destination.class);
// print Hello World!
destObject.print();
}
use of ma.glasnost.orika.MapperFacade in project orika-spring-boot-starter by akihyro.
the class OrikaAutoConfiguration method orikaMapperFacade.
/**
* Creates a {@link MapperFacade}.
*
* @param orikaMapperFactory the {@link MapperFactory}.
* @return a {@link MapperFacade}.
*/
@ConditionalOnMissingBean
@Bean
public MapperFacade orikaMapperFacade(MapperFactory orikaMapperFactory) {
MapperFacade orikaMapperFacade = orikaMapperFactory.getMapperFacade();
log.debug("Created a MapperFacade: [{}]", orikaMapperFacade);
return orikaMapperFacade;
}
Aggregations