Record Class StudentInfo
java.lang.Object
java.lang.Record
edu.ucsb.cs156.frontiers.models.StudentInfo
- Record Components:
email- the student's email as stored on the rosterfirstName- the shortest unique name for the studentlegalFirstName- the roster's first name field, unchangedlastName- the roster's last name field, unchangedgithubLogin- the student's GitHub login, or null if they have not linked GitHub yetteam- the name of the student's team (the first one, if they are on several), or null if they are not on a teamteams- the names of all the student's teams, possibly emptyteamMembers- everyone onteam, including the student, or empty if the student has no team
public record StudentInfo(String email, String firstName, String legalFirstName, String lastName, String githubLogin, String team, List<String> teams, List<StudentInfo.Member> teamMembers)
extends Record
What an autograder needs to know about one roster student: how to recognise them on GitHub, which
team they are on, and who else is on that team. This is the response of
GET /api/courses/studentInfo.
The firstName fields hold the shortest name that still identifies the student
among all the (non-dropped) students of the course, as computed by TeamCsvService.nameAndTeams(List): e.g. "Chris" if there is only one
Chris, "Chris L" if there are several. That is the name a teammate is likely to use for them. The
legalFirstName fields hold the roster's first name field as is.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordOne member of the student's team. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionemail()Returns the value of theemailrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefirstNamerecord component.Returns the value of thegithubLoginrecord component.final inthashCode()Returns a hash code value for this object.lastName()Returns the value of thelastNamerecord component.Returns the value of thelegalFirstNamerecord component.team()Returns the value of theteamrecord component.Returns the value of theteamMembersrecord component.teams()Returns the value of theteamsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
StudentInfo
public StudentInfo(String email, String firstName, String legalFirstName, String lastName, String githubLogin, String team, List<String> teams, List<StudentInfo.Member> teamMembers) Creates an instance of aStudentInforecord class.- Parameters:
email- the value for theemailrecord componentfirstName- the value for thefirstNamerecord componentlegalFirstName- the value for thelegalFirstNamerecord componentlastName- the value for thelastNamerecord componentgithubLogin- the value for thegithubLoginrecord componentteam- the value for theteamrecord componentteams- the value for theteamsrecord componentteamMembers- the value for theteamMembersrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
email
-
firstName
-
legalFirstName
Returns the value of thelegalFirstNamerecord component.- Returns:
- the value of the
legalFirstNamerecord component
-
lastName
-
githubLogin
Returns the value of thegithubLoginrecord component.- Returns:
- the value of the
githubLoginrecord component
-
team
-
teams
-
teamMembers
Returns the value of theteamMembersrecord component.- Returns:
- the value of the
teamMembersrecord component
-