From: David ‘Bombe’ Roden Date: Sat, 16 Oct 2010 00:26:25 +0000 (+0200) Subject: Add methods to create a new Reply. X-Git-Tag: 0.1-RC1~305 X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=commitdiff_plain;h=449d230fce52aa28f24ed485896cab401b936ff1 Add methods to create a new Reply. --- diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 37cbe79..0091265 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -169,6 +169,40 @@ public class Core extends AbstractService { return post; } + /** + * Creates a reply. + * + * @param sone + * The Sone that posts the reply + * @param post + * The post the reply refers to + * @param text + * The text of the reply + * @return The created reply + */ + public Reply createReply(Sone sone, Post post, String text) { + return createReply(sone, post, System.currentTimeMillis(), text); + } + + /** + * Creates a reply. + * + * @param sone + * The Sone that posts the reply + * @param post + * The post the reply refers to + * @param time + * The time of the post + * @param text + * The text of the reply + * @return The created reply + */ + public Reply createReply(Sone sone, Post post, long time, String text) { + Reply reply = getReply(UUID.randomUUID().toString()).setSone(sone).setPost(post).setTime(time).setText(text); + sone.addReply(reply); + return reply; + } + // // ACTIONS //