diff options
Diffstat (limited to 'src/main/java/design/model/Golfer.java')
| -rw-r--r-- | src/main/java/design/model/Golfer.java | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/main/java/design/model/Golfer.java b/src/main/java/design/model/Golfer.java index 8f09067..1a6c7b6 100644 --- a/src/main/java/design/model/Golfer.java +++ b/src/main/java/design/model/Golfer.java @@ -7,15 +7,24 @@ public class Golfer { private String username; private int passwordHash; private String fullName; - private final transient List<Course> courses; // might be better to make this like a courseID or something + private final List<Course> courses; private final List<Round> rounds; + // for deserialization + public Golfer(String username, int passwordHash, String fullName, List<Course> courses, List<Round> rounds) { + this.username = username; + this.passwordHash = passwordHash; + this.fullName = fullName; + this.courses = courses; + this.rounds = rounds; + } + public Golfer(String fullName, String username, String password) { - this.courses = new ArrayList<>(); - this.rounds = new ArrayList<>(); this.fullName = fullName; this.username = username; this.passwordHash = password.hashCode(); + this.courses = new ArrayList<>(); + this.rounds = new ArrayList<>(); } public String getUsername() { @@ -61,6 +70,4 @@ public class Golfer { public void addRound(Round round) { rounds.add(round); } - - } |
