diff --git a/src/main/java/io/github/chronosx88/JGUN/PathRef.java b/src/main/java/io/github/chronosx88/JGUN/PathRef.java index ed21cec..164d372 100644 --- a/src/main/java/io/github/chronosx88/JGUN/PathRef.java +++ b/src/main/java/io/github/chronosx88/JGUN/PathRef.java @@ -1,7 +1,7 @@ package io.github.chronosx88.JGUN; import io.github.chronosx88.JGUN.futures.FutureGet; -import io.github.chronosx88.JGUN.futures.builders.PutBuilder; +import io.github.chronosx88.JGUN.futures.FuturePut; import org.json.JSONObject; import java.util.ArrayList; @@ -68,7 +68,10 @@ public class PathRef { return futureGet; } - public PutBuilder put(JSONObject data) { - return new PutBuilder(dispatcher, data, path); + public FuturePut put(JSONObject data) { + FuturePut futurePut = new FuturePut(Dup.random()); + dispatcher.addPendingFuture(futurePut); + dispatcher.sendPutRequest(data); + return futurePut; } } diff --git a/src/main/java/io/github/chronosx88/JGUN/Utils.java b/src/main/java/io/github/chronosx88/JGUN/Utils.java index 31f4fa3..e2a445a 100644 --- a/src/main/java/io/github/chronosx88/JGUN/Utils.java +++ b/src/main/java/io/github/chronosx88/JGUN/Utils.java @@ -1,6 +1,5 @@ package io.github.chronosx88.JGUN; -import io.github.chronosx88.JGUN.futures.builders.PutBuilder; import io.github.chronosx88.JGUN.storageBackends.InMemoryGraph; import io.github.chronosx88.JGUN.storageBackends.StorageBackend; import org.json.JSONObject; diff --git a/src/main/java/io/github/chronosx88/JGUN/futures/builders/PutBuilder.java b/src/main/java/io/github/chronosx88/JGUN/futures/builders/PutBuilder.java deleted file mode 100644 index d2c465c..0000000 --- a/src/main/java/io/github/chronosx88/JGUN/futures/builders/PutBuilder.java +++ /dev/null @@ -1,43 +0,0 @@ -package io.github.chronosx88.JGUN.futures.builders; - -import io.github.chronosx88.JGUN.Dispatcher; -import io.github.chronosx88.JGUN.Dup; -import io.github.chronosx88.JGUN.futures.FuturePut; -import org.json.JSONObject; - -import java.util.ArrayList; - -public class PutBuilder { - private JSONObject data; - private ArrayList path; - private Dispatcher dispatcher; - - public PutBuilder(Dispatcher dispatcher, JSONObject data, ArrayList path) { - this.dispatcher = dispatcher; - this.data = data; - this.path = path; - } - - public JSONObject getData() { - return data; - } - - public ArrayList getPath() { - return path; - } - - public void setData(JSONObject data) { - this.data = data; - } - - public void setPath(ArrayList path) { - this.path = path; - } - - public FuturePut build() { - FuturePut futurePut = new FuturePut(Dup.random()); - dispatcher.addPendingFuture(futurePut); - dispatcher.sendPutRequest(data); - return futurePut; - } -} \ No newline at end of file