Record Class AppointmentData

java.lang.Object
java.lang.Record
cz.cuni.kubinja.hospitalsystem.calendar.util.AppointmentData
Record Components:
patientsId - Identifier of patient connected to the appointment.
doctorsId - Identifier of doctor connected to the appointment.
starTime - Starting time of the appointment.
endTime - Ending time of the appointment.

public record AppointmentData(int patientsId, int doctorsId, LocalDateTime starTime, LocalDateTime endTime) extends Record
Data wrapper for appointment.
  • Constructor Details

    • AppointmentData

      public AppointmentData(int patientsId, int doctorsId, LocalDateTime starTime, LocalDateTime endTime)
      Creates an instance of a AppointmentData record class.
      Parameters:
      patientsId - the value for the patientsId record component
      doctorsId - the value for the doctorsId record component
      starTime - the value for the starTime record component
      endTime - the value for the endTime record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • patientsId

      public int patientsId()
      Returns the value of the patientsId record component.
      Returns:
      the value of the patientsId record component
    • doctorsId

      public int doctorsId()
      Returns the value of the doctorsId record component.
      Returns:
      the value of the doctorsId record component
    • starTime

      public LocalDateTime starTime()
      Returns the value of the starTime record component.
      Returns:
      the value of the starTime record component
    • endTime

      public LocalDateTime endTime()
      Returns the value of the endTime record component.
      Returns:
      the value of the endTime record component