Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
Library
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bassel Dib
Library
Commits
16f42ee8
Commit
16f42ee8
authored
11 months ago
by
Bassel Dib
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
acbfdc36
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/example/Book.java
+63
-0
63 additions, 0 deletions
src/main/java/org/example/Book.java
with
63 additions
and
0 deletions
src/main/java/org/example/Book.java
0 → 100644
+
63
−
0
View file @
16f42ee8
package
org.example
;
public
class
Book
{
private
String
title
;
private
String
author
;
private
String
dateOfPublicationtesttestest
;
private
String
summery
;
private
String
content
;
public
int
likeCount
;
public
int
readCount
;
public
Book
(){
}
public
Book
(
String
aTitle
,
String
aAuther
,
String
aDateOfPublication
,
String
aSummery
,
String
aContent
){
title
=
aTitle
;
author
=
aAuther
;
dateOfPublicationtesttestest
=
aDateOfPublication
;
summery
=
aSummery
;
content
=
aContent
;
likeCount
=
0
;
readCount
=
0
;
//count++; //number of created books, out also Booklist.size() in library has it
}
/* to add one more like/read to a single book instance from Customer class */
public
void
increaseBookLikes
(
Book
obj
){
obj
.
likeCount
++;
}
public
void
increaseBookRead
(
Book
obj
){
obj
.
readCount
++;
}
@Override
public
String
toString
()
{
return
"Book{ "
+
"title='"
+
title
+
'\''
+
", author='"
+
author
+
'\''
+
", dateOfPublication='"
+
dateOfPublicationtesttestest
+
'\''
+
", summery='"
+
summery
+
'\''
+
", content='"
+
content
+
'\''
+
'}'
;
}
public
int
getLikeCount
(){
return
likeCount
;
}
public
int
getReadCount
()
{
return
readCount
;
}
public
String
getTitle
()
{
return
title
;
}
public
String
getAuthor
()
{
return
author
;
}
public
String
getDateOfPublication
()
{
return
dateOfPublicationtesttestest
;
}
public
String
getSummery
()
{
return
summery
;
}
public
String
getContent
()
{
return
content
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment