Package game
Record Class Team
java.lang.Object
java.lang.Record
game.Team
public record Team(List<User> players, String nameOfTeam, Integer score, Integer currentScore)
extends Record
A record modelling the concept of "team"
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecurrentScorerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thenameOfTeamrecord component.players()Returns the value of theplayersrecord component.score()Returns the value of thescorerecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
Team
Creates an instance of aTeamrecord class.- Parameters:
players- the value for theplayersrecord componentnameOfTeam- the value for thenameOfTeamrecord componentscore- the value for thescorerecord componentcurrentScore- the value for thecurrentScorerecord component
-
-
Method Details
-
players
Returns the value of theplayersrecord component.- Returns:
- the value of the
playersrecord component
-
nameOfTeam
Returns the value of thenameOfTeamrecord component.- Returns:
- the value of the
nameOfTeamrecord component
-
score
Returns the value of thescorerecord component.- Returns:
- the value of the
scorerecord component
-
currentScore
Returns the value of thecurrentScorerecord component.- Returns:
- the value of the
currentScorerecord component
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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).
-