All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.oasp.module.beanmapping.common.impl.orika.BeanMapperImplOrika Maven / Gradle / Ivy

Go to download

Minimal shim for bean mapping to convert between compatible Java beans (e.g. JPA entity to transfer-object and vice versa).

There is a newer version: 3.0.0
Show newest version
package io.oasp.module.beanmapping.common.impl.orika;

import io.oasp.module.beanmapping.common.base.AbstractBeanMapper;

import javax.inject.Inject;

import ma.glasnost.orika.MapperFacade;

/**
 * This is the implementation of {@link io.oasp.module.beanmapping.common.api.BeanMapper} using orika
 * {@link MapperFacade}.
 *
 */
public class BeanMapperImplOrika extends AbstractBeanMapper {

  private MapperFacade orika;

  /**
   * The constructor.
   */
  public BeanMapperImplOrika() {

    super();
  }

  /**
   * @param orika the orika to set
   */
  @Inject
  public void setOrika(MapperFacade orika) {

    this.orika = orika;
  }

  @Override
  public  T map(Object source, Class targetClass) {

    if (source == null) {
      return null;
    }
    return this.orika.map(source, targetClass);
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy