From 13540271116aaa7b350d283ce8a8b97fce7e8123 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 14 Oct 2010 06:19:34 +0200 Subject: [PATCH] Add profile to Sone. --- .../java/net/pterodactylus/sone/data/Sone.java | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/main/java/net/pterodactylus/sone/data/Sone.java b/src/main/java/net/pterodactylus/sone/data/Sone.java index 8b2367b..62741e7 100644 --- a/src/main/java/net/pterodactylus/sone/data/Sone.java +++ b/src/main/java/net/pterodactylus/sone/data/Sone.java @@ -47,6 +47,9 @@ public class Sone { /* This will be null for remote Sones! */ private final FreenetURI insertUri; + /** The profile of this Sone. */ + private Profile profile; + /** All friend Sones. */ private final Set friendSones = new HashSet(); @@ -127,6 +130,28 @@ public class Sone { } /** + * Returns a copy of the profile. If you want to update values in the + * profile of this Sone, update the values in the returned {@link Profile} + * and use {@link #setProfile(Profile)} to change the profile in this Sone. + * + * @return A copy of the profile + */ + public Profile getProfile() { + return new Profile(profile); + } + + /** + * Sets the profile of this Sone. + * + * @param profile + * The profile to set + */ + public synchronized void setProfile(Profile profile) { + this.profile = profile; + modificationCounter++; + } + + /** * Returns all friend Sones of this Sone. * * @return The friend Sones of this Sone -- 2.7.4