projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Store friend Sones as strings, not as Sone objects.
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
data
/
Sone.java
diff --git
a/src/main/java/net/pterodactylus/sone/data/Sone.java
b/src/main/java/net/pterodactylus/sone/data/Sone.java
index
2149a68
..
2bb5a3e
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/data/Sone.java
+++ b/
src/main/java/net/pterodactylus/sone/data/Sone.java
@@
-82,7
+82,7
@@
public class Sone {
private volatile Profile profile;
/** All friend Sones. */
private volatile Profile profile;
/** All friend Sones. */
- private final Set<S
one> friendSones = Collections.synchronizedSet(new HashSet<Sone
>());
+ private final Set<S
tring> friendSones = Collections.synchronizedSet(new HashSet<String
>());
/** All posts. */
private final Set<Post> posts = Collections.synchronizedSet(new HashSet<Post>());
/** All posts. */
private final Set<Post> posts = Collections.synchronizedSet(new HashSet<Post>());
@@
-289,9
+289,8
@@
public class Sone {
*
* @return The friend Sones of this Sone
*/
*
* @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;
}
return friends;
}
@@
-302,7
+301,7
@@
public class Sone {
* The new (and only) friends of this Sone
* @return This Sone (for method chaining)
*/
* The new (and only) friends of this Sone
* @return This Sone (for method chaining)
*/
- public Sone setFriends(Collection<S
one
> friends) {
+ public Sone setFriends(Collection<S
tring
> friends) {
friendSones.clear();
friendSones.addAll(friends);
return this;
friendSones.clear();
friendSones.addAll(friends);
return this;
@@
-327,8
+326,8
@@
public class Sone {
* The friend Sone to add
* @return This Sone (for method chaining)
*/
* The friend Sone to add
* @return This Sone (for method chaining)
*/
- public Sone addFriend(S
one
friendSone) {
- if (!friendSone.equals(
this
)) {
+ public Sone addFriend(S
tring
friendSone) {
+ if (!friendSone.equals(
id
)) {
friendSones.add(friendSone);
}
return this;
friendSones.add(friendSone);
}
return this;