package net.pterodactylus.sone.data;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
}
/**
+ * Sets all friends of this Sone at once.
+ *
+ * @param friends
+ * The new (and only) friends of this Sone
+ * @return This Sone (for method chaining)
+ */
+ public synchronized Sone setFriends(Collection<Sone> friends) {
+ friendSones.clear();
+ friendSones.addAll(friends);
+ modificationCounter++;
+ return this;
+ }
+
+ /**
* Returns whether this Sone has the given Sone as a friend Sone.
*
* @param friendSone
}
/**
+ * Sets all posts of this Sone at once.
+ *
+ * @param posts
+ * The new (and only) posts of this Sone
+ * @return This Sone (for method chaining)
+ */
+ public synchronized Sone setPosts(Collection<Post> posts) {
+ this.posts.clear();
+ this.posts.addAll(posts);
+ modificationCounter++;
+ return this;
+ }
+
+ /**
* Adds the given post to this Sone. The post will not be added if its
* {@link Post#getSone() Sone} is not this Sone.
*
}
/**
+ * Sets all replies of this Sone at once.
+ *
+ * @param replies
+ * The new (and only) replies of this Sone
+ * @return This Sone (for method chaining)
+ */
+ public synchronized Sone setReplies(Collection<Reply> replies) {
+ this.replies.clear();
+ this.replies.addAll(replies);
+ modificationCounter++;
+ return this;
+ }
+
+ /**
* Adds a reply to this Sone. If the given reply was not made by this Sone,
* nothing is added to this Sone.
*