2 * Sone - ReplyShell.java - Copyright © 2010 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 shell around a {@link Reply} for replies that have not yet been retrieved
26 * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
28 public class ReplyShell extends Reply implements Shell<Reply> {
30 /** The Sone that posted this reply. */
33 /** The ID of the reply. */
36 /** The Post this reply refers to. */
39 /** The time of the reply. */
42 /** The text of the reply. */
46 * Creates a new reply shell.
49 super(null, null, null);
57 * Returns the Sone that posted this reply.
59 * @return The Sone that posted this reply
62 public Sone getSone() {
67 * Sets the Sone that posted this reply.
70 * The sone that pasted this reply
71 * @return This reply shell (for method chaining)
73 public ReplyShell setSone(Sone sone) {
79 * Returns the ID of the reply.
81 * @return The ID of the reply
84 public String getId() {
89 * Sets the ID of this reply.
92 * The ID of this reply
93 * @return This reply shell (for method chaining)
95 public ReplyShell setId(UUID id) {
101 * Returns the post this reply refers to.
103 * @return The post this reply refers to
106 public Post getPost() {
111 * Sets the post this reply refers to.
114 * The post this reply refers to
115 * @return This reply shell (for method chaining)
117 public ReplyShell setPost(Post post) {
123 * Returns the time of the reply.
125 * @return The time of the reply (in milliseconds since Jan 1, 1970 UTC)
128 public long getTime() {
133 * Sets the time of this reply.
136 * The time of this reply (in milliseconds since Jan 1, 1970 UTC)
137 * @return This reply shell (for method chaining)
139 public ReplyShell setTime(long time) {
145 * Returns the text of the reply.
147 * @return The text of the reply
150 public String getText() {
155 * Sets the text of the reply.
158 * The text of the reply
159 * @return This reply shell (for method chaining)
161 public ReplyShell setText(String text) {
174 public boolean canUnshell() {
175 return (sone != null) && (id != null) && (post != null) && (time != null) && (text != null);
182 public Reply getShelled() {
184 return new Reply(sone, id, post, time, text);