private volatile Profile profile;
/** All friend Sones. */
- private final Set<Sone> friendSones = Collections.synchronizedSet(new HashSet<Sone>());
+ private final Set<String> friendSones = Collections.synchronizedSet(new HashSet<String>());
/** All posts. */
private final Set<Post> posts = Collections.synchronizedSet(new HashSet<Post>());
*
* @return The friend Sones of this Sone
*/
- public List<Sone> getFriends() {
- List<Sone> friends = new ArrayList<Sone>(friendSones);
- Collections.sort(friends, NICE_NAME_COMPARATOR);
+ public List<String> getFriends() {
+ List<String> friends = new ArrayList<String>(friendSones);
return friends;
}
* The new (and only) friends of this Sone
* @return This Sone (for method chaining)
*/
- public Sone setFriends(Collection<Sone> friends) {
+ public Sone setFriends(Collection<String> friends) {
friendSones.clear();
friendSones.addAll(friends);
return this;
/**
* Returns whether this Sone has the given Sone as a friend Sone.
*
- * @param friendSone
- * The friend Sone to check for
+ * @param friendSoneId
+ * The ID of the Sone to check for
* @return {@code true} if this Sone has the given Sone as a friend,
* {@code false} otherwise
*/
- public boolean hasFriend(Sone friendSone) {
- return friendSones.contains(friendSone);
+ public boolean hasFriend(String friendSoneId) {
+ return friendSones.contains(friendSoneId);
}
/**
* The friend Sone to add
* @return This Sone (for method chaining)
*/
- public Sone addFriend(Sone friendSone) {
- if (!friendSone.equals(this)) {
+ public Sone addFriend(String friendSone) {
+ if (!friendSone.equals(id)) {
friendSones.add(friendSone);
}
return this;
/**
* Removes the given Sone as a friend Sone.
*
- * @param friendSone
- * The friend Sone to remove
+ * @param friendSoneId
+ * The ID of the friend Sone to remove
* @return This Sone (for method chaining)
*/
- public Sone removeFriend(Sone friendSone) {
- friendSones.remove(friendSone);
+ public Sone removeFriend(String friendSoneId) {
+ friendSones.remove(friendSoneId);
return this;
}