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;
* @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();
}
return client;
}
- public Sone setClient(Client client) {
- this.client = client;
- return this;
- }
-
public boolean isKnown() {
return known;
}
};
}
+ 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
//