[LIB-8] URL and HTML tag processing, new entities fields
[snooker-score-api.git] / src / main / java / org / hedgecode / snooker / SnookerScoreApp.java
index dbd2b9a..c597807 100644 (file)
@@ -199,13 +199,12 @@ public final class SnookerScoreApp {
         );
     }
 
-    private static void printPlayer(Player player) {
+    private static void printPlayer(Player player) throws APIException {
         SnookerScoreConsole.console(
                 String.format(
-                        "%s%s %s [%s] (%s)",
+                        "%s%s [%s] (%s)",
                         INDENT,
-                        player.surnameFirst() ? player.lastName() : player.firstName(),
-                        player.surnameFirst() ? player.firstName() : player.lastName(),
+                        player.fullName(),
                         SnookerDateUtils.formatDate(player.born()),
                         player.nationality()
                 )
@@ -218,17 +217,15 @@ public final class SnookerScoreApp {
         Player player2 = api.getPlayer(match.player2Id());
         SnookerScoreConsole.console(
                 String.format(
-                        "%s[%s %s - %s] %s %s %s-%s %s %s",
+                        "%s[%s %s - %s] %s %s-%s %s",
                         INDENT,
                         SnookerDateUtils.formatDate(match.startDate()),
                         SnookerDateUtils.formatTime(match.startDate()),
                         SnookerDateUtils.formatTime(match.endDate()),
-                        player1.surnameFirst() ? player1.lastName() : player1.firstName(),
-                        player1.surnameFirst() ? player1.firstName() : player1.lastName(),
+                        player1.fullName(),
                         match.score1(),
                         match.score2(),
-                        player2.surnameFirst() ? player2.lastName() : player2.firstName(),
-                        player2.surnameFirst() ? player2.firstName() : player2.lastName()
+                        player2.fullName()
                 )
         );
     }
@@ -302,11 +299,10 @@ public final class SnookerScoreApp {
         Player player = api.getPlayer(seeding.playerId());
         SnookerScoreConsole.console(
                 String.format(
-                        "%s%s. %s %s",
+                        "%s%s. %s",
                         indent,
                         seeding.seeding(),
-                        player.surnameFirst() ? player.lastName() : player.firstName(),
-                        player.surnameFirst() ? player.firstName() : player.lastName()
+                        player.fullName()
                 )
         );
     }