Class StudentMapper
java.lang.Object
com.markvarga21.studentmanager.mapping.StudentMapper
A utility class which is used for mapping between
the application's student entities and DTOs and backwards.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionmapJsonToDto
(String studentJson) Maps a JSON string to aStudentDto
.mapStudentDtoToEntity
(StudentDto studentDto) Maps aStudentDto
to aStudent
entity.mapStudentEntityToDto
(Student student) Maps anStudent
entity to anStudentDto
.
-
Constructor Details
-
StudentMapper
public StudentMapper()
-
-
Method Details
-
mapStudentDtoToEntity
Maps aStudentDto
to aStudent
entity.- Parameters:
studentDto
- The DTO object to be mapped to an entity class.- Returns:
- The converted
Student
entity.
-
mapStudentEntityToDto
Maps anStudent
entity to anStudentDto
.- Parameters:
student
- The entity object to be mapped to a DTO class.- Returns:
- The converted
StudentDto
.
-
mapJsonToDto
Maps a JSON string to aStudentDto
.- Parameters:
studentJson
- the JSON string to be mapped to a DTO class.- Returns:
- the converted
StudentDto
.
-