Package pojos
Class Book
java.lang.Object
pojos.Book
Represents a Book entity with id, title, and author.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the author of the book.int
getId()
Gets the id of the book.getTitle()
Gets the title of the book.void
Sets the author of the book.void
setId
(int id) Sets the id of the book.void
Sets the title of the book.toString()
Returns a string representation of the Book.
-
Constructor Details
-
Book
public Book()Default constructor for Book. -
Book
Constructs a Book with the specified title and author.- Parameters:
title
- the title of the bookauthor
- the author of the book
-
Book
Constructs a Book with the specified id, title, and author.- Parameters:
id
- the id of the booktitle
- the title of the bookauthor
- the author of the book
-
-
Method Details
-
getId
public int getId()Gets the id of the book.- Returns:
- the id
-
setId
public void setId(int id) Sets the id of the book.- Parameters:
id
- the id to set
-
getTitle
Gets the title of the book.- Returns:
- the title
-
setTitle
Sets the title of the book.- Parameters:
title
- the title to set
-
getAuthor
Gets the author of the book.- Returns:
- the author
-
setAuthor
Sets the author of the book.- Parameters:
author
- the author to set
-
toString
Returns a string representation of the Book.
-