Package pojos

Class Book

java.lang.Object
pojos.Book

public class Book extends Object
Represents a Book entity with id, title, and author.
  • Constructor Details

    • Book

      public Book()
      Default constructor for Book.
    • Book

      public Book(String title, String author)
      Constructs a Book with the specified title and author.
      Parameters:
      title - the title of the book
      author - the author of the book
    • Book

      public Book(int id, String title, String author)
      Constructs a Book with the specified id, title, and author.
      Parameters:
      id - the id of the book
      title - the title of the book
      author - 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

      public String getTitle()
      Gets the title of the book.
      Returns:
      the title
    • setTitle

      public void setTitle(String title)
      Sets the title of the book.
      Parameters:
      title - the title to set
    • getAuthor

      public String getAuthor()
      Gets the author of the book.
      Returns:
      the author
    • setAuthor

      public void setAuthor(String author)
      Sets the author of the book.
      Parameters:
      author - the author to set
    • toString

      public String toString()
      Returns a string representation of the Book.
      Overrides:
      toString in class Object
      Returns:
      string representation