Record Class RaceDTO

java.lang.Object
java.lang.Record
com.endurancetrio.business.event.dto.RaceDTO
Record Components:
id - the unique identifier of the race
title - the title of the race
subtitle - the subtitle of the race
date - the date of the race
time - an optional start time for the race
sports - the sport codes associated with the race
distanceTypes - the distance type codes associated with the race
raceTypeGroup - the race type group code
distanceMetadata - optional metadata describing the distance composition
event - the event that the race belongs to (may be null)

public record RaceDTO(Long id, String title, String subtitle, LocalDate date, LocalTime time, List<String> sports, List<String> distanceTypes, String raceTypeGroup, DistanceMetadataDTO distanceMetadata, EventDTO event) extends Record
The RaceDTO represents a race within an event, including its schedule, sport categories, distance types, and optional distance metadata.
  • Constructor Details

    • RaceDTO

      public RaceDTO(Long id, String title, String subtitle, LocalDate date, LocalTime time, List<String> sports, List<String> distanceTypes, String raceTypeGroup, DistanceMetadataDTO distanceMetadata, EventDTO event)
      Creates an instance of a RaceDTO record class.
      Parameters:
      id - the value for the id record component
      title - the value for the title record component
      subtitle - the value for the subtitle record component
      date - the value for the date record component
      time - the value for the time record component
      sports - the value for the sports record component
      distanceTypes - the value for the distanceTypes record component
      raceTypeGroup - the value for the raceTypeGroup record component
      distanceMetadata - the value for the distanceMetadata record component
      event - the value for the event 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
    • title

      public String title()
      Returns the value of the title record component.
      Returns:
      the value of the title record component
    • subtitle

      public String subtitle()
      Returns the value of the subtitle record component.
      Returns:
      the value of the subtitle record component
    • date

      public LocalDate date()
      Returns the value of the date record component.
      Returns:
      the value of the date record component
    • time

      public LocalTime time()
      Returns the value of the time record component.
      Returns:
      the value of the time record component
    • sports

      public List<String> sports()
      Returns the value of the sports record component.
      Returns:
      the value of the sports record component
    • distanceTypes

      public List<String> distanceTypes()
      Returns the value of the distanceTypes record component.
      Returns:
      the value of the distanceTypes record component
    • raceTypeGroup

      public String raceTypeGroup()
      Returns the value of the raceTypeGroup record component.
      Returns:
      the value of the raceTypeGroup record component
    • distanceMetadata

      public DistanceMetadataDTO distanceMetadata()
      Returns the value of the distanceMetadata record component.
      Returns:
      the value of the distanceMetadata record component
    • event

      public EventDTO event()
      Returns the value of the event record component.
      Returns:
      the value of the event record component