You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Comment on PR by Kevin:
"A potential cleanup for a future PR could be to make this constructor private and instead use public factory methods to create participants. Some of the code that calls this now has to specify fields that don't make sense for their particular case. For example, creating a new unmatched participant requires the caller to explicitly include the MatchStatus and a zeroed out match ID. Not only does this lead to more LOC, but it also leaks a small detail that 0 is this class' default value for matchId.
A factory method might look like
return new Participant(username, startTimeAvailable, endTimeAvailable, /* matchId= */ 0, MatchStatus.UNMATCHED, timestamp)
}```
which requires two fewer arguments because an unmatched participant will always have the unmatched enum value and zeroed match ID."
The text was updated successfully, but these errors were encountered:
Comment on PR by Kevin:
"A potential cleanup for a future PR could be to make this constructor private and instead use public factory methods to create participants. Some of the code that calls this now has to specify fields that don't make sense for their particular case. For example, creating a new unmatched participant requires the caller to explicitly include the MatchStatus and a zeroed out match ID. Not only does this lead to more LOC, but it also leaks a small detail that 0 is this class' default value for matchId.
A factory method might look like
The text was updated successfully, but these errors were encountered: