Record Class YearsWithEventsDTO

java.lang.Object
java.lang.Record
com.endurancetrio.business.event.dto.YearsWithEventsDTO
Record Components:
years - the list of years in the current batch
nextYears - the list of years in the next batch (may be empty if on the last batch)
previousYears - the list of years in the previous batch (may be empty if on the first batch)
currentPage - the current page index (zero-based)
totalBatches - the total number of batches available
totalYears - the total number of distinct event years
batchSize - the maximum number of years per batch
batchGroupPreviousPage - the page index of the previous batch group (may be -1 if none)
batchGroupNextPage - the page index of the next batch group (may be -1 if none)
All Implemented Interfaces:
Serializable

public record YearsWithEventsDTO(List<Integer> years, List<Integer> nextYears, List<Integer> previousYears, int currentPage, int totalBatches, long totalYears, int batchSize, int batchGroupPreviousPage, int batchGroupNextPage) extends Record implements Serializable
The YearsWithEventsDTO represents a paginated batch of years for navigating through events by year. It carries both the current batch of years and adjacent batches for pagination, along with metadata about the overall pagination state.
See Also:
  • Constructor Details

    • YearsWithEventsDTO

      public YearsWithEventsDTO(List<Integer> years, List<Integer> nextYears, List<Integer> previousYears, int currentPage, int totalBatches, long totalYears, int batchSize, int batchGroupPreviousPage, int batchGroupNextPage)
      Creates an instance of a YearsWithEventsDTO record class.
      Parameters:
      years - the value for the years record component
      nextYears - the value for the nextYears record component
      previousYears - the value for the previousYears record component
      currentPage - the value for the currentPage record component
      totalBatches - the value for the totalBatches record component
      totalYears - the value for the totalYears record component
      batchSize - the value for the batchSize record component
      batchGroupPreviousPage - the value for the batchGroupPreviousPage record component
      batchGroupNextPage - the value for the batchGroupNextPage 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • years

      public List<Integer> years()
      Returns the value of the years record component.
      Returns:
      the value of the years record component
    • nextYears

      public List<Integer> nextYears()
      Returns the value of the nextYears record component.
      Returns:
      the value of the nextYears record component
    • previousYears

      public List<Integer> previousYears()
      Returns the value of the previousYears record component.
      Returns:
      the value of the previousYears record component
    • currentPage

      public int currentPage()
      Returns the value of the currentPage record component.
      Returns:
      the value of the currentPage record component
    • totalBatches

      public int totalBatches()
      Returns the value of the totalBatches record component.
      Returns:
      the value of the totalBatches record component
    • totalYears

      public long totalYears()
      Returns the value of the totalYears record component.
      Returns:
      the value of the totalYears record component
    • batchSize

      public int batchSize()
      Returns the value of the batchSize record component.
      Returns:
      the value of the batchSize record component
    • batchGroupPreviousPage

      public int batchGroupPreviousPage()
      Returns the value of the batchGroupPreviousPage record component.
      Returns:
      the value of the batchGroupPreviousPage record component
    • batchGroupNextPage

      public int batchGroupNextPage()
      Returns the value of the batchGroupNextPage record component.
      Returns:
      the value of the batchGroupNextPage record component