public class Book extends Object
Modifier and Type | Field | Description |
---|---|---|
private String |
author |
The person who wrote the book.
|
private int |
categoryId |
An identifier for the book's category
|
private String |
genre |
The genre (or type).
|
private int |
id |
The unique id.
|
private String |
title |
The title.
|
Constructor | Description |
---|---|
Book(int id,
String title,
String author,
String genre,
int categoryId) |
Creates a book without a book id.
|
Book(String title,
String author,
String genre,
int categoryId) |
Creates a book without a book id.
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
equals(Object o) |
|
String |
getAuthor() |
|
int |
getCategoryId() |
|
String |
getGenre() |
|
int |
getId() |
|
String |
getTitle() |
|
int |
hashCode() |
|
void |
setAuthor(String author) |
|
void |
setCategoryId(int categoryId) |
|
void |
setGenre(String genre) |
|
void |
setId(int id) |
|
void |
setTitle(String title) |
|
String |
toString() |
private int id
private String title
private String author
private String genre
private int categoryId
public Book(String title, String author, String genre, int categoryId)
title
- the book title.author
- the person who wrote the book.genre
- the genre of the book.categoryId
- an identifier for the book's categorypublic Book(int id, String title, String author, String genre, int categoryId)
id
- the unique id of the book.title
- the book title.author
- the person who wrote the book.genre
- the genre of the book.categoryId
- an identifier for the book's categorypublic int getId()
public void setId(int id)
public String getTitle()
public void setTitle(String title)
public String getAuthor()
public void setAuthor(String author)
public String getGenre()
public void setGenre(String genre)
public int getCategoryId()
public void setCategoryId(int categoryId)