Rename Server#find* methods

This commit is contained in:
Colin McDonald 2016-02-07 20:55:20 -05:00
parent 58704fa890
commit b6d45853fb
2 changed files with 5 additions and 5 deletions

View File

@ -30,7 +30,7 @@ public final class APIv3 extends AbstractVerticle {
});
coreHttpRouter.get("/servers").handler(ctx -> {
Server.findAllServers(res -> {
Server.findAll(res -> {
if (res.succeeded()) {
JsonArray response = new JsonArray();
@ -47,7 +47,7 @@ public final class APIv3 extends AbstractVerticle {
});
coreHttpRouter.get("/server/:server").handler(ctx -> {
Server.findServerById(ctx.request().getParam("server"), res -> {
Server.findById(ctx.request().getParam("server"), res -> {
if (res.succeeded()) {
JsonObject json = res.result().toFullJson();
ctx.response().end(json.encode());

View File

@ -28,15 +28,15 @@ public final class Server implements LiteFullJson {
@Getter private double lastTps;
@Getter private List<UUID> players;
public static void findAllServers(Handler<AsyncResult<List<Server>>> callback) {
public static void findAll(Handler<AsyncResult<List<Server>>> callback) {
MongoUtils.findManyAndTransform(COLLECTION_NAME, new JsonObject(), Server::new, callback);
}
public static void findServerById(String id, Handler<AsyncResult<Server>> callback) {
public static void findById(String id, Handler<AsyncResult<Server>> callback) {
MongoUtils.findOneAndTransform(COLLECTION_NAME, new JsonObject().put("_id", id), Server::new, callback);
}
public static void findServersByGroup(String groupId, Handler<AsyncResult<List<Server>>> callback) {
public static void findByGroup(String groupId, Handler<AsyncResult<List<Server>>> callback) {
MongoUtils.findManyAndTransform(COLLECTION_NAME, new JsonObject().put("group", groupId), Server::new, callback);
}