From: David ‘Bombe’ Roden Date: Thu, 14 Oct 2010 04:19:34 +0000 (+0200) Subject: Add profile to Sone. X-Git-Tag: 0.1-RC1~447 X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=commitdiff_plain;h=13540271116aaa7b350d283ce8a8b97fce7e8123 Add profile to Sone. --- 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