Some javadoc fixes.
[Sone.git] / src / main / java / net / pterodactylus / sone / data / Sone.java
index ac6e41a..30dacd5 100644 (file)
@@ -28,7 +28,6 @@ import java.util.concurrent.CopyOnWriteArraySet;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
-import net.pterodactylus.sone.core.Core;
 import net.pterodactylus.sone.core.Options;
 import net.pterodactylus.sone.freenet.wot.Identity;
 import net.pterodactylus.sone.freenet.wot.OwnIdentity;
@@ -150,7 +149,7 @@ public class Sone implements Fingerprintable, Comparable<Sone> {
                }
        };
 
-       /** Filter that matches all {@link Core#isLocalSone(Sone) local Sones}. */
+       /** Filter that matches all {@link Sone#isLocal() local Sones}. */
        public static final Filter<Sone> LOCAL_SONE_FILTER = new Filter<Sone>() {
 
                @Override
@@ -175,6 +174,9 @@ public class Sone implements Fingerprintable, Comparable<Sone> {
        /** The ID of this Sone. */
        private final String id;
 
+       /** Whether the Sone is local. */
+       private final boolean local;
+
        /** The identity of this Sone. */
        private Identity identity;
 
@@ -229,9 +231,13 @@ public class Sone implements Fingerprintable, Comparable<Sone> {
         *
         * @param id
         *            The ID of the Sone
+        * @param local
+        *            {@code true} if the Sone is a local Sone, {@code false}
+        *            otherwise
         */
-       public Sone(String id) {
+       public Sone(String id, boolean local) {
                this.id = id;
+               this.local = local;
        }
 
        //
@@ -284,6 +290,16 @@ public class Sone implements Fingerprintable, Comparable<Sone> {
        }
 
        /**
+        * Returns whether this Sone is a local Sone.
+        *
+        * @return {@code true} if this Sone is a local Sone, {@code false}
+        *         otherwise
+        */
+       public boolean isLocal() {
+               return local;
+       }
+
+       /**
         * Returns the request URI of this Sone.
         *
         * @return The request URI of this Sone
@@ -791,7 +807,9 @@ public class Sone implements Fingerprintable, Comparable<Sone> {
         */
        public void addAlbum(Album album) {
                Validation.begin().isNotNull("Album", album).check().isEqual("Album Owner", album.getSone(), this).check();
-               albums.add(album);
+               if (!albums.contains(album)) {
+                       albums.add(album);
+               }
        }
 
        /**