From b6d45853fbf967ef1f131484022f07b5f8354af6 Mon Sep 17 00:00:00 2001 From: Colin McDonald Date: Sun, 7 Feb 2016 20:55:20 -0500 Subject: [PATCH] Rename Server#find* methods --- src/main/java/net/frozenorb/apiv3/APIv3.java | 4 ++-- src/main/java/net/frozenorb/apiv3/collections/Server.java | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/frozenorb/apiv3/APIv3.java b/src/main/java/net/frozenorb/apiv3/APIv3.java index 6f6860e..327e4c6 100644 --- a/src/main/java/net/frozenorb/apiv3/APIv3.java +++ b/src/main/java/net/frozenorb/apiv3/APIv3.java @@ -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()); diff --git a/src/main/java/net/frozenorb/apiv3/collections/Server.java b/src/main/java/net/frozenorb/apiv3/collections/Server.java index 57f85dc..91488c5 100644 --- a/src/main/java/net/frozenorb/apiv3/collections/Server.java +++ b/src/main/java/net/frozenorb/apiv3/collections/Server.java @@ -28,15 +28,15 @@ public final class Server implements LiteFullJson { @Getter private double lastTps; @Getter private List players; - public static void findAllServers(Handler>> callback) { + public static void findAll(Handler>> callback) { MongoUtils.findManyAndTransform(COLLECTION_NAME, new JsonObject(), Server::new, callback); } - public static void findServerById(String id, Handler> callback) { + public static void findById(String id, Handler> callback) { MongoUtils.findOneAndTransform(COLLECTION_NAME, new JsonObject().put("_id", id), Server::new, callback); } - public static void findServersByGroup(String groupId, Handler>> callback) { + public static void findByGroup(String groupId, Handler>> callback) { MongoUtils.findManyAndTransform(COLLECTION_NAME, new JsonObject().put("group", groupId), Server::new, callback); }