From 875c7b1df41ca47049da2a869ef51f38374cd406 Mon Sep 17 00:00:00 2001 From: Struchkov Mark Date: Fri, 17 Jun 2022 16:50:20 +0300 Subject: [PATCH] person -> people --- .../controlleradvice/service/PersonService.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/dev/struchkov/example/controlleradvice/service/PersonService.java b/src/main/java/dev/struchkov/example/controlleradvice/service/PersonService.java index 575d458..f669311 100644 --- a/src/main/java/dev/struchkov/example/controlleradvice/service/PersonService.java +++ b/src/main/java/dev/struchkov/example/controlleradvice/service/PersonService.java @@ -12,25 +12,25 @@ import java.util.UUID; @Service public class PersonService { - private final Map persons = new HashMap<>(); + private final Map people = new HashMap<>(); public PersonService() { final UUID komarId = UUID.randomUUID(); - persons.put(komarId, new Person(komarId, "komar", "Алексей", "ertyuiop")); + people.put(komarId, new Person(komarId, "komar", "Алексей", "ertyuiop")); } public Person getByLoginOrThrown(@NonNull String login) { - return persons.values().stream() + return people.values().stream() .filter(person -> person.getLogin().equals(login)) .findFirst() .orElseThrow(); } public Person getByIdOrThrown(@NonNull UUID id) { - if (!persons.containsKey(id)) { + if (!people.containsKey(id)) { throw new NotFoundException("Пользователь не найден"); } - return persons.get(id); + return people.get(id); } }