Record Class CreateHolidayDto
java.lang.Object
java.lang.Record
com.app.controller.dto.holiday.CreateHolidayDto
- Record Components:
startDate
- the start date and time of the holidayendDate
- the end date and time of the holiday
Data Transfer Object (DTO) used to create a new holiday request.
Contains the start and end dates of the holiday.
-
Constructor Summary
ConstructorsConstructorDescriptionCreateHolidayDto
(LocalDateTime startDate, LocalDateTime endDate) Creates an instance of aCreateHolidayDto
record class. -
Method Summary
Modifier and TypeMethodDescriptionendDate()
Returns the value of theendDate
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of thestartDate
record component.toEntity()
Converts this DTO into aHolidayEntity
.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
toEntity
Converts this DTO into aHolidayEntity
. Sets the status of the holiday toStatus.PROCESSING
by default.- Returns:
- a new instance of
HolidayEntity
based on this DTO
-
toString
-
hashCode
-
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)
. -
startDate
-
endDate
-