Class AbstractGenericMapper<E,DO>

java.lang.Object
io.github.astrapi69.model.mapper.AbstractGenericMapper<E,DO>
Type Parameters:
E - the element type
DO - the generic type
All Implemented Interfaces:
io.github.astrapi69.bean.mapper.BeanMapper<E,DO>, io.github.astrapi69.bean.mapper.GenericMapper<E,DO,org.modelmapper.ModelMapper>, GenericModelMapper<E,DO>

public abstract class AbstractGenericMapper<E,DO> extends Object implements GenericModelMapper<E,DO>
The abstract class AbstractGenericMapper provides an base implementation for mapping entities to data transfer objects and back.
  • Constructor Details

  • Method Details

    • newMapper

      public org.modelmapper.ModelMapper newMapper()
      Specified by:
      newMapper in interface io.github.astrapi69.bean.mapper.GenericMapper<E,DO,org.modelmapper.ModelMapper>
    • newModelMapper

      protected org.modelmapper.ModelMapper newModelMapper()
      Factory method for creating the new ModelMapper for the mapping process. This method is invoked in the constructor and can be overridden so users can provide their own mapping process
      Returns:
      the new ModelMapper for the mapping process
    • getDtoClass

      public Class<DO> getDtoClass()
      Specified by:
      getDtoClass in interface io.github.astrapi69.bean.mapper.GenericMapper<E,DO,org.modelmapper.ModelMapper>
    • getEntityClass

      public Class<E> getEntityClass()
      Specified by:
      getEntityClass in interface io.github.astrapi69.bean.mapper.GenericMapper<E,DO,org.modelmapper.ModelMapper>
    • getMapper

      public org.modelmapper.ModelMapper getMapper()
      Specified by:
      getMapper in interface io.github.astrapi69.bean.mapper.GenericMapper<E,DO,org.modelmapper.ModelMapper>