- * {@inheritDoc}
- */
- @Override
- public synchronized String getFingerprint() {
- StringBuilder fingerprint = new StringBuilder();
- fingerprint.append(profile.getFingerprint());
-
- fingerprint.append("Posts(");
- for (Post post : getPosts()) {
- fingerprint.append("Post(").append(post.getId()).append(')');
- }
- fingerprint.append(")");
-
- List<Reply> replies = new ArrayList<Reply>(getReplies());
- Collections.sort(replies, Reply.TIME_COMPARATOR);
- fingerprint.append("Replies(");
- for (Reply reply : replies) {
- fingerprint.append("Reply(").append(reply.getId()).append(')');
- }
- fingerprint.append(')');
-
- List<String> likedPostIds = new ArrayList<String>(getLikedPostIds());
- Collections.sort(likedPostIds);
- fingerprint.append("LikedPosts(");
- for (String likedPostId : likedPostIds) {
- fingerprint.append("Post(").append(likedPostId).append(')');
- }
- fingerprint.append(')');
-
- List<String> likedReplyIds = new ArrayList<String>(getLikedReplyIds());
- Collections.sort(likedReplyIds);
- fingerprint.append("LikedReplies(");
- for (String likedReplyId : likedReplyIds) {
- fingerprint.append("Reply(").append(likedReplyId).append(')');
- }
- fingerprint.append(')');
-
-// fingerprint.append("Albums(");
-// for (Album album : albums) {
-// fingerprint.append(album.getFingerprint());
-// }
-// fingerprint.append(')');
-
- return fingerprint.toString();
- }
-
- //
- // INTERFACE Comparable<Sone>
- //
-
- /**
- * {@inheritDoc}
- */
- @Override
- public int compareTo(Sone sone) {
- return NICE_NAME_COMPARATOR.compare(this, sone);
- }
-
- //
- // OBJECT METHODS
- //
-
- /**
- * {@inheritDoc}
- */
- @Override
- public int hashCode() {
- return id.hashCode();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean equals(Object object) {
- if (!(object instanceof Sone)) {
- return false;
- }
- return ((Sone) object).id.equals(id);
- }
-
- /**
- * {@inheritDoc}