X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fdata%2FPostReply.java;h=3222d9db6b1aa52effe6cd1c8eab98b49c4780c1;hp=23f310df6163280193f8b1fb5ab902af525fd253;hb=c9e306ac8e3ada846e87a0cc256a20fc148f381c;hpb=54e35873a9660bc51aae7cdb4c1e7d399e50986b diff --git a/src/main/java/net/pterodactylus/sone/data/PostReply.java b/src/main/java/net/pterodactylus/sone/data/PostReply.java index 23f310d..3222d9d 100644 --- a/src/main/java/net/pterodactylus/sone/data/PostReply.java +++ b/src/main/java/net/pterodactylus/sone/data/PostReply.java @@ -27,21 +27,9 @@ import java.util.UUID; */ public class PostReply extends Reply { - /** The ID of the reply. */ - private final UUID id; - - /** The Sone that posted this reply. */ - private volatile Sone sone; - /** The Post this reply refers to. */ private volatile Post post; - /** The time of the reply. */ - private volatile long time; - - /** The text of the reply. */ - private volatile String text; - /** * Creates a new reply. * @@ -97,11 +85,8 @@ public class PostReply extends Reply { * The text of the reply */ public PostReply(String id, Sone sone, Post post, long time, String text) { - this.id = UUID.fromString(id); - this.sone = sone; + super(id, sone, time, text); this.post = post; - this.time = time; - this.text = text; } // @@ -109,34 +94,6 @@ public class PostReply extends Reply { // /** - * {@inheritDoc} - */ - @Override - public String getId() { - return id.toString(); - } - - /** - * {@inheritDoc} - */ - @Override - public Sone getSone() { - return sone; - } - - /** - * Sets the Sone that posted this reply. - * - * @param sone - * The Sone that posted this reply - * @return This reply (for method chaining) - */ - public PostReply setSone(Sone sone) { - this.sone = sone; - return this; - } - - /** * Returns the post this reply refers to. * * @return The post this reply refers to @@ -157,76 +114,4 @@ public class PostReply extends Reply { return this; } - /** - * {@inheritDoc} - */ - @Override - public long getTime() { - return time; - } - - /** - * Sets the time of this reply. - * - * @param time - * The time of this reply (in milliseconds since Jan 1, 1970 UTC) - * @return This reply (for method chaining) - */ - public PostReply setTime(long time) { - this.time = time; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public String getText() { - return text; - } - - /** - * Sets the text of this reply. - * - * @param text - * The text of this reply - * @return This reply (for method chaining) - */ - public PostReply setText(String text) { - this.text = text; - return this; - } - - // - // OBJECT METHODS - // - - /** - * {@inheritDoc} - */ - @Override - public int hashCode() { - return id.hashCode(); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean equals(Object object) { - if (!(object instanceof PostReply)) { - return false; - } - PostReply reply = (PostReply) object; - return reply.id.equals(id); - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return getClass().getName() + "[id=" + id + ",sone=" + sone + ",post=" + post + ",time=" + time + ",text=" + text + "]"; - } - }