From bb71dd674fe811d4b9d9d73b8b9a11b36c5095f3 Mon Sep 17 00:00:00 2001 From: Tux Date: Wed, 28 May 2014 02:06:17 -0400 Subject: [PATCH] Correctly mark the UUID/name methods as NonNull --- .../imaginarycode/minecraft/redisbungee/RedisBungeeAPI.java | 4 ++-- .../minecraft/redisbungee/util/UUIDTranslator.java | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungeeAPI.java b/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungeeAPI.java index b02b31b..ec29ff2 100644 --- a/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungeeAPI.java +++ b/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungeeAPI.java @@ -210,7 +210,7 @@ public class RedisBungeeAPI { * @return the name for the UUID * @since 0.3 */ - public final String getNameFromUuid(UUID uuid) { + public final String getNameFromUuid(@NonNull UUID uuid) { return plugin.getUuidTranslator().getNameFromUuid(uuid); } @@ -222,7 +222,7 @@ public class RedisBungeeAPI { * @return the UUID for the name * @since 0.3 */ - public final UUID getUuidFromName(String name) { + public final UUID getUuidFromName(@NonNull String name) { return plugin.getUuidTranslator().getTranslatedUuid(name); } } diff --git a/src/main/java/com/imaginarycode/minecraft/redisbungee/util/UUIDTranslator.java b/src/main/java/com/imaginarycode/minecraft/redisbungee/util/UUIDTranslator.java index 4faf5e8..6606858 100644 --- a/src/main/java/com/imaginarycode/minecraft/redisbungee/util/UUIDTranslator.java +++ b/src/main/java/com/imaginarycode/minecraft/redisbungee/util/UUIDTranslator.java @@ -11,6 +11,7 @@ import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; import com.google.common.collect.Maps; import com.imaginarycode.minecraft.redisbungee.RedisBungee; +import lombok.NonNull; import lombok.RequiredArgsConstructor; import net.md_5.bungee.api.ProxyServer; import redis.clients.jedis.Jedis; @@ -28,7 +29,7 @@ public class UUIDTranslator { public static final Pattern UUID_PATTERN = Pattern.compile("[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}"); public static final Pattern MOJANGIAN_UUID_PATTERN = Pattern.compile("[a-fA-F0-9]{32}"); - public UUID getTranslatedUuid(String player) { + public UUID getTranslatedUuid(@NonNull String player) { if (ProxyServer.getInstance().getPlayer(player) != null) return ProxyServer.getInstance().getPlayer(player).getUniqueId(); @@ -81,7 +82,7 @@ public class UUIDTranslator { } } - public String getNameFromUuid(UUID player) { + public String getNameFromUuid(@NonNull UUID player) { if (ProxyServer.getInstance().getPlayer(player) != null) return ProxyServer.getInstance().getPlayer(player).getName();