Skip to content

Commit

Permalink
created findByEmail method
Browse files Browse the repository at this point in the history
  • Loading branch information
xli1iax committed Jul 20, 2024
1 parent 1c10ef6 commit eb0dac0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/mate/academy/service/UserService.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ public class UserService {
* Return <code>null</code> if there is no suitable user
*/
public User findByEmail(String email) {
for (User i: users) {
if (i.getEmail().equals(email)) {
return i;
}
}
return null;
}
}

0 comments on commit eb0dac0

Please sign in to comment.