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 batchnextYears- 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 availabletotalYears- the total number of distinct event yearsbatchSize- the maximum number of years per batchbatchGroupPreviousPage- 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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thebatchGroupNextPagerecord component.intReturns the value of thebatchGroupPreviousPagerecord component.intReturns the value of thebatchSizerecord component.intReturns the value of thecurrentPagerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thenextYearsrecord component.Returns the value of thepreviousYearsrecord component.final StringtoString()Returns a string representation of this record class.intReturns the value of thetotalBatchesrecord component.longReturns the value of thetotalYearsrecord component.years()Returns the value of theyearsrecord component.
-
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 aYearsWithEventsDTOrecord class.- Parameters:
years- the value for theyearsrecord componentnextYears- the value for thenextYearsrecord componentpreviousYears- the value for thepreviousYearsrecord componentcurrentPage- the value for thecurrentPagerecord componenttotalBatches- the value for thetotalBatchesrecord componenttotalYears- the value for thetotalYearsrecord componentbatchSize- the value for thebatchSizerecord componentbatchGroupPreviousPage- the value for thebatchGroupPreviousPagerecord componentbatchGroupNextPage- the value for thebatchGroupNextPagerecord 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
years
Returns the value of theyearsrecord component.- Returns:
- the value of the
yearsrecord component
-
nextYears
Returns the value of thenextYearsrecord component.- Returns:
- the value of the
nextYearsrecord component
-
previousYears
Returns the value of thepreviousYearsrecord component.- Returns:
- the value of the
previousYearsrecord component
-
currentPage
public int currentPage()Returns the value of thecurrentPagerecord component.- Returns:
- the value of the
currentPagerecord component
-
totalBatches
public int totalBatches()Returns the value of thetotalBatchesrecord component.- Returns:
- the value of the
totalBatchesrecord component
-
totalYears
public long totalYears()Returns the value of thetotalYearsrecord component.- Returns:
- the value of the
totalYearsrecord component
-
batchSize
public int batchSize()Returns the value of thebatchSizerecord component.- Returns:
- the value of the
batchSizerecord component
-
batchGroupPreviousPage
public int batchGroupPreviousPage()Returns the value of thebatchGroupPreviousPagerecord component.- Returns:
- the value of the
batchGroupPreviousPagerecord component
-
batchGroupNextPage
public int batchGroupNextPage()Returns the value of thebatchGroupNextPagerecord component.- Returns:
- the value of the
batchGroupNextPagerecord component
-