Record Class AthleteDTO
java.lang.Object
java.lang.Record
com.endurancetrio.business.competitor.dto.AthleteDTO
- Record Components:
id- the unique identifier of the athletelongName- the athlete's longest available namebirthName- the athlete's name at birth (may be null)knownName- the athlete's known or preferred namegender- the athlete's gendercountry- the athlete's country of representation (may be null)yearOfBirth- the athlete's year of birth (may be null)
public record AthleteDTO(Long id, String longName, String birthName, String knownName, AthleteGender gender, Country country, Integer yearOfBirth)
extends Record
AthleteDTO represents an athlete with its basic information.-
Constructor Summary
ConstructorsConstructorDescriptionAthleteDTO(Long id, String longName, String birthName, String knownName, AthleteGender gender, Country country, Integer yearOfBirth) Creates an instance of aAthleteDTOrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thebirthNamerecord component.country()Returns the value of thecountryrecord component.final booleanIndicates whether some other object is "equal to" this one.gender()Returns the value of thegenderrecord component.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.Returns the value of theknownNamerecord component.longName()Returns the value of thelongNamerecord component.final StringtoString()Returns a string representation of this record class.Returns the value of theyearOfBirthrecord component.
-
Constructor Details
-
AthleteDTO
public AthleteDTO(Long id, String longName, String birthName, String knownName, AthleteGender gender, Country country, Integer yearOfBirth) Creates an instance of aAthleteDTOrecord class.- Parameters:
id- the value for theidrecord componentlongName- the value for thelongNamerecord componentbirthName- the value for thebirthNamerecord componentknownName- the value for theknownNamerecord componentgender- the value for thegenderrecord componentcountry- the value for thecountryrecord componentyearOfBirth- the value for theyearOfBirthrecord component
-
-
Method Details
-
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). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
longName
Returns the value of thelongNamerecord component.- Returns:
- the value of the
longNamerecord component
-
birthName
Returns the value of thebirthNamerecord component.- Returns:
- the value of the
birthNamerecord component
-
knownName
Returns the value of theknownNamerecord component.- Returns:
- the value of the
knownNamerecord component
-
gender
Returns the value of thegenderrecord component.- Returns:
- the value of the
genderrecord component
-
country
Returns the value of thecountryrecord component.- Returns:
- the value of the
countryrecord component
-
yearOfBirth
Returns the value of theyearOfBirthrecord component.- Returns:
- the value of the
yearOfBirthrecord component
-