Class Instructor

java.lang.Object
org.codewithmagret.rest.instructor.Instructor

@Entity public class Instructor extends Object
Entity class representing an Instructor in the system. An instructor can teach multiple courses, but each course is taught by one instructor.
  • Constructor Details

    • Instructor

      public Instructor()
      Default constructor required by JPA. Initializes a new instance of the Instructor class.
    • Instructor

      public Instructor(String firstName, String lastName, String email)
      Constructs a new Instructor with the specified first name, last name, and email.
      Parameters:
      firstName - the first name of the instructor
      lastName - the last name of the instructor
      email - the email address of the instructor
  • Method Details

    • getId

      public Long getId()
      Gets the unique identifier of the instructor.
      Returns:
      the ID of the instructor
    • setId

      public void setId(Long id)
      Sets the unique identifier of the instructor.
      Parameters:
      id - the ID to set for the instructor
    • getFirstName

      public String getFirstName()
      Gets the first name of the instructor.
      Returns:
      the first name of the instructor
    • setFirstName

      public void setFirstName(String firstName)
      Sets the first name of the instructor.
      Parameters:
      firstName - the first name to set for the instructor
    • getLastName

      public String getLastName()
      Gets the last name of the instructor.
      Returns:
      the last name of the instructor
    • setLastName

      public void setLastName(String lastName)
      Sets the last name of the instructor.
      Parameters:
      lastName - the last name to set for the instructor
    • getEmail

      public String getEmail()
      Gets the email address of the instructor.
      Returns:
      the email address of the instructor
    • setEmail

      public void setEmail(String email)
      Sets the email address of the instructor.
      Parameters:
      email - the email address to set for the instructor
    • getCourses

      public List<Course> getCourses()
      Gets the list of courses taught by this instructor.
      Returns:
      the list of courses taught by this instructor
    • setCourses

      public void setCourses(List<Course> courses)
      Sets the list of courses taught by this instructor.
      Parameters:
      courses - the list of courses to set for this instructor