+ * Returns the ID of the currently selected avatar image.
+ *
+ * @return The ID of the currently selected avatar image, or {@code null} if
+ * no avatar is selected.
+ */
+ public String getAvatar() {
+ return avatar;
+ }
+
+ /**
+ * Sets the avatar image.
+ *
+ * @param avatar
+ * The new avatar image, or {@code null} to not select an avatar
+ * image.
+ * @return This Sone
+ */
+ public Profile setAvatar(Image avatar) {
+ if (avatar == null) {
+ this.avatar = null;
+ return this;
+ }
+ checkArgument(avatar.getSone().equals(sone), "avatar must belong to Sone");
+ this.avatar = avatar.getId();
+ return this;
+ }
+
+ /**