src/main/java/org/odessajavaclub/topic/adapter/out/persistence/TopicEntityMapper.java
public TopicEntity toTopicJpa(Topic topic) {
    return TopicEntity.builder()
        .id(topic.getId().map(Topic.TopicId::getValue).orElse(null))
        .title(topic.getTitle())
        .event(topic.getEvent())
        .type(topic.getType())
        .author(topic.getAuthor())
        .score(topic.getScore())
        .status(topic.getStatus())
        .build();
  }
/**
   * Maps {@link Topic} to {@link TopicEntity}.
   *
   * @param topic {@link Topic}
   * @return {@link TopicEntity}
   */
Maps  Topic to  TopicEntity.
@param topic  Topic
@return  TopicEntity
Maps Topic to TopicEntity . @param topic Topic @return TopicEntity
public TopicEntity toTopicJpa(Topic topic) {
    return TopicEntity.builder()
        .id(topic.getId().map(Topic.TopicId::getValue).orElse(null))
        .title(topic.getTitle())
        .event(topic.getEvent())
        .type(topic.getType())
        .author(topic.getAuthor())
        .score(topic.getScore())
        .status(topic.getStatus())
        .build();
  }
public TopicEntity toTopicJpa ( Topic topic ) { return TopicEntity . builder ( ) . id ( topic . getId ( ) . map ( Topic . TopicId :: getValue ) . orElse ( null ) ) . title ( topic . getTitle ( ) ) . event ( topic . getEvent ( ) ) . type ( topic . getType ( ) ) . author ( topic . getAuthor ( ) ) . score ( topic . getScore ( ) ) . status ( topic . getStatus ( ) ) . build ( ) ; }
Maps {@link Topic} to {@link TopicEntity}.
Maps { @link Topic } to { @link TopicEntity } .