src/main/java/org/odessajavaclub/topic/adapter/in/web/TopicDtoMapper.java
public TopicDto toGetTopicDto(Topic topic) {
    long id = topic.getId().map(Topic.TopicId::getValue).orElse(UNDEFINED_ID);
    return new TopicDto(
        id,
        topic.getTitle(),
        new SimpleDateFormat("dd/MM/yyyy k:mm").format(topic.getEvent()),
        topic.getType(),
        topic.getAuthor(),
        topic.getScore(),
        topic.getStatus());
  }
/**
   * Maps {@link Topic} to {@link TopicDto}.
   *
   * @param topic {@link Topic}
   * @return {@link TopicDto}
   */
Maps  Topic to  TopicDto.
@param topic  Topic
@return  TopicDto
Maps Topic to TopicDto . @param topic Topic @return TopicDto
public TopicDto toGetTopicDto(Topic topic) {
    long id = topic.getId().map(Topic.TopicId::getValue).orElse(UNDEFINED_ID);
    return new TopicDto(
        id,
        topic.getTitle(),
        new SimpleDateFormat("dd/MM/yyyy k:mm").format(topic.getEvent()),
        topic.getType(),
        topic.getAuthor(),
        topic.getScore(),
        topic.getStatus());
  }
public TopicDto toGetTopicDto ( Topic topic ) { long id = topic . getId ( ) . map ( Topic . TopicId :: getValue ) . orElse ( UNDEFINED_ID ) ; return new TopicDto ( id , topic . getTitle ( ) , new SimpleDateFormat ( "dd/MM/yyyy k:mm" ) . format ( topic . getEvent ( ) ) , topic . getType ( ) , topic . getAuthor ( ) , topic . getScore ( ) , topic . getStatus ( ) ) ; }
Maps {@link Topic} to {@link TopicDto}.
Maps { @link Topic } to { @link TopicDto } .