Package com.nicholasalfonso.lato.service
Record Class DashboardService.DashboardStatistics
java.lang.Object
java.lang.Record
com.nicholasalfonso.lato.service.DashboardService.DashboardStatistics
- Record Components:
completionPercentage- overall assignment completion percentageweeksLeftInSemester- estimated weeks remaining in the semester, if knowncurrentWeek- current week index within the semester range, if knowntotalWeeks- total weeks in the semester range, if known
- Enclosing class:
DashboardService
public static record DashboardService.DashboardStatistics(double completionPercentage, Long weeksLeftInSemester, Long currentWeek, Long totalWeeks)
extends Record
Dashboard statistics exposed to API clients.
-
Constructor Summary
ConstructorsConstructorDescriptionDashboardStatistics(double completionPercentage, Long weeksLeftInSemester, Long currentWeek, Long totalWeeks) Creates an instance of aDashboardStatisticsrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of thecompletionPercentagerecord component.Returns the value of thecurrentWeekrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.Returns the value of thetotalWeeksrecord component.Returns the value of theweeksLeftInSemesterrecord component.
-
Constructor Details
-
DashboardStatistics
public DashboardStatistics(double completionPercentage, Long weeksLeftInSemester, Long currentWeek, Long totalWeeks) Creates an instance of aDashboardStatisticsrecord class.- Parameters:
completionPercentage- the value for thecompletionPercentagerecord componentweeksLeftInSemester- the value for theweeksLeftInSemesterrecord componentcurrentWeek- the value for thecurrentWeekrecord componenttotalWeeks- the value for thetotalWeeksrecord 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 '=='. -
completionPercentage
public double completionPercentage()Returns the value of thecompletionPercentagerecord component.- Returns:
- the value of the
completionPercentagerecord component
-
weeksLeftInSemester
Returns the value of theweeksLeftInSemesterrecord component.- Returns:
- the value of the
weeksLeftInSemesterrecord component
-
currentWeek
Returns the value of thecurrentWeekrecord component.- Returns:
- the value of the
currentWeekrecord component
-
totalWeeks
Returns the value of thetotalWeeksrecord component.- Returns:
- the value of the
totalWeeksrecord component
-