Store client information in Sone.
[Sone.git] / src / main / java / net / pterodactylus / sone / data / Sone.java
index 7fd5fa6..7d4f7ef 100644 (file)
@@ -79,7 +79,10 @@ public class Sone {
        private volatile long time;
 
        /** The profile of this Sone. */
-       private volatile Profile profile;
+       private volatile Profile profile = new Profile();
+
+       /** The client used by the Sone. */
+       private volatile Client client;
 
        /** All friend Sones. */
        private final Set<String> friendSones = Collections.synchronizedSet(new HashSet<String>());
@@ -281,6 +284,27 @@ public class Sone {
        }
 
        /**
+        * Returns the client used by this Sone.
+        *
+        * @return The client used by this Sone, or {@code null}
+        */
+       public Client getClient() {
+               return client;
+       }
+
+       /**
+        * Sets the client used by this Sone.
+        *
+        * @param client
+        *            The client used by this Sone, or {@code null}
+        * @return This Sone (for method chaining)
+        */
+       public Sone setClient(Client client) {
+               this.client = client;
+               return this;
+       }
+
+       /**
         * Returns all friend Sones of this Sone.
         *
         * @return The friend Sones of this Sone