Record Class PostCommentSummaryDTO
java.lang.Object
java.lang.Record
com.example.blogs.app.api.post.dto.PostCommentSummaryDTO
public record PostCommentSummaryDTO(Long id, String content, PostUserSummaryDTO author, LocalDateTime updatedAt, LocalDateTime createdAt, boolean edited)
extends Record
Data transfer object representing a summary of a comment on a post.
-
Constructor Summary
ConstructorsConstructorDescriptionPostCommentSummaryDTO(Long id, String content, PostUserSummaryDTO author, LocalDateTime updatedAt, LocalDateTime createdAt, boolean edited) Creates an instance of aPostCommentSummaryDTOrecord class. -
Method Summary
Modifier and TypeMethodDescriptionauthor()Returns the value of theauthorrecord component.content()Returns the value of thecontentrecord component.Returns the value of thecreatedAtrecord component.booleanedited()Returns the value of theeditedrecord 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.final StringtoString()Returns a string representation of this record class.Returns the value of theupdatedAtrecord component.
-
Constructor Details
-
PostCommentSummaryDTO
public PostCommentSummaryDTO(Long id, String content, PostUserSummaryDTO author, LocalDateTime updatedAt, LocalDateTime createdAt, boolean edited) Creates an instance of aPostCommentSummaryDTOrecord class.- Parameters:
id- the value for theidrecord componentcontent- the value for thecontentrecord componentauthor- the value for theauthorrecord componentupdatedAt- the value for theupdatedAtrecord componentcreatedAt- the value for thecreatedAtrecord componentedited- the value for theeditedrecord 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
content
Returns the value of thecontentrecord component.- Returns:
- the value of the
contentrecord component
-
author
Returns the value of theauthorrecord component.- Returns:
- the value of the
authorrecord component
-
updatedAt
Returns the value of theupdatedAtrecord component.- Returns:
- the value of the
updatedAtrecord component
-
createdAt
Returns the value of thecreatedAtrecord component.- Returns:
- the value of the
createdAtrecord component
-
edited
public boolean edited()Returns the value of theeditedrecord component.- Returns:
- the value of the
editedrecord component
-