You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
112 lines
2.7 KiB
112 lines
2.7 KiB
/**
|
|
* 课程实体类
|
|
* 遵循单一职责原则,表示培训课程的基本信息
|
|
*/
|
|
package com.employeetraining.course;
|
|
|
|
import java.util.Objects;
|
|
|
|
public class Course {
|
|
private String courseId;
|
|
private String title;
|
|
private String description;
|
|
private int durationHours;
|
|
private String instructor;
|
|
private String category;
|
|
private boolean isRequired;
|
|
|
|
public Course() {
|
|
}
|
|
|
|
public Course(String courseId, String title, String description, int durationHours,
|
|
String instructor, String category, boolean isRequired) {
|
|
this.courseId = courseId;
|
|
this.title = title;
|
|
this.description = description;
|
|
this.durationHours = durationHours;
|
|
this.instructor = instructor;
|
|
this.category = category;
|
|
this.isRequired = isRequired;
|
|
}
|
|
|
|
// Getters and Setters
|
|
public String getCourseId() {
|
|
return courseId;
|
|
}
|
|
|
|
public void setCourseId(String courseId) {
|
|
this.courseId = courseId;
|
|
}
|
|
|
|
public String getTitle() {
|
|
return title;
|
|
}
|
|
|
|
public void setTitle(String title) {
|
|
this.title = title;
|
|
}
|
|
|
|
public String getDescription() {
|
|
return description;
|
|
}
|
|
|
|
public void setDescription(String description) {
|
|
this.description = description;
|
|
}
|
|
|
|
public int getDurationHours() {
|
|
return durationHours;
|
|
}
|
|
|
|
public void setDurationHours(int durationHours) {
|
|
this.durationHours = durationHours;
|
|
}
|
|
|
|
public String getInstructor() {
|
|
return instructor;
|
|
}
|
|
|
|
public void setInstructor(String instructor) {
|
|
this.instructor = instructor;
|
|
}
|
|
|
|
public String getCategory() {
|
|
return category;
|
|
}
|
|
|
|
public void setCategory(String category) {
|
|
this.category = category;
|
|
}
|
|
|
|
public boolean isRequired() {
|
|
return isRequired;
|
|
}
|
|
|
|
public void setRequired(boolean required) {
|
|
isRequired = required;
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object o) {
|
|
if (this == o) return true;
|
|
if (o == null || getClass() != o.getClass()) return false;
|
|
Course course = (Course) o;
|
|
return Objects.equals(courseId, course.courseId);
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
return Objects.hash(courseId);
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return "Course{" +
|
|
"courseId='" + courseId + '\'' +
|
|
", title='" + title + '\'' +
|
|
", category='" + category + '\'' +
|
|
", duration=" + durationHours + "h" +
|
|
", required=" + isRequired +
|
|
'}';
|
|
}
|
|
} |