Store a Sone’s known status in the Sone itself.
[Sone.git] / src / main / java / net / pterodactylus / sone / data / Sone.java
index 63cdbcb..c2f9ae1 100644 (file)
@@ -200,6 +200,9 @@ public class Sone implements Fingerprintable, Comparable<Sone> {
        /** The client used by the Sone. */
        private volatile Client client;
 
+       /** Whether this Sone is known. */
+       private volatile boolean known;
+
        /** All friend Sones. */
        private final Set<String> friendSones = new CopyOnWriteArraySet<String>();
 
@@ -451,6 +454,27 @@ public class Sone implements Fingerprintable, Comparable<Sone> {
        }
 
        /**
+        * Returns whether this Sone is known.
+        *
+        * @return {@code true} if this Sone is known, {@code false} otherwise
+        */
+       public boolean isKnown() {
+               return known;
+       }
+
+       /**
+        * Sets whether this Sone is known.
+        *
+        * @param known
+        *            {@code true} if this Sone is known, {@code false} otherwise
+        * @return This Sone
+        */
+       public Sone setKnown(boolean known) {
+               this.known = known;
+               return this;
+       }
+
+       /**
         * Returns all friend Sones of this Sone.
         *
         * @return The friend Sones of this Sone