Record Class DoctorPublicDataDTO
java.lang.Object
java.lang.Record
com.mirna.hospitalmanagementapi.domain.dtos.DoctorPublicDataDTO
public record DoctorPublicDataDTO(String name, String email, String crm, Specialty specialty)
extends Record
Data transfer object used to format and display only the public data allowed for Doctor entity
- Version:
- 1.0
- Author:
- Mirna Gama
-
Constructor Summary
ConstructorsConstructorDescriptionDoctorPublicDataDTO(Doctor doctor) DoctorPublicDataDTO(String name, String email, String crm, Specialty specialty) Creates an instance of aDoctorPublicDataDTOrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncrm()Returns the value of thecrmrecord component.email()Returns the value of theemailrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.Returns the value of thespecialtyrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DoctorPublicDataDTO
-
DoctorPublicDataDTO
Creates an instance of aDoctorPublicDataDTOrecord class.- Parameters:
name- the value for thenamerecord componentemail- the value for theemailrecord componentcrm- the value for thecrmrecord 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). -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
email
Returns the value of theemailrecord component.- Returns:
- the value of the
emailrecord component
-
crm
Returns the value of thecrmrecord component.- Returns:
- the value of the
crmrecord component
-
specialty
Returns the value of thespecialtyrecord component.- Returns:
- the value of the
specialtyrecord component
-