package design.model; import java.util.ArrayList; import java.util.List; public class Golfer { private String username; private int passwordHash; private String fullName; private final transient List courses; // might be better to make this like a courseID or something private final List 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(); } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getFullName() { return fullName; } public void setFullName(String fullName) { this.fullName = fullName; } public void setPassword(String password) { this.passwordHash = password.hashCode(); } public boolean checkPassword(String password) { return passwordHash == password.hashCode(); } public Course[] getCourses() { return courses.toArray(Course[]::new); } public void addCourse(Course course) { courses.add(course); } public void removeCourse(Course course) { courses.remove(course); } public Round[] getRounds() { return rounds.toArray(Round[]::new); } public void addRound(Round round) { rounds.add(round); } }