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
-
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecurrentScore
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of thenameOfTeam
record component.players()
Returns the value of theplayers
record component.score()
Returns the value of thescore
record component.toString()
Returns a string representation of this record class.
-
Constructor Details
-
Team
Creates an instance of aTeam
record class.- Parameters:
players
- the value for theplayers
record componentnameOfTeam
- the value for thenameOfTeam
record componentscore
- the value for thescore
record componentcurrentScore
- the value for thecurrentScore
record component
-
-
Method Details
-
players
Returns the value of theplayers
record component.- Returns:
- the value of the
players
record component
-
nameOfTeam
Returns the value of thenameOfTeam
record component.- Returns:
- the value of the
nameOfTeam
record component
-
score
Returns the value of thescore
record component.- Returns:
- the value of the
score
record component
-
currentScore
Returns the value of thecurrentScore
record component.- Returns:
- the value of the
currentScore
record 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)
.
-