Skip to content

Commit b53aaef

Browse files
committed
reformatting
1 parent b270e8b commit b53aaef

File tree

1 file changed

+31
-28
lines changed

1 file changed

+31
-28
lines changed

src/main/java/org/javaee7/sample/PersonDatabase.java

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,36 @@
99

1010
@Singleton
1111
public class PersonDatabase {
12-
List<String> persons;
13-
14-
@PostConstruct
15-
public void init() {
16-
persons = Arrays.asList("Penny", "Leonard", "Sheldon", "Amy", "Howard", "Bernadette", "Raj", "Priya");
17-
}
18-
19-
public List<String> currentList() {
20-
return persons;
21-
}
22-
23-
public String getPerson(int id) {
24-
if (id < persons.size())
25-
return persons.get(id);
26-
27-
throw new NotFoundException("Person with id \"" + id + "\" not found.");
28-
}
29-
30-
public void addPerson(String name) {
31-
persons.add(name);
32-
}
33-
34-
public void deletePerson(String name) {
35-
if (persons.contains(name))
36-
persons.remove(name);
37-
38-
throw new NotFoundException("Person with name \"" + name + "\" not found.");
39-
}
12+
13+
List<String> persons;
14+
15+
@PostConstruct
16+
public void init() {
17+
persons = Arrays.asList("Penny", "Leonard", "Sheldon", "Amy", "Howard", "Bernadette", "Raj", "Priya");
18+
}
19+
20+
public List<String> currentList() {
21+
return persons;
22+
}
23+
24+
public String getPerson(int id) {
25+
if (id < persons.size()) {
26+
return persons.get(id);
27+
}
28+
29+
throw new NotFoundException("Person with id \"" + id + "\" not found.");
30+
}
31+
32+
public void addPerson(String name) {
33+
persons.add(name);
34+
}
35+
36+
public void deletePerson(String name) {
37+
if (persons.contains(name)) {
38+
persons.remove(name);
39+
}
40+
41+
throw new NotFoundException("Person with name \"" + name + "\" not found.");
42+
}
4043

4144
}

0 commit comments

Comments
 (0)