mirror of
https://github.com/ChronosX88/JGUN.git
synced 2024-11-21 14:02:19 +00:00
Removed PutBuilder
This commit is contained in:
parent
ae574f15e7
commit
92b734c511
@ -1,7 +1,7 @@
|
|||||||
package io.github.chronosx88.JGUN;
|
package io.github.chronosx88.JGUN;
|
||||||
|
|
||||||
import io.github.chronosx88.JGUN.futures.FutureGet;
|
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 org.json.JSONObject;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -68,7 +68,10 @@ public class PathRef {
|
|||||||
return futureGet;
|
return futureGet;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PutBuilder put(JSONObject data) {
|
public FuturePut put(JSONObject data) {
|
||||||
return new PutBuilder(dispatcher, data, path);
|
FuturePut futurePut = new FuturePut(Dup.random());
|
||||||
|
dispatcher.addPendingFuture(futurePut);
|
||||||
|
dispatcher.sendPutRequest(data);
|
||||||
|
return futurePut;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package io.github.chronosx88.JGUN;
|
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.InMemoryGraph;
|
||||||
import io.github.chronosx88.JGUN.storageBackends.StorageBackend;
|
import io.github.chronosx88.JGUN.storageBackends.StorageBackend;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user