2 * Sone - PostReply.java - Copyright © 2010–2012 David Roden
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 package net.pterodactylus.sone.data;
20 import java.util.UUID;
23 * A reply is like a {@link Post} but can never be posted on its own, it always
24 * refers to another {@link Post}.
26 * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
28 public class PostReply extends Reply<PostReply> {
30 /** The Post this reply refers to. */
31 private volatile Post post;
34 * Creates a new reply.
39 public PostReply(String id) {
40 this(id, null, null, 0, null);
44 * Creates a new reply.
47 * The sone that posted the reply
49 * The post to reply to
51 * The text of the reply
53 public PostReply(Sone sone, Post post, String text) {
54 this(sone, post, System.currentTimeMillis(), text);
58 * Creates a new reply-
61 * The sone that posted the reply
63 * The post to reply to
65 * The time of the reply
67 * The text of the reply
69 public PostReply(Sone sone, Post post, long time, String text) {
70 this(UUID.randomUUID().toString(), sone, post, time, text);
74 * Creates a new reply-
77 * The sone that posted the reply
81 * The post to reply to
83 * The time of the reply
85 * The text of the reply
87 public PostReply(String id, Sone sone, Post post, long time, String text) {
88 super(id, sone, time, text);
97 * Returns the post this reply refers to.
99 * @return The post this reply refers to
101 public Post getPost() {
106 * Sets the post this reply refers to.
109 * The post this reply refers to
110 * @return This reply (for method chaining)
112 public PostReply setPost(Post post) {