From d23edff16b84d0b12aa3478058bba4edc479e79a Mon Sep 17 00:00:00 2001 From: Tanisha Chavan <151942801+Tanisha0708@users.noreply.github.com> Date: Sat, 2 Nov 2024 14:54:53 +0530 Subject: [PATCH] Update BookDto.java here did some changes in BookDto.java includesde keyword for better access --- .../java/com/libraryman_api/book/BookDto.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/libraryman_api/book/BookDto.java b/src/main/java/com/libraryman_api/book/BookDto.java index e6e480d..500cb68 100644 --- a/src/main/java/com/libraryman_api/book/BookDto.java +++ b/src/main/java/com/libraryman_api/book/BookDto.java @@ -1,8 +1,6 @@ package com.libraryman_api.book; public class BookDto { - - private int bookId; private String title; private String author; @@ -11,8 +9,9 @@ public class BookDto { private int publishedYear; private String genre; private int copiesAvailable; + private String keyword; // Define the keyword variable - public BookDto(int bookId, String title, String author, String isbn, String publisher, int publishedYear, String genre, int copiesAvailable) { + public BookDto(int bookId, String title, String author, String isbn, String publisher, int publishedYear, String genre, int copiesAvailable, String keyword) { this.bookId = bookId; this.title = title; this.author = author; @@ -21,6 +20,7 @@ public BookDto(int bookId, String title, String author, String isbn, String publ this.publishedYear = publishedYear; this.genre = genre; this.copiesAvailable = copiesAvailable; + this.keyword = keyword; } public BookDto() { @@ -90,6 +90,14 @@ public void setCopiesAvailable(int copiesAvailable) { this.copiesAvailable = copiesAvailable; } + public String getKeyword() { // Changed method name to camelCase and corrected return type + return keyword; + } + + public void setKeyword(String keyword) { // Added a setter for keyword + this.keyword = keyword; + } + @Override public String toString() { return "BookDto{" + @@ -101,6 +109,7 @@ public String toString() { ", publishedYear=" + publishedYear + ", genre='" + genre + '\'' + ", copiesAvailable=" + copiesAvailable + + ", keyword='" + keyword + '\'' + '}'; } }