/
eelamimi
/
SberJavaCourseBeginner
Обзор
Документация
Войти
/
eelamimi
/
SberJavaCourseBeginner
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
hw5/src/main/java/courseSber/models/Course.java
64 строки
1 KB
glebka
mistake has been resolved
15 апр 2025, 19:33
15 апр 2025, 19:33
3d31447
Код
Авторство
О чём код?
package courseSber.models; import java.util.UUID; public class Course { private UUID id; private String title, description; private Teacher teacher; public Course(String title, String description, Teacher teacher) { this.id = UUID.randomUUID(); this.title = title; this.description = description; this.teacher = teacher; } public Course(UUID id, String title, String description, Teacher teacher) { this.id = id == null ? UUID.randomUUID() : id; this.title = title; this.description = description; this.teacher = teacher; } public UUID getId() { return id; } public void setId(UUID id) { this.id = id; } 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 Teacher getTeacher() { return teacher; } public void setTeacher(Teacher teacher) { this.teacher = teacher; } @Override public String toString() { return String.format( "Обучающий курс %s: %s; %s", title, description, teacher ); } }