@Test public void getShortUrlPath() throws Exception { assertEquals("/d/xyz1234", article(zone, FlakeId.fromString("xyz1234"), "foo title").getShortUrlPath()); assertEquals("/d/cuteCate", article(Zone.valueOf("funny"), FlakeId.fromString("cuteCate"), "foo title").getShortUrlPath()); }
public String getShortUrlPath() { return String.format("/d/%s", getArticleId()); }
Article { public String getShortUrlPath() { return String.format("/d/%s", getArticleId()); } }
Article { public String getShortUrlPath() { return String.format("/d/%s", getArticleId()); } 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 getShortUrlPath() { return String.format("/d/%s", getArticleId()); } 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 getShortUrlPath() { return String.format("/d/%s", getArticleId()); } 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; }