-public class Sone {
-
- /** comparator that sorts Sones by their nice name. */
- public static final Comparator<Sone> NICE_NAME_COMPARATOR = new Comparator<Sone>() {
-
- @Override
- public int compare(Sone leftSone, Sone rightSone) {
- int diff = SoneAccessor.getNiceName(leftSone).compareToIgnoreCase(SoneAccessor.getNiceName(rightSone));
- if (diff != 0) {
- return diff;
- }
- return leftSone.getId().compareToIgnoreCase(rightSone.getId());
- }
-
- };
-
- /** The logger. */
- private static final Logger logger = Logging.getLogger(Sone.class);
-
- /** The identity of this Sone. */
- private final Identity identity;
-
- /** The URI under which the Sone is stored in Freenet. */
- private volatile FreenetURI requestUri;
-
- /** The URI used to insert a new version of this Sone. */
- /* This will be null for remote Sones! */
- private volatile FreenetURI insertUri;
-
- /** The time of the last inserted update. */
- private volatile long time;
-
- /** The profile of this Sone. */
- private volatile Profile profile;
-
- /** All friend Sones. */
- private final Set<Sone> friendSones = Collections.synchronizedSet(new HashSet<Sone>());
-
- /** All posts. */
- private final Set<Post> posts = Collections.synchronizedSet(new HashSet<Post>());
-
- /** All replies. */
- private final Set<Reply> replies = Collections.synchronizedSet(new HashSet<Reply>());
-
- /** The IDs of all liked posts. */
- private final Set<String> likedPostIds = Collections.synchronizedSet(new HashSet<String>());
-
- /** The IDs of all liked replies. */
- private final Set<String> likedReplyIds = Collections.synchronizedSet(new HashSet<String>());
-
- /** Modification count. */
- private volatile long modificationCounter = 0;