Record Class TimeRangeInOut.TimeRangeDay
java.lang.Object
java.lang.Record
com.iohao.net.framework.core.flow.internal.TimeRangeInOut.TimeRangeDay
- Record Components:
localDate- Datecount- Total number of action calls for one daytimeRangeHours- Time periods
- Enclosing class:
TimeRangeInOut
public static record TimeRangeInOut.TimeRangeDay(LocalDate localDate, LongAdder count, TimeRangeInOut.TimeRangeHour[] timeRangeHours)
extends Record
Daily call statistics record holding the date, total count, and per-hour breakdowns.
- Author:
- 渔民小镇
-
Constructor Summary
ConstructorsConstructorDescriptionTimeRangeDay(LocalDate localDate, LongAdder count, TimeRangeInOut.TimeRangeHour[] timeRangeHours) Creates an instance of aTimeRangeDayrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncount()Returns the value of thecountrecord component.static TimeRangeInOut.TimeRangeDaycreate(LocalDate localDate, List<TimeRangeInOut.TimeRangeHour> timeRangeHours) Create a daily statistics record for the given date with the specified hour ranges.final booleanIndicates whether some other object is "equal to" this one.getTimeRangeHour(LocalTime localTime) Get the hour-level statistics for the given time.final inthashCode()Returns a hash code value for this object.voidIncrement the daily count and delegate to the corresponding hour-level statistics.Returns the value of thelocalDaterecord component.stream()Return a stream of non-null hour-level statistics.Returns the value of thetimeRangeHoursrecord component.@NonNull StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TimeRangeDay
public TimeRangeDay(LocalDate localDate, LongAdder count, TimeRangeInOut.TimeRangeHour[] timeRangeHours) Creates an instance of aTimeRangeDayrecord class.- Parameters:
localDate- the value for thelocalDaterecord componentcount- the value for thecountrecord componenttimeRangeHours- the value for thetimeRangeHoursrecord component
-
-
Method Details
-
create
public static TimeRangeInOut.TimeRangeDay create(LocalDate localDate, List<TimeRangeInOut.TimeRangeHour> timeRangeHours) Create a daily statistics record for the given date with the specified hour ranges.- Parameters:
localDate- the datetimeRangeHours- the hour-level statistics objects- Returns:
- a new
TimeRangeDayinstance
-
stream
Return a stream of non-null hour-level statistics.- Returns:
- stream of
TimeRangeInOut.TimeRangeHour
-
getTimeRangeHour
Get the hour-level statistics for the given time.- Parameters:
localTime- the time of day- Returns:
- the
TimeRangeInOut.TimeRangeHourfor the corresponding hour, ornull
-
increment
Increment the daily count and delegate to the corresponding hour-level statistics.- Parameters:
localTime- the current time of day
-
toString
-
hashCode
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
localDate
-
count
-
timeRangeHours
Returns the value of thetimeRangeHoursrecord component.- Returns:
- the value of the
timeRangeHoursrecord component
-