Add an async save method to ServerGroup
This commit is contained in:
parent
dff1e16283
commit
ba17babfb8
@ -1,5 +1,6 @@
|
||||
package net.frozenorb.apiv3.model;
|
||||
|
||||
import com.mongodb.async.SingleResultCallback;
|
||||
import com.mongodb.async.client.MongoCollection;
|
||||
import com.mongodb.client.result.DeleteResult;
|
||||
import com.mongodb.client.result.UpdateResult;
|
||||
@ -77,10 +78,8 @@ public final class ServerGroup {
|
||||
callback.get();
|
||||
}
|
||||
|
||||
public void save() {
|
||||
BlockingCallback<UpdateResult> callback = new BlockingCallback<>();
|
||||
public void save(SingleResultCallback<UpdateResult> callback) {
|
||||
serverGroupsCollection.replaceOne(new Document("_id", id), this, callback);
|
||||
callback.get();
|
||||
}
|
||||
|
||||
public void delete() {
|
||||
|
Loading…
Reference in New Issue
Block a user