| 1 | package edu.ucsb.cs.scaffold.model; | |
| 2 | ||
| 3 | import edu.ucsb.cs.scaffold.entity.RosterStudent; | |
| 4 | import edu.ucsb.cs.scaffold.enums.RosterStatus; | |
| 5 | ||
| 6 | /** | |
| 7 | * This is a DTO class that represents a student in the roster. It is used to transfer data between | |
| 8 | * the server and the client. | |
| 9 | */ | |
| 10 | public record RosterStudentDTO( | |
| 11 | Long id, | |
| 12 | Long courseId, | |
| 13 | String studentId, | |
| 14 | String firstName, | |
| 15 | String lastName, | |
| 16 | String email, | |
| 17 | String section, | |
| 18 | long userId, | |
| 19 | RosterStatus rosterStatus) { | |
| 20 | ||
| 21 | public RosterStudentDTO(RosterStudent rosterStudent) { | |
| 22 | this( | |
| 23 | rosterStudent.getId(), | |
| 24 | rosterStudent.getCourse().getId(), | |
| 25 | rosterStudent.getStudentId(), | |
| 26 | rosterStudent.getFirstName(), | |
| 27 | rosterStudent.getLastName(), | |
| 28 | rosterStudent.getEmail(), | |
| 29 | rosterStudent.getSection(), | |
| 30 |
1
1. <init> : negated conditional → KILLED |
rosterStudent.getUser() != null ? rosterStudent.getUser().getId() : 0, |
| 31 | rosterStudent.getRosterStatus()); | |
| 32 | } | |
| 33 | } | |
Mutations | ||
| 30 |
1.1 |