src/main/java/org/odessajavaclub/topic/adapter/in/web/TopicDtoMapper.java
public Topic toTopic(TopicDto topicDto) {
    Topic topic = new Topic();
    try {
      topic.setEvent(new SimpleDateFormat("dd/MM/yyyy k:mm").parse(topicDto.getEvent()));
    } catch (ParseException e) {
      throw new ValidationException("Can't parse a date, format is: dd/MM/yyyy k:mm");
    }
    topic.setScore(topicDto.getScore());
    topic.setTitle(topicDto.getTitle());
    topic.setId(new Topic.TopicId(topicDto.getId()));
    topic.setStatus(topicDto.getStatus());
    topic.setType(topicDto.getType());
    topic.setAuthor(topicDto.getAuthor());
    return topic;
  }
/**
   * Maps {@link TopicDto} to {@link Topic}.
   *
   * @param topicDto {@link TopicDto}
   * @return {@link Topic}
   */
Maps  TopicDto to  Topic.
@param topicDto  TopicDto
@return  Topic
Maps TopicDto to Topic . @param topicDto TopicDto @return Topic
public Topic toTopic(TopicDto topicDto) {
    Topic topic = new Topic();
    try {
      topic.setEvent(new SimpleDateFormat("dd/MM/yyyy k:mm").parse(topicDto.getEvent()));
    } catch (ParseException e) {
      throw new ValidationException("Can't parse a date, format is: dd/MM/yyyy k:mm");
    }
    topic.setScore(topicDto.getScore());
    topic.setTitle(topicDto.getTitle());
    topic.setId(new Topic.TopicId(topicDto.getId()));
    topic.setStatus(topicDto.getStatus());
    topic.setType(topicDto.getType());
    topic.setAuthor(topicDto.getAuthor());
    return topic;
  }
public Topic toTopic ( TopicDto topicDto ) { Topic topic = new Topic ( ) ; try { topic . setEvent ( new SimpleDateFormat ( "dd/MM/yyyy k:mm" ) . parse ( topicDto . getEvent ( ) ) ) ; } catch ( ParseException e ) { throw new ValidationException ( "Can't parse a date, format is: dd/MM/yyyy k:mm" ) ; } topic . setScore ( topicDto . getScore ( ) ) ; topic . setTitle ( topicDto . getTitle ( ) ) ; topic . setId ( new Topic . TopicId ( topicDto . getId ( ) ) ) ; topic . setStatus ( topicDto . getStatus ( ) ) ; topic . setType ( topicDto . getType ( ) ) ; topic . setAuthor ( topicDto . getAuthor ( ) ) ; return topic ; }
Maps {@link TopicDto} to {@link Topic}.
Maps { @link TopicDto } to { @link Topic } .