public final class FreeSlotQueryResultBuilder extends Object
IAppointmentFreeSlotQueryParams
. Handles blocking free slots with existing appointments.Constructor and Description |
---|
FreeSlotQueryResultBuilder(ZoneId targetZone)
Creates a new frees slot builder that outputs free slots in the given target time zone.
|
Modifier and Type | Method and Description |
---|---|
FreeSlotQueryResultBuilder |
addBlocker(Instant instantFrom,
Instant instantUntil)
Adds a blocker to this builder, such as an appointment that is booked already.
|
FreeSlotQueryResultBuilder |
addFreeSlot(com.google.common.collect.Range<ZonedDateTime> range,
long capacity)
Adds an available slot to this builder.
|
FreeSlotQueryResultBuilder |
appointmentType(AppointmentType appointmentType) |
FreeSlotQueryResultBuilder |
appointmentType(String appointmentType) |
FreeSlotQueryResultBuilder |
appointmentType(UUID appointmentType) |
IAppointmentFreeSlotQueryResult |
build()
Creates the free slots from the data of this builder.
|
static IAppointmentFreeSlotQueryResult |
empty() |
static IAppointmentFreeSlotQueryResult |
emptyWithZone(ZoneId zoneId) |
public FreeSlotQueryResultBuilder(ZoneId targetZone)
targetZone
- Zone ID in which the results are returned.public FreeSlotQueryResultBuilder addBlocker(Instant instantFrom, Instant instantUntil)
instantFrom
- Start date and time of the blocker.instantUntil
- End date and time of the blocker.public FreeSlotQueryResultBuilder addFreeSlot(com.google.common.collect.Range<ZonedDateTime> range, long capacity)
range
- Start and end time of the slot.capacity
- Capacity of the slot.public FreeSlotQueryResultBuilder appointmentType(AppointmentType appointmentType)
appointmentType
- The appointment type for which the appointment slots are meant for.public FreeSlotQueryResultBuilder appointmentType(String appointmentType)
appointmentType
- The appointment type for which the appointment slots are meant for.public FreeSlotQueryResultBuilder appointmentType(UUID appointmentType)
appointmentType
- The appointment type for which the appointment slots are meant for.public IAppointmentFreeSlotQueryResult build()
public static IAppointmentFreeSlotQueryResult empty()
public static IAppointmentFreeSlotQueryResult emptyWithZone(ZoneId zoneId)
zoneId
- Zone ID to set on the result (IAppointmentFreeSlotQueryResult.getZoneId()
). As no times are
returned, this has no effect.Copyright © 2021 XIMA MEDIA GmbH. All rights reserved.