Removed PutBuilder

This commit is contained in:
ChronosX88 2019-05-08 20:41:49 +04:00
parent ae574f15e7
commit 92b734c511
3 changed files with 6 additions and 47 deletions

View File

@ -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;
}
}

View File

@ -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;

View File

@ -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<String> path;
private Dispatcher dispatcher;
public PutBuilder(Dispatcher dispatcher, JSONObject data, ArrayList<String> path) {
this.dispatcher = dispatcher;
this.data = data;
this.path = path;
}
public JSONObject getData() {
return data;
}
public ArrayList<String> getPath() {
return path;
}
public void setData(JSONObject data) {
this.data = data;
}
public void setPath(ArrayList<String> path) {
this.path = path;
}
public FuturePut build() {
FuturePut futurePut = new FuturePut(Dup.random());
dispatcher.addPendingFuture(futurePut);
dispatcher.sendPutRequest(data);
return futurePut;
}
}