- /** Filter to remove Sones that have not been downloaded. */
- public static final Filter<Sone> EMPTY_SONE_FILTER = new Filter<Sone>() {
-
- @Override
- public boolean filterObject(Sone sone) {
- return sone.getTime() != 0;
- }
- };
-
- /** Filter that matches all {@link Core#isLocalSone(Sone) local Sones}. */
- public static final Filter<Sone> LOCAL_SONE_FILTER = new Filter<Sone>() {
-
- @Override
- public boolean filterObject(Sone sone) {
- return sone.getIdentity() instanceof OwnIdentity;
- }
-
- };
-
- /** Filter that matches Sones that have at least one album. */
- public static final Filter<Sone> HAS_ALBUM_FILTER = new Filter<Sone>() {
-
- @Override
- public boolean filterObject(Sone sone) {
- return !sone.getAlbums().isEmpty();
- }
- };
-
- /** The logger. */
- private static final Logger logger = Logging.getLogger(Sone.class);
-
- /** The ID of this Sone. */
- private final String id;
-
- /** The identity of this Sone. */
- private 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 latest edition of the Sone. */
- private volatile long latestEdition;
-
- /** The time of the last inserted update. */
- private volatile long time;
-
- /** The profile of this Sone. */
- private volatile Profile profile = new Profile(this);
-
- /** The client used by the Sone. */
- private volatile Client client;
-
- /** All friend Sones. */
- private final Set<String> friendSones = Collections.synchronizedSet(new HashSet<String>());
-
- /** All posts. */
- private final Set<Post> posts = Collections.synchronizedSet(new HashSet<Post>());
-
- /** All replies. */
- private final Set<PostReply> replies = Collections.synchronizedSet(new HashSet<PostReply>());
-
- /** 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>());
-
- /** The albums of this Sone. */
- private final List<Album> albums = Collections.synchronizedList(new ArrayList<Album>());
-
- /** Sone-specific options. */
- private final Options options = new Options();
-
- /**
- * Creates a new Sone.
- *
- * @param id
- * The ID of the Sone
- */
- public Sone(String id) {
- this.id = id;
- }
-
- //
- // ACCESSORS
- //
-