public interface UserMapper
Mapper interface for converting back and forth from a DTO to a User entity.
Since:
25.4.24
Version:
1.0
Author:
Yasin M.
  • Field Details

    • INSTANCE

      static final UserMapper INSTANCE
      Implementation instance of the mapper
  • Method Details

    • toDTO

      UserResponse toDTO(User user)
      Maps from User entity to DTO
      Parameters:
      user - User entity
      Returns:
      Mapped DTO
    • updateEntity

      void updateEntity(User user, UserUpdateDTO updateDTO, String encodedPassword)
      Updates User entity from DTO
      Parameters:
      user - User entity
      updateDTO - DTO with new changes
      encodedPassword - Encoded password
    • toStreakResponse

      StreakResponse toStreakResponse(User user, ZonedDateTime firstDue)
      Maps from User to Streak DTO
      Parameters:
      user - User entity
      firstDue - Date where streak is due
      Returns:
      Mapped DTO