class FrontendLogMapper implements DataMapper<FrontendLog, FrontendLogDto> {

  @Override
  public FrontendLog mapDtoToEntity(FrontendLogDto frontendLogDto) {
    FrontendLog frontendLog = new FrontendLog();
    frontendLog.setId(frontendLogDto.getId());
    frontendLog.setLevel(FrontendLogLevel.getLevelByIdentifier(frontendLogDto.getLevel()).name());
    frontendLog.setTimestamp(
        LocalDateTime.parse(
            formatStringToValidIsoWithoutMilliseconds(frontendLogDto.getTimestamp()),
            dateTimeFormatter));
    frontendLog.setFileName(frontendLogDto.getFileName());
    frontendLog.setLineNumber(frontendLogDto.getLineNumber());
    frontendLog.setMessage(frontendLogDto.getMessage());

    return frontendLog;
  }

}