X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fdata%2Fimpl%2FPostImpl.java;h=43d7d79f29c7253c60c8a1edae178da94250e445;hb=8ee35ad285afaede258cb59a616218a22d4f9646;hp=f45292b543b3d44e86585b3affd2f5848b0bd9a7;hpb=99888ce13cc17d49f5e217ab6f2c9ad5ef168792;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/data/impl/PostImpl.java b/src/main/java/net/pterodactylus/sone/data/impl/PostImpl.java index f45292b..43d7d79 100644 --- a/src/main/java/net/pterodactylus/sone/data/impl/PostImpl.java +++ b/src/main/java/net/pterodactylus/sone/data/impl/PostImpl.java @@ -34,16 +34,16 @@ public class PostImpl implements Post { private final UUID id; /** The Sone this post belongs to. */ - private volatile Sone sone; + private final Sone sone; /** The Sone of the recipient. */ - private volatile Sone recipient; + private final Sone recipient; /** The time of the post (in milliseconds since Jan 1, 1970 UTC). */ - private volatile long time; + private final long time; /** The text of the post. */ - private volatile String text; + private final String text; /** Whether the post is known. */ private volatile boolean known; @@ -53,52 +53,19 @@ public class PostImpl implements Post { * * @param id * The ID of the post - */ - public PostImpl(String id) { - this(id, null, 0, null); - } - - /** - * Creates a new post. - * - * @param sone - * The Sone this post belongs to - * @param text - * The text of the post - */ - public PostImpl(Sone sone, String text) { - this(sone, System.currentTimeMillis(), text); - } - - /** - * Creates a new post. - * * @param sone * The Sone this post belongs to + * @param recipient + * The recipient of the post * @param time * The time of the post (in milliseconds since Jan 1, 1970 UTC) * @param text * The text of the post */ - public PostImpl(Sone sone, long time, String text) { - this(UUID.randomUUID().toString(), sone, time, text); - } - - /** - * Creates a new post. - * - * @param id - * The ID of the post - * @param sone - * The Sone this post belongs to - * @param time - * The time of the post (in milliseconds since Jan 1, 1970 UTC) - * @param text - * The text of the post - */ - public PostImpl(String id, Sone sone, long time, String text) { + public PostImpl(String id, Sone sone, Sone recipient, long time, String text) { this.id = UUID.fromString(id); this.sone = sone; + this.recipient = recipient; this.time = time; this.text = text; } @@ -127,15 +94,6 @@ public class PostImpl implements Post { * {@inheritDoc} */ @Override - public PostImpl setSone(Sone sone) { - this.sone = sone; - return this; - } - - /** - * {@inheritDoc} - */ - @Override public Sone getRecipient() { return recipient; } @@ -144,17 +102,6 @@ public class PostImpl implements Post { * {@inheritDoc} */ @Override - public PostImpl setRecipient(Sone recipient) { - if (!sone.equals(recipient)) { - this.recipient = recipient; - } - return this; - } - - /** - * {@inheritDoc} - */ - @Override public long getTime() { return time; } @@ -163,15 +110,6 @@ public class PostImpl implements Post { * {@inheritDoc} */ @Override - public PostImpl setTime(long time) { - this.time = time; - return this; - } - - /** - * {@inheritDoc} - */ - @Override public String getText() { return text; } @@ -180,15 +118,6 @@ public class PostImpl implements Post { * {@inheritDoc} */ @Override - public PostImpl setText(String text) { - this.text = text; - return this; - } - - /** - * {@inheritDoc} - */ - @Override public boolean isKnown() { return known; }