Class ArticleMapper

java.lang.Object
com.endurancetrio.business.insight.mapper.ArticleMapper

@Component public class ArticleMapper extends Object
  • Constructor Details

    • ArticleMapper

      @Autowired public ArticleMapper(AuthorMapper authorMapper)
  • Method Details

    • map

      public ArticleDTO map(Article entity, Locale locale)
      Maps an Article entity to an ArticleDTO for the given Locale.

      The locale resolution follows a fallback strategy: first try to find ArticleContent matching the requested locale; if none is found, fall back to the first available content; if no content exists, returns null.

      Parameters:
      entity - the Article entity to be mapped
      locale - the requested locale for content resolution
      Returns:
      the corresponding ArticleDTO, or null if the entity is null or no content is available