package com.magamochi.content.model.dto; import com.magamochi.content.model.entity.MangaContent; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotNull; public record MangaContentDTO( @NotNull Long id, @NotBlank String title, @NotNull Boolean downloaded, @NotNull Boolean isRead, LanguageDTO language) { public static MangaContentDTO from(MangaContent mangaContent) { return new MangaContentDTO( mangaContent.getId(), mangaContent.getTitle(), mangaContent.getDownloaded(), false, LanguageDTO.from(mangaContent.getLanguage())); } }