forked from External/mage
rewrites to optionals
This commit is contained in:
parent
348faa345b
commit
ff6c6405aa
28 changed files with 760 additions and 494 deletions
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
package mage.server.tournament;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
|
|
@ -85,10 +86,14 @@ public enum TournamentManager {
|
|||
return null;
|
||||
}
|
||||
|
||||
public UUID getChatId(UUID tournamentId) {
|
||||
return controllers.get(tournamentId).getChatId();
|
||||
public Optional<UUID> getChatId(UUID tournamentId) {
|
||||
if(controllers.containsKey(tournamentId)) {
|
||||
return Optional.of(controllers.get(tournamentId).getChatId());
|
||||
}
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
|
||||
public void removeTournament(UUID tournamentId) {
|
||||
TournamentController tournamentController = controllers.get(tournamentId);
|
||||
if (tournamentController != null) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue