Record Class RoomSchedule
java.lang.Object
java.lang.Record
de.gustavblass.fsu.fmi.roombooking.model.room.schedule.RoomSchedule
- Record Components:
date- The day for which this schedule is valid.schedule- The Reservations placed for a specific Room on thedate.
public record RoomSchedule(@NonNull LocalDate date, @NonNull @Unmodifiable List<RoomScheduleItem> schedule)
extends Record
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRoomSchedule(@NonNull LocalDate date, @NonNull List<RoomScheduleItem> schedule) Constructs a new schedule. -
Method Summary
Modifier and TypeMethodDescription@NonNull LocalDatedate()Returns the value of thedaterecord component.final booleanIndicates whether some other object is "equal to" this one.@NonNull @Unmodifiable List<RoomScheduleItem> @NonNull @Unmodifiable List<RoomScheduleItem> @NonNull @Unmodifiable List<RoomScheduleItem> final inthashCode()Returns a hash code value for this object.@NonNull @Unmodifiable List<RoomScheduleItem> schedule()Returns the value of theschedulerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
date
-
schedule
The field for theschedulerecord component.
-
-
Constructor Details
-
RoomSchedule
public RoomSchedule(@NonNull @NonNull LocalDate date, @NonNull @NonNull List<RoomScheduleItem> schedule) Constructs a new schedule.- Parameters:
date- Thedate.schedule- Theschedule. Will be sorted by theRoomScheduleItem.startTime()and converted to an unmodifiable list.
-
-
Method Details
-
getOccupiedPeriods
@Contract(pure=true) @NonNull public @NonNull @Unmodifiable List<RoomScheduleItem> getOccupiedPeriods()- Returns:
- Only those time periods of the
dateduring which there is a non-SeatReservationReservationfor this schedule'sRoom.
-
getPartiallyOrFullyOccupiedPeriods
@Contract(pure=true) @NonNull public @NonNull @Unmodifiable List<RoomScheduleItem> getPartiallyOrFullyOccupiedPeriods()- Returns:
- Only those time periods of the
dateduring which there is aReservationfor this schedule'sRoom.
-
getFreePeriods
- Returns:
- Only those time periods of the
dateduring which there are no Reservations for this schedule'sRoom.
-
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). -
date
-
schedule
-