MCPcopy
hub / github.com/careercup/ctci / addUser

Method addUser

java/Chapter 8/Question8_5/UserManager.java:8–15  ·  view source on GitHub ↗
(int id, String details, int accountType)

Source from the content-addressed store, hash-verified

6 private Hashtable<Integer, User> users;
7
8 public User addUser(int id, String details, int accountType) {
9 if (users.containsKey(id)) {
10 return null;
11 }
12 User user = new User(id, details, accountType);
13 users.put(id, user);
14 return user;
15 }
16
17 public boolean remove(User u) {
18 return remove(u.getID());

Callers

nothing calls this directly

Calls 1

putMethod · 0.80

Tested by

no test coverage detected