Class CoursesByCategory
java.lang.Object
org.codewithmagret.rest.report.dto.CoursesByCategory
This class represents a report of courses grouped by category.
It contains the category name and the number of courses in that category.
It is used as a Data Transfer Object (DTO) to transfer data from the service layer
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for CoursesByCategory.CoursesByCategory(Long categoryId, String categoryName, List<SimpleCourse> courses) Parameterized constructor for CoursesByCategory. -
Method Summary
Modifier and TypeMethodDescriptionGetters and setters for the fields of CoursesByCategory.Getters for the fields of CoursesByCategory.Getters for the fields of CoursesByCategory.voidsetCategoryId(Long categoryId) Setters for the fields of CoursesByCategory.voidsetCategoryName(String categoryName) Setters for the fields of CoursesByCategory.voidsetCourses(List<SimpleCourse> courses) Setters for the fields of CoursesByCategory.
-
Constructor Details
-
CoursesByCategory
public CoursesByCategory()Default constructor for CoursesByCategory. Required for JSON deserialization. -
CoursesByCategory
Parameterized constructor for CoursesByCategory.- Parameters:
categoryId- the ID of the categorycategoryName- the name of the categorycourses- the list of courses in the category
-
-
Method Details
-
getCategoryId
Getters and setters for the fields of CoursesByCategory.- Returns:
- the category ID, category name, and list of courses
-
setCategoryId
Setters for the fields of CoursesByCategory.- Parameters:
categoryId- the ID of the category to set
-
getCategoryName
Getters for the fields of CoursesByCategory.- Returns:
- the name of the category
-
setCategoryName
Setters for the fields of CoursesByCategory.- Parameters:
categoryName- the name of the category to set
-
getCourses
Getters for the fields of CoursesByCategory.- Returns:
- the list of courses in the category
-
setCourses
Setters for the fields of CoursesByCategory.- Parameters:
courses- the list of courses in the category to set
-