Record Class EventPostDTO
java.lang.Object
java.lang.Record
io.github.navjotsrakhra.eventmanager.dataModel.dto.EventPostDTO
public record EventPostDTO(Long ID, String title, String content, String location, LocalDate startDay, LocalDate endDay, LocalTime startTime, LocalTime endTime)
extends Record
The EventPostDTO class represents an exposed version of an EventPost, providing a simplified interface for creating event posts.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncontent()Returns the value of thecontentrecord component.endDay()Returns the value of theendDayrecord component.endTime()Returns the value of theendTimerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.ID()Returns the value of theIDrecord component.location()Returns the value of thelocationrecord component.startDay()Returns the value of thestartDayrecord component.Returns the value of thestartTimerecord component.title()Returns the value of thetitlerecord component.Converts this EventPostRecord to an EventPost object.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
EventPostDTO
public EventPostDTO(Long ID, String title, String content, String location, LocalDate startDay, LocalDate endDay, LocalTime startTime, LocalTime endTime) Creates an instance of aEventPostDTOrecord class.- Parameters:
ID- the value for theIDrecord componenttitle- the value for thetitlerecord componentcontent- the value for thecontentrecord componentlocation- the value for thelocationrecord componentstartDay- the value for thestartDayrecord componentendDay- the value for theendDayrecord componentstartTime- the value for thestartTimerecord componentendTime- the value for theendTimerecord component
-
-
Method Details
-
toEventPost
Converts this EventPostRecord to an EventPost object.- Returns:
- EventPost object created from the EventPostRecord.
- Throws:
DateValidationFailedException- if date validation fails.
-
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). -
ID
Returns the value of theIDrecord component.- Returns:
- the value of the
IDrecord component
-
title
Returns the value of thetitlerecord component.- Returns:
- the value of the
titlerecord component
-
content
Returns the value of thecontentrecord component.- Returns:
- the value of the
contentrecord component
-
location
Returns the value of thelocationrecord component.- Returns:
- the value of the
locationrecord component
-
startDay
Returns the value of thestartDayrecord component.- Returns:
- the value of the
startDayrecord component
-
endDay
Returns the value of theendDayrecord component.- Returns:
- the value of the
endDayrecord component
-
startTime
Returns the value of thestartTimerecord component.- Returns:
- the value of the
startTimerecord component
-
endTime
Returns the value of theendTimerecord component.- Returns:
- the value of the
endTimerecord component
-