Class DTOMapping<M,T>

java.lang.Object
it.unimib.unimibmodules.controller.DTOMapping<M,T>
Direct Known Subclasses:
CloseEndedAnswerController, DTOListMapping, SurveyController, UserController

public abstract class DTOMapping<M,T> extends Object
Defines the method that will be used by controllers to convert an instance of M (the model) to an instance of T (the DTO) and vice versa.
Version:
0.4.1
Author:
Davide Costantini, Luca Milazzo
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final org.modelmapper.ModelMapper
    The instance of modelMapper that will be used to convert Question to QuestionDTO and vice versa.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    DTOMapping(org.modelmapper.ModelMapper modelMapper)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract T
    convertToDTO(M value)
    Converts an instance of M to an instance of T
    abstract M
    Converts an instance of T to an instance of M

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • modelMapper

      protected final org.modelmapper.ModelMapper modelMapper
      The instance of modelMapper that will be used to convert Question to QuestionDTO and vice versa.
  • Constructor Details

    • DTOMapping

      @Autowired protected DTOMapping(org.modelmapper.ModelMapper modelMapper)
  • Method Details