-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSimpleComment.java
More file actions
75 lines (62 loc) · 1.38 KB
/
SimpleComment.java
File metadata and controls
75 lines (62 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
package api.comments;
import java.util.Comparator;
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 {
/**
* Comparator to sort the comments by time posted
*/
public static class DateComparator implements Comparator<SimpleComment> {
public int compare(SimpleComment a, SimpleComment b){
return a.getTimePosted().compareTo(b.getTimePosted());
}
}
/**
* 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();
/**
* Get the bb formatted body of the post
*/
public String getBBbody();
/**
* Get the post body as a quote
*/
public String getQuote();
/**
* Get the post id
*/
public int getPostId();
}