From 2da89c4761d7230251f8ee00e54ebfbfead27517 Mon Sep 17 00:00:00 2001 From: fdai7887 Date: Thu, 8 Feb 2024 16:31:44 +0100 Subject: [PATCH] Added setter for coursesTaught and improved documentation --- src/main/java/org/example/Professor.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/example/Professor.java b/src/main/java/org/example/Professor.java index ec3271f..303fc93 100644 --- a/src/main/java/org/example/Professor.java +++ b/src/main/java/org/example/Professor.java @@ -30,6 +30,7 @@ public class Professor { } + /** * Constructs a new Professor with the specified ID, name, and role. * @@ -45,8 +46,18 @@ public class Professor { } - + /** + * Retrieves a List of the professors courses. + * + * @return the unique identifier for the professor + */ public List getCoursesTaught() {return coursesTaught;} + /** + * Sets the List of courses taught by the professor to the specified value. + * + * @param coursesTaught the unique identifier for the professor + */ + public void setCoursesTaught(List coursesTaught) {this.coursesTaught = coursesTaught;} /** * Retrieves the professor's ID.