Class UserMapper
java.lang.Object
com.fiap.tech_challenge.parte1.ms_users.mappers.UserMapper
Mapper component responsible for converting
User entities
to UsersResponseDTO data transfer objects.-
Constructor Summary
ConstructorsConstructorDescriptionUserMapper(AddressMapper addressMapper) Constructs aUserMapperwith the specifiedAddressMapper. -
Method Summary
Modifier and TypeMethodDescriptiontoResponseDTO(User user) Converts a singleUserentity to aUsersResponseDTO.toResponseDTO(List<User> users) Converts a list ofUserentities to a list ofUsersResponseDTOs.
-
Constructor Details
-
UserMapper
Constructs aUserMapperwith the specifiedAddressMapper.- Parameters:
addressMapper- the address mapper used to convert user addresses
-
-
Method Details
-
toResponseDTO
Converts a singleUserentity to aUsersResponseDTO.- Parameters:
user- theUserentity to convert- Returns:
- the corresponding
UsersResponseDTO
-
toResponseDTO
Converts a list ofUserentities to a list ofUsersResponseDTOs.- Parameters:
users- the list ofUserentities to convert- Returns:
- a list of corresponding
UsersResponseDTOs
-