Use a modifier to set the latest edition of a Sone.
[Sone.git] / src / main / java / net / pterodactylus / sone / data / Sone.java
index 96b1287..083b3a5 100644 (file)
@@ -200,38 +200,6 @@ public interface Sone extends Identified, Fingerprintable, Comparable<Sone> {
        boolean isLocal();
 
        /**
-        * Returns the request URI of this Sone.
-        *
-        * @return The request URI of this Sone
-        */
-       FreenetURI getRequestUri();
-
-       /**
-        * Sets the request URI of this Sone.
-        *
-        * @param requestUri
-        *              The request URI of this Sone
-        * @return This Sone (for method chaining)
-        */
-       Sone setRequestUri(FreenetURI requestUri);
-
-       /**
-        * Returns the insert URI of this Sone.
-        *
-        * @return The insert URI of this Sone
-        */
-       FreenetURI getInsertUri();
-
-       /**
-        * Sets the insert URI of this Sone.
-        *
-        * @param insertUri
-        *              The insert URI of this Sone
-        * @return This Sone (for method chaining)
-        */
-       Sone setInsertUri(FreenetURI insertUri);
-
-       /**
         * Returns the latest edition of this Sone.
         *
         * @return The latest edition of this Sone
@@ -239,16 +207,6 @@ public interface Sone extends Identified, Fingerprintable, Comparable<Sone> {
        long getLatestEdition();
 
        /**
-        * Sets the latest edition of this Sone. If the given latest edition is not
-        * greater than the current latest edition, the latest edition of this Sone is
-        * not changed.
-        *
-        * @param latestEdition
-        *              The latest edition of this Sone
-        */
-       void setLatestEdition(long latestEdition);
-
-       /**
         * Return the time of the last inserted update of this Sone.
         *
         * @return The time of the update (in milliseconds since Jan 1, 1970 UTC)
@@ -551,4 +509,13 @@ public interface Sone extends Identified, Fingerprintable, Comparable<Sone> {
 
        PostReplyBuilder newPostReplyBuilder(String postId) throws IllegalStateException;
 
+       Modifier modify();
+
+       interface Modifier {
+
+               Modifier setLatestEdition(long latestEdition);
+               Sone update();
+
+       }
+
 }