Interface AppointmentRequest

All Superinterfaces:
AppointmentData

public interface AppointmentRequest extends AppointmentData
Class holding the full details of an appointment request. Note that an appointment request is NOT an appointment but only an expression of intent! The AppointmentRequest is not input for the external API, but it is returned when removing Appointment(s). The idea is that, based on the AppointmentRequest of the removed Appointment, the appointment could be rescheduled. The AppointmentRequest is mainly used internally in the TimeLine, when an actual appointment is created. The AppointmentRequest holds LocalTime startTime, AppointmentData and TimePreference. Normally, either startTime or TimePreference is not null. If no TimePreference is set, it defaults to TimePreference.UNSPECIFIED. An AppointmentRequest with no startTime defined and with TimePreference UNSPECIFIED means that the invoker does not have any preference regarding time. It's up to the addAppointment method to decide how to deal with such a request.
Author:
Pieter van den Hombergh, Richard van den Ham
  • Method Details

    • getStart

      default Instant getStart(LocalDay onDay)
      Get the start time of the intended appointment. If the time is not specified, this method may return null.
      Parameters:
      onDay - the LocalDay the time is on.
      Returns:
      the start time as instant, potentially null.
    • getStartTime

      LocalTime getStartTime()
      Get the requested local start time.
      Returns:
      the start time
    • getAppointmentData

      AppointmentData getAppointmentData()
      Get the appointment details of this appointment.
      Returns:
      the data
    • getTimePreference

      default TimePreference getTimePreference()
      Time preference given with this appointment request. The default is TimePreference.UNSPECIFIED.
      Returns:
      the time preference
    • getDuration

      default Duration getDuration()
      Get the duration of the appointment request.
      Specified by:
      getDuration in interface AppointmentData
      Returns:
      the duration of the request
    • equals

      boolean equals(Object obj)
      Defines equality, must be based on all fields of this class.
      Specified by:
      equals in interface AppointmentData
      Overrides:
      equals in class Object
      Parameters:
      obj - the other object to check equality with
      Returns:
      true if the two appointments are equal
    • hashCode

      int hashCode()
      Calculate a hash code value for the object.
      Specified by:
      hashCode in interface AppointmentData
      Overrides:
      hashCode in class Object
      Returns:
      hashCode for this object.