add some Java8 magic to the server

This commit is contained in:
Ingmar Goudt 2019-01-19 09:31:50 +01:00
parent 9bea7c7df2
commit 50f28a2bf7
7 changed files with 46 additions and 56 deletions

View file

@ -16,8 +16,8 @@ public enum TournamentManager {
instance;
private final ConcurrentHashMap<UUID, TournamentController> controllers = new ConcurrentHashMap<>();
public TournamentController getTournamentController(UUID tournamentId) {
return controllers.get(tournamentId);
public Optional<TournamentController> getTournamentController(UUID tournamentId) {
return Optional.ofNullable(controllers.get(tournamentId));
}
public void createTournamentSession(Tournament tournament, ConcurrentHashMap<UUID, UUID> userPlayerMap, UUID tableId) {