-
Notifications
You must be signed in to change notification settings - Fork 1
feat(task_1): create the "Greeting" feature #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: AlexanderEnin
Are you sure you want to change the base?
Conversation
|
|
||
| public String greet() { | ||
| long openTasksCount = | ||
| this.todoService.getAllTodos().stream().filter(task -> !task.completed()).count(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to use "this" inside method. this makes sense only in constructor to differ it from constructor parameter
Ref for convention:
https://docs.oracle.com/javase/tutorial/java/javaOO/thiskey.html#:~:text=Within%20an%20instance%20method%20or,a%20constructor%20by%20using%20this%20.
| long openTasksCount = | ||
| this.todoService.getAllTodos().stream().filter(task -> !task.completed()).count(); | ||
|
|
||
| return String.format("Hello from Spring! You have %d open tasks.", openTasksCount); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you think can we also handle plural/singular form of "task" ? 1 task, 2 tasks e.t.c.
IgorGursky
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All great
No description provided.