@Test public void getRenderContent() throws Exception { String content = "pixel `art` is better"; Article speakArticle = Article.createSpeak(zone, zoneAlias, articleId, account, "title 123", content, Instant.now()); assertTrue(speakArticle.hasMarkDownContent()); assertEquals("<p>pixel <code>art</code> is better</p>\n", speakArticle.getRenderContent()); Article linkArticle = Article.createExternalLink(zone, zoneAlias, articleId, account, "title 123", "http: Instant.now()); assertFalse(linkArticle.hasMarkDownContent()); assertEquals("<p>pixel <code>art</code> is better</p>\n", speakArticle.getRenderContent()); assertEquals("", linkArticle.getRenderContent()); }
public String getRenderContent() { switch (contentType) { case NONE: return ""; case MARK_DOWN: return KmarkProcessor.process(content); case MATOME: } throw new UnsupportedOperationException("could not render with type:" + contentType); }
Article { public String getRenderContent() { switch (contentType) { case NONE: return ""; case MARK_DOWN: return KmarkProcessor.process(content); case MATOME: } throw new UnsupportedOperationException("could not render with type:" + contentType); } }
Article { public String getRenderContent() { switch (contentType) { case NONE: return ""; case MARK_DOWN: return KmarkProcessor.process(content); case MATOME: } throw new UnsupportedOperationException("could not render with type:" + contentType); } Article(Zone zone,
      String aliasName,
      FlakeId articleId,
      String title,
      String link,
      String content,
      ArticleContentType contentType,
      Instant createTime,
      UUID authorId,
      String authorName,
      boolean deleted,
      long upVote,
      long downVote,
      long debateCount); }
Article { public String getRenderContent() { switch (contentType) { case NONE: return ""; case MARK_DOWN: return KmarkProcessor.process(content); case MATOME: } throw new UnsupportedOperationException("could not render with type:" + contentType); } Article(Zone zone,
      String aliasName,
      FlakeId articleId,
      String title,
      String link,
      String content,
      ArticleContentType contentType,
      Instant createTime,
      UUID authorId,
      String authorName,
      boolean deleted,
      long upVote,
      long downVote,
      long debateCount); static Article createSpeak(Zone zone,
      String zoneAliasName,
      FlakeId articleId,
      Account author,
      String title,
      String content,
      Instant now); static Article createExternalLink(Zone zone,
      String zoneAliasName,
      FlakeId articleId,
      Account author,
      String title,
      String link,
      Instant now); static String renderSpeakPreview(String content); Zone getZone(); FlakeId getArticleId(); String getTitle(); Instant getCreateTime(); String getContent(); ArticleContentType getContentType(); UUID getAuthorId(); String getAuthorName(); boolean isDeleted(); long getUpVote(); long getDownVote(); long getDebateCount(); String getLink(); String getAliasName(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); String getLinkHint(); V1ArticleDto toV1Dto(); String getRenderContent(); boolean isExternalLink(); boolean hasMarkDownContent(); String getShortUrlPath(); boolean canDelete(Authorization authorization, Instant now); @VisibleForTesting Article withDeleted(); }
Article { public String getRenderContent() { switch (contentType) { case NONE: return ""; case MARK_DOWN: return KmarkProcessor.process(content); case MATOME: } throw new UnsupportedOperationException("could not render with type:" + contentType); } Article(Zone zone,
      String aliasName,
      FlakeId articleId,
      String title,
      String link,
      String content,
      ArticleContentType contentType,
      Instant createTime,
      UUID authorId,
      String authorName,
      boolean deleted,
      long upVote,
      long downVote,
      long debateCount); static Article createSpeak(Zone zone,
      String zoneAliasName,
      FlakeId articleId,
      Account author,
      String title,
      String content,
      Instant now); static Article createExternalLink(Zone zone,
      String zoneAliasName,
      FlakeId articleId,
      Account author,
      String title,
      String link,
      Instant now); static String renderSpeakPreview(String content); Zone getZone(); FlakeId getArticleId(); String getTitle(); Instant getCreateTime(); String getContent(); ArticleContentType getContentType(); UUID getAuthorId(); String getAuthorName(); boolean isDeleted(); long getUpVote(); long getDownVote(); long getDebateCount(); String getLink(); String getAliasName(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); String getLinkHint(); V1ArticleDto toV1Dto(); String getRenderContent(); boolean isExternalLink(); boolean hasMarkDownContent(); String getShortUrlPath(); boolean canDelete(Authorization authorization, Instant now); @VisibleForTesting Article withDeleted(); static final int TITLE_MIN; static final int TITLE_MAX; static final int URL_MAX; static final int CONTENT_MIN; static final int CONTENT_MAX; static final String URL_PATTERN; static final Duration DELETE_LIMIT; }