summaryrefslogtreecommitdiff
path: root/src/main/java/design/model/StrokeLeague.java
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/main/java/design/model/StrokeLeague.java9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/main/java/design/model/StrokeLeague.java b/src/main/java/design/model/StrokeLeague.java
index 497db20..57ba1aa 100644
--- a/src/main/java/design/model/StrokeLeague.java
+++ b/src/main/java/design/model/StrokeLeague.java
@@ -13,8 +13,8 @@ import java.util.Map;
@JsonTypeName("stroke")
public class StrokeLeague extends League {
- private List<Golfer> participants;
- private Map<Golfer, Integer> totalStrokes;
+ private final List<Golfer> participants;
+ private final Map<Golfer, Integer> totalStrokes;
@JsonCreator
private StrokeLeague(int id, String name, Date registrationDate, Date startDate, Date endDate, Golfer owner, List<Golfer> participants, List<Match> schedule) {
@@ -31,9 +31,8 @@ public class StrokeLeague extends League {
}
public boolean addParticipants(Golfer g) {
- boolean added = participants.add(g);
- if(added) totalStrokes.putIfAbsent(g, 0);
- return added;
+ totalStrokes.putIfAbsent(g, 0);
+ return participants.add(g);
}
public boolean removeParticipants(Golfer g) {