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,7 +77,7 @@ public abstract class RedditPost {
* Main constructor for a Reddit post. * Main constructor for a Reddit post.
* @param title post's title * @param title post's title
* @param quarantine is this post in quarantine? * @param quarantine is this post in quarantine?
* @param score * @param score post's score
* @param postHint * @param postHint
* @param crosspostable * @param crosspostable
* @param over18 * @param over18
@ -85,7 +85,8 @@ public abstract class RedditPost {
* @param permalink * @param permalink
* @param spoiler * @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.title = title;
this.quarantine = quarantine; this.quarantine = quarantine;
this.score = score; this.score = score;

View File

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

View File

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