-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2f7dd0c
commit 1ac26a5
Showing
4 changed files
with
30 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/com/github/travelervihaan/hogwarts/noticeboard/reaction/CommentResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package com.github.travelervihaan.hogwarts.noticeboard.reaction; | ||
|
||
class CommentResponse extends VoteResponse{ | ||
class CommentResponse extends VoteResponse { | ||
} |
3 changes: 3 additions & 0 deletions
3
src/main/java/com/github/travelervihaan/hogwarts/noticeboard/reaction/Response.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
package com.github.travelervihaan.hogwarts.noticeboard.reaction; | ||
|
||
public interface Response { | ||
|
||
void vote(boolean vote); | ||
|
||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/com/github/travelervihaan/hogwarts/noticeboard/reaction/VoteResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,19 @@ | ||
package com.github.travelervihaan.hogwarts.noticeboard.reaction; | ||
|
||
class VoteResponse implements Response { | ||
|
||
private Vote vote; | ||
|
||
@Override | ||
public void vote(boolean vote) { | ||
this.vote = vote ? Vote.UP : Vote.DOWN; | ||
} | ||
|
||
public Vote getVote() { | ||
return vote; | ||
} | ||
|
||
public void setVote(Vote vote) { | ||
this.vote = vote; | ||
} | ||
} |