Class Course
java.lang.Object
org.codewithmagret.rest.course.Course
Represents a course that students can enroll in.
Each course belongs to one category and is taught by one instructor.
A course can have many students enrolled in it.
This entity is used to manage the courses offered in the system,
allowing students to browse and enroll in courses based on their interests and needs.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the category to which the course belongs.getCode()Gets the unique code of the course.getId()Gets the unique identifier of the course.Gets the instructor teaching the course.Gets the list of students enrolled in the course.getTitle()Gets the title of the course.voidsetCategory(Category category) Sets the category to which the course belongs.voidSets the unique code of the course.voidSets the unique identifier of the course.voidsetInstructor(Instructor instructor) Sets the instructor teaching the course.voidsetStudents(List<Student> students) Sets the list of students enrolled in the course.voidSets the title of the course.
-
Constructor Details
-
Course
public Course()Default constructor required by JPA. Initializes a new instance of the Course class. -
Course
Constructs a new Course with the specified title, code, category, and instructor.- Parameters:
title- the title of the coursecode- the unique code for the coursecategory- the category to which the course belongsinstructor- the instructor teaching the course
-
-
Method Details
-
getId
-
setId
Sets the unique identifier of the course.- Parameters:
id- the ID to set for the course
-
getTitle
-
setTitle
Sets the title of the course.- Parameters:
title- the title to set for the course
-
getCode
-
setCode
Sets the unique code of the course.- Parameters:
code- the code to set for the course
-
getCategory
Gets the category to which the course belongs.- Returns:
- the category of the course
-
setCategory
Sets the category to which the course belongs.- Parameters:
category- the category to set for the course
-
getInstructor
Gets the instructor teaching the course.- Returns:
- the instructor of the course
-
setInstructor
Sets the instructor teaching the course.- Parameters:
instructor- the instructor to set for the course
-
getStudents
-
setStudents
-