-
Notifications
You must be signed in to change notification settings - Fork 918
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
Implementation of solution for jv-oop-lesson-0 #1118
base: master
Are you sure you want to change the base?
Conversation
if (user != null && user.getPassword().equals(password)) { | ||
return true; | ||
} else { | ||
return false; | ||
} |
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.
if (user != null && user.getPassword().equals(password)) { | |
return true; | |
} else { | |
return false; | |
} | |
return user != null && user.getPassword().equals(password); |
public User findByEmail(String email) { | ||
return null; | ||
return Arrays.stream(users) |
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.
stream works slower than for each, so for this particular task you can use for each loop
@@ -11,6 +15,11 @@ public class AuthenticationService { | |||
* Return false in any other cases. | |||
*/ | |||
public boolean login(String email, String password) { | |||
return false; | |||
User user = userService.findByEmail(email); | |||
if (user != null && user.getPassword().equals(password)) { |
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.
if (user != null && user.getPassword().equals(password)) { | |
return user != null && user.getPassword().equals(password); |
No description provided.