Record Class ConsultationDTO
java.lang.Object
java.lang.Record
com.mirna.hospitalmanagementapi.domain.dtos.consultation.ConsultationDTO
public record ConsultationDTO(Long doctorId, @NotNull(message="patient id cannot be null") Long patientId, @NotNull(message="consultation date cannot be null") @Future LocalDateTime consultationDate, Specialty specialty)
extends Record
Data transfer object used to transfer data that will be saved in a Consultation entity
- Version:
- 1.0
- Author:
- Mirna Gama
-
Constructor Summary
ConstructorsConstructorDescriptionConsultationDTO(Long doctorId, @NotNull(message="patient id cannot be null") Long patientId, @NotNull(message="consultation date cannot be null") @Future LocalDateTime consultationDate, Specialty specialty) Creates an instance of aConsultationDTOrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull(message="consultation date cannot be null") @Future LocalDateTimeReturns the value of theconsultationDaterecord component.doctorId()Returns the value of thedoctorIdrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NotNull(message="patient id cannot be null") LongReturns the value of thepatientIdrecord component.Returns the value of thespecialtyrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ConsultationDTO
public ConsultationDTO(Long doctorId, @NotNull(message="patient id cannot be null") @NotNull(message="patient id cannot be null") Long patientId, @NotNull(message="consultation date cannot be null") @Future @NotNull(message="consultation date cannot be null") @Future LocalDateTime consultationDate, Specialty specialty) Creates an instance of aConsultationDTOrecord class.- Parameters:
doctorId- the value for thedoctorIdrecord componentpatientId- the value for thepatientIdrecord componentconsultationDate- the value for theconsultationDaterecord componentspecialty- the value for thespecialtyrecord component
-
-
Method Details
-
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. -
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. -
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). -
doctorId
Returns the value of thedoctorIdrecord component.- Returns:
- the value of the
doctorIdrecord component
-
patientId
@NotNull(message="patient id cannot be null") public @NotNull(message="patient id cannot be null") Long patientId()Returns the value of thepatientIdrecord component.- Returns:
- the value of the
patientIdrecord component
-
consultationDate
@NotNull(message="consultation date cannot be null") @Future @ConsultationDateScheduledInAdvance @ConsultationDateBusinessHours public @NotNull(message="consultation date cannot be null") @Future LocalDateTime consultationDate()Returns the value of theconsultationDaterecord component.- Returns:
- the value of the
consultationDaterecord component
-
specialty
Returns the value of thespecialtyrecord component.- Returns:
- the value of the
specialtyrecord component
-