added postId support in subclasses

This commit is contained in:
Louis Vallat 2019-04-23 11:51:56 +02:00
parent 433f677749
commit 51bbc2fee6
5 changed files with 19 additions and 10 deletions

View File

@ -77,15 +77,16 @@ public abstract class RedditPost {
* Main constructor for a Reddit post.
* @param title post's title
* @param quarantine is this post in quarantine?
* @param score
* @param postHint
* @param score post's score
* @param postHint
* @param crosspostable
* @param over18
* @param author
* @param permalink
* @param spoiler
*/
public RedditPost(String title, boolean quarantine, double score, String postHint, boolean crosspostable, boolean over18, String author, String permalink, boolean spoiler) {
public RedditPost(String id, String title, boolean quarantine, double score, String postHint, boolean crosspostable, boolean over18, String author, String permalink, boolean spoiler) {
this.postId = id;
this.title = title;
this.quarantine = quarantine;
this.score = score;

View File

@ -22,4 +22,8 @@ package twitter_techsupportgore_bot.reddit_handler;
*/
public class RedditPostImage extends RedditPost {
public RedditPostImage(String id, String title, boolean quarantine, double score, String postHint, boolean crosspostable, boolean over18, String author, String permalink, boolean spoiler) {
super(id, title, quarantine, score, postHint, crosspostable, over18, author, permalink, spoiler);
}
}

View File

@ -22,8 +22,8 @@ package twitter_techsupportgore_bot.reddit_handler;
*/
public class RedditPostLink extends RedditPost {
public RedditPostLink(String title, boolean quarantine, double score, String postHint, boolean crosspostable, boolean over18, String author, String permalink, boolean spoiler) {
super(title, quarantine, score, postHint, crosspostable, over18, author, permalink, spoiler);
public RedditPostLink(String id, String title, boolean quarantine, double score, String postHint, boolean crosspostable, boolean over18, String author, String permalink, boolean spoiler) {
super(id, title, quarantine, score, postHint, crosspostable, over18, author, permalink, spoiler);
}
}

View File

@ -21,5 +21,9 @@ package twitter_techsupportgore_bot.reddit_handler;
* @author louis
*/
public class RedditPostText extends RedditPost {
public RedditPostText(String id, String title, boolean quarantine, double score, String postHint, boolean crosspostable, boolean over18, String author, String permalink, boolean spoiler) {
super(id, title, quarantine, score, postHint, crosspostable, over18, author, permalink, spoiler);
}
}

View File

@ -22,8 +22,8 @@ package twitter_techsupportgore_bot.reddit_handler;
*/
public class RedditPostVideo extends RedditPost{
public RedditPostVideo(String title, boolean quarantine, double score, String postHint, boolean crosspostable, boolean over18, String author, String permalink, boolean spoiler) {
super(title, quarantine, score, postHint, crosspostable, over18, author, permalink, spoiler);
}
public RedditPostVideo(String id, String title, boolean quarantine, double score, String postHint, boolean crosspostable, boolean over18, String author, String permalink, boolean spoiler) {
super(id, title, quarantine, score, postHint, crosspostable, over18, author, permalink, spoiler);
}
}