package api.comments;

import java.util.Date;

/**
 * A cleaner interface for interacting with user comments from the API
 * each comment has the same minimal amount of information the app wants
 * but all structured differently, this cleans it up
 */
public interface SimpleComment {
	/**
	 * Get the author of the post
	 */
	public String getAuthor();

	/**
	 * Get the author's id
	 */
	public int getAuthorId();

	/**
	 * Get the author's avatar url
	 */
	public String getAvatar();

	/**
	 * Get the time the comment was posted
	 */
	public Date getTimePosted();

	/**
	 * Get the editor's name if the post was edited
	 */
	public String getEditor();

	/**
	 * Get the id of the editor if the post was edited
	 */
	public int getEditorId();

	/**
	 * Get the time the post was edited, if it was
	 */
	public Date getTimeEdited();

	/**
	 * Get the body html text of the post
	 */
	public String getBody();

	/**
	 * Set the body html of text of the post
	 * (this is used for the apps emoticon -> emoji step)
	 */
	public void setBody(String s);

	/**
	 * Get the post body as a quote
	 */
	public String getQuote();

	/**
	 * Get the post id
	 */
	public int getPostId();

	/**
	 * True if the author is a donor
	 */
	public boolean isDonor();

	/**
	 * True if the author is warned
	 */
	public boolean isWarned();

	/**
	 * True if the author is banned
	 */
	public boolean isBanned();
}

@@ -16,16 +16,45 @@
 ments;%0A%0A
+import java.util.Comparator;%0A
 import j
@@ -307,16 +307,274 @@
 mment %7B%0A
+%09/**%0A%09 * Comparator to sort the comments by time posted%0A%09 */%0A%09public static class DateComparator implements Comparator%3CSimpleComment%3E %7B%0A%09%09public int compare(SimpleComment a, SimpleComment b)%7B%0A%09%09%09return a.getTimePosted().compareTo(b.getTimePosted());%0A%09%09%7D%0A%09%7D%0A%0A
 %09/**%0A%09 *

Add date comparator for simple comment