X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fdata%2Fimpl%2FDefaultSone.java;h=92d7d5fd735431b094f11eab8d03666754c9dd29;hb=ae80e83bbc5ca193e9065d8b6a6e886a331ea00e;hp=ee3052d264000726c50c68980ce3a342a787ac20;hpb=7948a66da729b30be545d553e7a8234b5957b165;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/data/impl/DefaultSone.java b/src/main/java/net/pterodactylus/sone/data/impl/DefaultSone.java index ee3052d..92d7d5f 100644 --- a/src/main/java/net/pterodactylus/sone/data/impl/DefaultSone.java +++ b/src/main/java/net/pterodactylus/sone/data/impl/DefaultSone.java @@ -88,7 +88,7 @@ public class DefaultSone implements Sone { private volatile Profile profile = new Profile(this); /** The client used by the Sone. */ - private volatile Client client; + private final Client client; /** Whether this Sone is known. */ private volatile boolean known; @@ -122,10 +122,11 @@ public class DefaultSone implements Sone { * @param local * {@code true} if the Sone is a local Sone, {@code false} otherwise */ - public DefaultSone(Database database, String id, boolean local) { + public DefaultSone(Database database, String id, boolean local, Client client) { this.database = database; this.id = id; this.local = local; + this.client = client; rootAlbum = new DefaultAlbumBuilder(database, this, null).build(); } @@ -223,11 +224,6 @@ public class DefaultSone implements Sone { return client; } - public Sone setClient(Client client) { - this.client = client; - return this; - } - public boolean isKnown() { return known; } @@ -398,6 +394,23 @@ public class DefaultSone implements Sone { }; } + public Modifier modify() { + return new Modifier() { + private long latestEdition = DefaultSone.this.latestEdition; + @Override + public Modifier setLatestEdition(long latestEdition) { + this.latestEdition = latestEdition; + return this; + } + + @Override + public Sone update() { + DefaultSone.this.latestEdition = latestEdition; + return DefaultSone.this; + } + }; + } + // // FINGERPRINTABLE METHODS //