Record Class PostCreateResponseDTO
java.lang.Object
java.lang.Record
com.example.blogs.app.api.post.dto.PostCreateResponseDTO
public record PostCreateResponseDTO(Long id, String title, String description, String content, String slug, String previewImageUrl, LocalDateTime createdAt)
extends Record
Response data transfer object containing created post details with ID, slug, and preview image URL.
-
Constructor Summary
ConstructorsConstructorDescriptionPostCreateResponseDTO(Long id, String title, String description, String content, String slug, String previewImageUrl, LocalDateTime createdAt) Creates an instance of aPostCreateResponseDTOrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncontent()Returns the value of thecontentrecord component.Returns the value of thecreatedAtrecord component.Returns the value of thedescriptionrecord 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.Returns the value of thepreviewImageUrlrecord component.slug()Returns the value of theslugrecord component.title()Returns the value of thetitlerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PostCreateResponseDTO
public PostCreateResponseDTO(Long id, String title, String description, String content, String slug, String previewImageUrl, LocalDateTime createdAt) Creates an instance of aPostCreateResponseDTOrecord class.- Parameters:
id- the value for theidrecord componenttitle- the value for thetitlerecord componentdescription- the value for thedescriptionrecord componentcontent- the value for thecontentrecord componentslug- the value for theslugrecord componentpreviewImageUrl- the value for thepreviewImageUrlrecord componentcreatedAt- the value for thecreatedAtrecord 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). -
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
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
content
Returns the value of thecontentrecord component.- Returns:
- the value of the
contentrecord component
-
slug
Returns the value of theslugrecord component.- Returns:
- the value of the
slugrecord component
-
previewImageUrl
Returns the value of thepreviewImageUrlrecord component.- Returns:
- the value of the
previewImageUrlrecord component
-
createdAt
Returns the value of thecreatedAtrecord component.- Returns:
- the value of the
createdAtrecord component
-