Class StudentMapper

java.lang.Object
com.markvarga21.studentmanager.mapping.StudentMapper

@Component public class StudentMapper extends Object
A utility class which is used for mapping between the application's student entities and DTOs and backwards.
  • Constructor Details

    • StudentMapper

      public StudentMapper()
  • Method Details

    • mapStudentDtoToEntity

      public Student mapStudentDtoToEntity(StudentDto studentDto)
      Maps a StudentDto to a Student entity.
      Parameters:
      studentDto - The DTO object to be mapped to an entity class.
      Returns:
      The converted Student entity.
    • mapStudentEntityToDto

      public StudentDto mapStudentEntityToDto(Student student)
      Maps an Student entity to an StudentDto.
      Parameters:
      student - The entity object to be mapped to a DTO class.
      Returns:
      The converted StudentDto.
    • mapJsonToDto

      public StudentDto mapJsonToDto(String studentJson)
      Maps a JSON string to a StudentDto.
      Parameters:
      studentJson - the JSON string to be mapped to a DTO class.
      Returns:
      the converted StudentDto.