Record Class EventDTO

java.lang.Object
java.lang.Record
com.endurancetrio.business.event.dto.EventDTO
Record Components:
id - the unique identifier of the event
title - the title of the event
startDate - the start date of the event
endDate - the end date of the event
city - the city where the event takes place
county - the county where the event takes place
district - the district where the event takes place
sportCodes - the distinct sport codes associated with the event's courses, sorted alphabetically

public record EventDTO(Long id, String title, LocalDate startDate, LocalDate endDate, String city, String county, String district, List<String> sportCodes) extends Record
The EventDTO represents an event with its basic information, location data, and the distinct sport codes extracted from its courses.
  • Constructor Details

    • EventDTO

      public EventDTO(Long id, String title, LocalDate startDate, LocalDate endDate, String city, String county, String district, List<String> sportCodes)
      Creates an instance of a EventDTO record class.
      Parameters:
      id - the value for the id record component
      title - the value for the title record component
      startDate - the value for the startDate record component
      endDate - the value for the endDate record component
      city - the value for the city record component
      county - the value for the county record component
      district - the value for the district record component
      sportCodes - the value for the sportCodes 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
    • startDate

      public LocalDate startDate()
      Returns the value of the startDate record component.
      Returns:
      the value of the startDate record component
    • endDate

      public LocalDate endDate()
      Returns the value of the endDate record component.
      Returns:
      the value of the endDate record component
    • city

      public String city()
      Returns the value of the city record component.
      Returns:
      the value of the city record component
    • county

      public String county()
      Returns the value of the county record component.
      Returns:
      the value of the county record component
    • district

      public String district()
      Returns the value of the district record component.
      Returns:
      the value of the district record component
    • sportCodes

      public List<String> sportCodes()
      Returns the value of the sportCodes record component.
      Returns:
      the value of the sportCodes record component