public class BlogPostResourceIdentifier extends BlogPostsForDateResourceIdentifier implements AttachmentContainerResourceIdentifier, NamedResourceIdentifier
Modifier and Type | Field and Description |
---|---|
static Pattern |
BLOG_POST_LINK_REGEX |
Constructor and Description |
---|
BlogPostResourceIdentifier(String spaceKey,
String title,
Calendar postingDay) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
String |
getResourceName() |
String |
getTitle() |
int |
hashCode() |
static boolean |
isBlogPostLink(String link)
Returns true if the provided link matches the expected blog post pattern.
|
boolean |
isPopulated() |
static BlogPostResourceIdentifier |
newInstanceFromLink(String link,
String defaultSpaceKey)
Returns a new
ResourceIdentifier for a blog post wiki-link in the form "KEY:/2013/03/10/Blog title" or
"/2013/03/10/Blog title". |
String |
toString() |
getPostingDay, getSpace, getSpaceKey
public static final Pattern BLOG_POST_LINK_REGEX
public BlogPostResourceIdentifier(String spaceKey, String title, Calendar postingDay)
spaceKey
- (optional) identifies the Space for the BlogPost. May be null if the space is to be derived from contexttitle
- identifies the title of the BlogPost. May be null if the blog is to be derived from contextpostingDay
- identifies the posting date for the blog. May be null if the blog is to be derived from context.public static boolean isBlogPostLink(String link)
BLOG_POST_LINK_REGEX
public static BlogPostResourceIdentifier newInstanceFromLink(String link, String defaultSpaceKey) throws ParseException
ResourceIdentifier
for a blog post wiki-link in the form "KEY:/2013/03/10/Blog title" or
"/2013/03/10/Blog title". If no space key is in the link, uses the provided defaultSpaceKey.
Clients should call isBlogPostLink(String)
first to check that link is a valid blog-post link.
ParseException
- if the date in the link cannot be parsedIllegalArgumentException
- if the link does not a valid blog post link according to BLOG_POST_LINK_REGEX
public String getTitle()
public String getResourceName()
getResourceName
in interface NamedResourceIdentifier
public boolean isPopulated()
public String toString()
toString
in class BlogPostsForDateResourceIdentifier
public boolean equals(Object o)
equals
in class BlogPostsForDateResourceIdentifier
public int hashCode()
hashCode
in class BlogPostsForDateResourceIdentifier
Copyright © 2003–2016 Atlassian. All rights reserved.