public final class

Post

extends Object
implements Serializable Comparable<Post>
java.lang.Object
   ↳ chan.content.model.Post

Class Overview

Model containing post data.

You can describe thread number and post number with the following methods:

Summary

Public Constructors
Post()
Public Methods
int compareTo(Post another)
Attachment getAttachmentAt(int index)

Returns attachment at given index.

int getAttachmentsCount()

Returns attachments count.

String getCapcode()

Returns poster capcode.

String getComment()

Returns post comment.

String getCommentMarkup()

Returns post original comment markup.

String getEmail()

Returns poster email.

Icon getIconAt(int index)

Returns icon at given index.

int getIconsCount()

Returns icons count.

String getIdentifier()

Returns poster identifier.

String getName()

Returns poster name.

String getParentPostNumber()

Returns parent post number.

String getPostNumber()

Returns post number.

String getSubject()

Returns post subject.

String getThreadNumber()

Returns real thread number with this post.

long getTimestamp()

Returns date of post created.

String getTripcode()

Returns poster tripcode.

boolean isArchived()

Returns whether thread is archived.

boolean isBumpLimitReached()

Returns whether bump limit reached.

boolean isClosed()

Returns whether thread is closed.

boolean isCyclical()

Returns whether thread is cyclical.

boolean isDefaultName()

Returns whether poster name is default.

boolean isOriginalPoster()

Returns whether post was written by original poster.

boolean isPosterBanned()

Returns whether poster was banned by moderator.

boolean isPosterWarned()

Returns whether poster was warned by moderator.

boolean isSage()

Returns whether post contains sage mark.

boolean isSticky()

Returns whether thread is sticky.

Post setArchived(boolean archived)

Stores whether thread is archived.

Post setAttachments(Attachment... attachments)

Stores attachments in this model.

Post setAttachments(Collection<? extends Attachment> attachments)

Stores attachments in this model.

Post setBumpLimitReached(boolean bumpLimitReached)

Stores whether thread reached a bump limit.

Post setCapcode(String capcode)

Stores poster capcode in this model.

Post setClosed(boolean closed)

Stores whether thread is closed.

Post setComment(String comment)

Stores post comment in this model.

Post setCommentMarkup(String commentMarkup)

Stores post original comment markup in this model.

Post setCyclical(boolean cyclical)

Stores whether thread is cyclical.

Post setDefaultName(boolean defaultName)

Stores whether poster name is default.

Post setEmail(String email)

Stores poster email in this model.

Post setIcons(Collection<? extends Icon> icons)

Stores icons in this model.

Post setIcons(Icon... icons)

Stores icons in this model.

Post setIdentifier(String identifier)

Stores poster identifier (an unique poster number or name within the thread) in this model.

Post setName(String name)

Stores poster name in this model.

Post setOriginalPoster(boolean originalPoster)

Stores whether post was written by original poster.

Post setParentPostNumber(String parentPostNumber)

Stores parent post number for this post.

Post setPostNumber(String postNumber)

Stores post number for this post.

Post setPosterBanned(boolean posterBanned)

Stores whether poster was banned by moderator.

Post setPosterWarned(boolean posterWarned)

Stores whether poster was warned by moderator.

Post setSage(boolean sage)

Stores whether post contains sage mark (in email or another field) and doesn't bump a thread.

Post setSticky(boolean sticky)

Stores whether thread is sticky.

Post setSubject(String subject)

Stores post subject in this model.

Post setThreadNumber(String threadNumber)

Stores thread number in this model.

Post setTimestamp(long timestamp)

Stores date of post created in this model.

Post setTripcode(String tripcode)

Stores poster tripcode in this model.

[Expand]
Inherited Methods
From class java.lang.Object
From interface java.lang.Comparable

Public Constructors

public Post ()

Public Methods

public int compareTo (Post another)

Parameters
another Post
Returns
int

public Attachment getAttachmentAt (int index)

Returns attachment at given index.

Parameters
index int
Returns
Attachment

public int getAttachmentsCount ()

Returns attachments count.

Returns
int

public String getCapcode ()

Returns poster capcode.

Returns
String

public String getComment ()

Returns post comment.

Returns
String

public String getCommentMarkup ()

Returns post original comment markup.

This method calls when application want to get original comment markup. By default ChanMarkup provides unmark operation, but you can override this method and provide more correct operation if it possible.

Returns
String

public String getEmail ()

Returns poster email.

Returns
String

public Icon getIconAt (int index)

Returns icon at given index.

Parameters
index int
Returns
Icon

public int getIconsCount ()

Returns icons count.

Returns
int

public String getIdentifier ()

Returns poster identifier.

Returns
String

public String getName ()

Returns poster name.

Returns
String

public String getParentPostNumber ()

Returns parent post number.

Returns
String

public String getPostNumber ()

Returns post number.

Returns
String

public String getSubject ()

Returns post subject.

Returns
String

public String getThreadNumber ()

Returns real thread number with this post.

Returns
String

public long getTimestamp ()

Returns date of post created.

Returns
long

public String getTripcode ()

Returns poster tripcode.

Returns
String

public boolean isArchived ()

Returns whether thread is archived.

Returns
boolean

public boolean isBumpLimitReached ()

Returns whether bump limit reached.

Returns
boolean

public boolean isClosed ()

Returns whether thread is closed.

Returns
boolean

public boolean isCyclical ()

Returns whether thread is cyclical.

Returns
boolean

public boolean isDefaultName ()

Returns whether poster name is default.

Returns
boolean

public boolean isOriginalPoster ()

Returns whether post was written by original poster.

Returns
boolean

public boolean isPosterBanned ()

Returns whether poster was banned by moderator.

Returns
boolean

public boolean isPosterWarned ()

Returns whether poster was warned by moderator.

Returns
boolean

public boolean isSage ()

Returns whether post contains sage mark.

Returns
boolean

public boolean isSticky ()

Returns whether thread is sticky.

Returns
boolean

public Post setArchived (boolean archived)

Stores whether thread is archived. Will be ignored by application if post is not original.

Parameters
archived boolean: True if thread is archived, false otherwise.
Returns
Post This model.

public Post setAttachments (Attachment... attachments)

Stores attachments in this model.

Parameters
attachments Attachment: Array of Attachment.
Returns
Post This model.

public Post setAttachments (Collection<? extends Attachment> attachments)

Stores attachments in this model.

Parameters
attachments Collection: Collection of Attachment.
Returns
Post This model.

public Post setBumpLimitReached (boolean bumpLimitReached)

Stores whether thread reached a bump limit. In this case user will see an icon.

Parameters
bumpLimitReached boolean: True if bump limit reached, false otherwise.
Returns
Post This model.

public Post setCapcode (String capcode)

Stores poster capcode in this model. Capcode must not contain # characters.

Parameters
capcode String: Poster capcode.
Returns
Post This model.

public Post setClosed (boolean closed)

Stores whether thread is closed. Will be ignored by application if post is not original.

Parameters
closed boolean: True if thread is closed, false otherwise.
Returns
Post This model.

public Post setComment (String comment)

Stores post comment in this model.

Parameters
comment String: Post comment.
Returns
Post This model.

public Post setCommentMarkup (String commentMarkup)

Stores post original comment markup in this model.

By default ChanMarkup provides unmark operation. Some chans stores original markup along with parsed comment, so you can simplify and precisify unmark operation with this method.

Parameters
commentMarkup String: Post comment markup.
Returns
Post This model.

public Post setCyclical (boolean cyclical)

Stores whether thread is cyclical. Will be ignored by application if post is not original.

Parameters
cyclical boolean: True if thread is cyclical, false otherwise.
Returns
Post This model.

public Post setDefaultName (boolean defaultName)

Stores whether poster name is default. In this case it may be hidden in posts list.

Parameters
defaultName boolean: True if poster name is default, false otherwise.
Returns
Post This model.

public Post setEmail (String email)

Stores poster email in this model. You must handle "sage" mails by yourself using setSage(boolean) method.

Parameters
email String: Poster email.
Returns
Post This model.

public Post setIcons (Collection<? extends Icon> icons)

Stores icons in this model.

Parameters
icons Collection: Collection of Icon.
Returns
Post This model.

public Post setIcons (Icon... icons)

Stores icons in this model.

Parameters
icons Icon: Array of Icon.
Returns
Post This model.

public Post setIdentifier (String identifier)

Stores poster identifier (an unique poster number or name within the thread) in this model.

Parameters
identifier String: Poster identifier.
Returns
Post This model.

public Post setName (String name)

Stores poster name in this model.

Parameters
name String: Poster name.
Returns
Post This model.

public Post setOriginalPoster (boolean originalPoster)

Stores whether post was written by original poster.

Parameters
originalPoster boolean: True if post was written by original poster, false otherwise.
Returns
Post This model.

public Post setParentPostNumber (String parentPostNumber)

Stores parent post number for this post. In chan context parent post number must be equal original post number which means all posts are replies to original one. The parent post number stored for original post must be null.

Parameters
parentPostNumber String: Parent post number.
Returns
Post This model.

public Post setPostNumber (String postNumber)

Stores post number for this post.

Parameters
postNumber String: Post number.
Returns
Post This model.

public Post setPosterBanned (boolean posterBanned)

Stores whether poster was banned by moderator.

Parameters
posterBanned boolean: True if poster was banned, false otherwise.
Returns
Post This model.

public Post setPosterWarned (boolean posterWarned)

Stores whether poster was warned by moderator.

Parameters
posterWarned boolean: True if poster was warned, false otherwise.
Returns
Post This model.

public Post setSage (boolean sage)

Stores whether post contains sage mark (in email or another field) and doesn't bump a thread.

Parameters
sage boolean: True if post contains sage mark, false otherwise.
Returns
Post This model.

public Post setSticky (boolean sticky)

Stores whether thread is sticky. Will be ignored by application if post is not original.

Parameters
sticky boolean: True if thread is sticky, false otherwise.
Returns
Post This model.

public Post setSubject (String subject)

Stores post subject in this model.

Parameters
subject String: Post subject.
Returns
Post This model.

public Post setThreadNumber (String threadNumber)

Stores thread number in this model. Usually thread number equals original post number, so in most cases you shouldn't use this method.

Parameters
threadNumber String: Thread number.
Returns
Post This model.

public Post setTimestamp (long timestamp)

Stores date of post created in this model.

Parameters
timestamp long: UNIX timestamp.
Returns
Post This model.

public Post setTripcode (String tripcode)

Stores poster tripcode in this model. Tripcode must include ! characters.

Parameters
tripcode String: Poster tripcode.
Returns
Post This model.