Class CoursesByCategory

java.lang.Object
org.codewithmagret.rest.report.dto.CoursesByCategory

public class CoursesByCategory extends Object
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 Details

    • CoursesByCategory

      public CoursesByCategory()
      Default constructor for CoursesByCategory. Required for JSON deserialization.
    • CoursesByCategory

      public CoursesByCategory(Long categoryId, String categoryName, List<SimpleCourse> courses)
      Parameterized constructor for CoursesByCategory.
      Parameters:
      categoryId - the ID of the category
      categoryName - the name of the category
      courses - the list of courses in the category
  • Method Details

    • getCategoryId

      public Long getCategoryId()
      Getters and setters for the fields of CoursesByCategory.
      Returns:
      the category ID, category name, and list of courses
    • setCategoryId

      public void setCategoryId(Long categoryId)
      Setters for the fields of CoursesByCategory.
      Parameters:
      categoryId - the ID of the category to set
    • getCategoryName

      public String getCategoryName()
      Getters for the fields of CoursesByCategory.
      Returns:
      the name of the category
    • setCategoryName

      public void setCategoryName(String categoryName)
      Setters for the fields of CoursesByCategory.
      Parameters:
      categoryName - the name of the category to set
    • getCourses

      public List<SimpleCourse> getCourses()
      Getters for the fields of CoursesByCategory.
      Returns:
      the list of courses in the category
    • setCourses

      public void setCourses(List<SimpleCourse> courses)
      Setters for the fields of CoursesByCategory.
      Parameters:
      courses - the list of courses in the category to set