Removed DataCache#getName - not used

This commit is contained in:
Rsl1122 2019-02-02 09:10:06 +02:00
parent fc07cb0227
commit e2507c249b

View File

@ -45,7 +45,6 @@ public class DataCache extends SessionCache implements SubSystem {
private final ErrorHandler errorHandler;
private final Map<UUID, String> playerNames;
private final Map<String, UUID> uuids;
private final Map<UUID, String> displayNames;
@ -56,7 +55,6 @@ public class DataCache extends SessionCache implements SubSystem {
) {
super(dbSystem);
this.errorHandler = errorHandler;
playerNames = new HashMap<>();
displayNames = new HashMap<>();
uuids = new HashMap<>();
}
@ -68,7 +66,6 @@ public class DataCache extends SessionCache implements SubSystem {
@Override
public void disable() {
playerNames.clear();
uuids.clear();
displayNames.clear();
}
@ -85,31 +82,6 @@ public class DataCache extends SessionCache implements SubSystem {
}
}
/**
* Used to get the player name in the cache.
* <p>
* It is recommended to use
* {@link com.djrapitops.plan.data.store.keys.AnalysisKeys#PLAYER_NAMES} and
* {@link com.djrapitops.plan.data.store.keys.PlayerKeys#NAME} when possible
* because this method will call database if a name is not found.
*
* @param uuid UUID of the player.
* @return name or null if not cached.
*/
public String getName(UUID uuid) {
String name = playerNames.get(uuid);
if (name == null) {
try {
name = dbSystem.getDatabase().fetch().getPlayerName(uuid);
playerNames.put(uuid, name);
} catch (DBOpException e) {
errorHandler.log(L.ERROR, this.getClass(), e);
name = "Error occurred";
}
}
return name;
}
/**
* Used to get the player display name in the cache.
* <p>