X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fdata%2FSone.java;h=b70dbdbc0bc3e5586d65eafbe6c1e2c628bc1179;hb=50f89617d6c0b65e4ddce2daf65e5be7a075e5ea;hp=8b2367be94fbe01ca919c215199e1f738f83b7a4;hpb=1f6a99de95988a0299faff512ab457ae1172dc46;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/data/Sone.java b/src/main/java/net/pterodactylus/sone/data/Sone.java index 8b2367b..b70dbdb 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,30 @@ 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. A copy of the given profile is stored so + * that subsequent modifications of the given profile are not reflected in + * this Sone! + * + * @param profile + * The profile to set + */ + public synchronized void setProfile(Profile profile) { + this.profile = new Profile(profile); + modificationCounter++; + } + + /** * Returns all friend Sones of this Sone. * * @return The friend Sones of this Sone