Record Class AthleteDTO

java.lang.Object
java.lang.Record
com.endurancetrio.business.competitor.dto.AthleteDTO
Record Components:
id - the unique identifier of the athlete
longName - the athlete's longest available name
birthName - the athlete's name at birth (may be null)
knownName - the athlete's known or preferred name
gender - the athlete's gender
country - 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 Details

    • AthleteDTO

      public AthleteDTO(Long id, String longName, String birthName, String knownName, AthleteGender gender, Country country, Integer yearOfBirth)
      Creates an instance of a AthleteDTO record class.
      Parameters:
      id - the value for the id record component
      longName - the value for the longName record component
      birthName - the value for the birthName record component
      knownName - the value for the knownName record component
      gender - the value for the gender record component
      country - the value for the country record component
      yearOfBirth - the value for the yearOfBirth record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • id

      public Long id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • longName

      public String longName()
      Returns the value of the longName record component.
      Returns:
      the value of the longName record component
    • birthName

      public String birthName()
      Returns the value of the birthName record component.
      Returns:
      the value of the birthName record component
    • knownName

      public String knownName()
      Returns the value of the knownName record component.
      Returns:
      the value of the knownName record component
    • gender

      public AthleteGender gender()
      Returns the value of the gender record component.
      Returns:
      the value of the gender record component
    • country

      public Country country()
      Returns the value of the country record component.
      Returns:
      the value of the country record component
    • yearOfBirth

      public Integer yearOfBirth()
      Returns the value of the yearOfBirth record component.
      Returns:
      the value of the yearOfBirth record component