Skip to content

Commit

Permalink
Update BookDto.java
Browse files Browse the repository at this point in the history
here did some changes in BookDto.java 
includesde keyword for better access
  • Loading branch information
Tanisha0708 authored Nov 2, 2024
1 parent 664b333 commit d23edff
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/main/java/com/libraryman_api/book/BookDto.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.libraryman_api.book;

public class BookDto {


private int bookId;
private String title;
private String author;
Expand All @@ -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;
Expand All @@ -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() {
Expand Down Expand Up @@ -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{" +
Expand All @@ -101,6 +109,7 @@ public String toString() {
", publishedYear=" + publishedYear +
", genre='" + genre + '\'' +
", copiesAvailable=" + copiesAvailable +
", keyword='" + keyword + '\'' +
'}';
}
}

0 comments on commit d23edff

Please sign in to comment.