private Users getCloudUsers(List<Map<String, Object>> allResources) { Users user = new Users(); for (Map<String, Object> resource : allResources) { user.addCloudUsers(getCloudUser(resource)); } return user; }
public Users getAllUsers() { Map<String, Object> respMap = clientService.getResponseMap(USERS_API_URI); Integer totalUsersCount = clientService.getTotalResults(respMap); List<Map<String, Object>> allResources = clientService.getAllResources(respMap); Users users = getCloudUsers(allResources); users.setTotalUsers(totalUsersCount); return users; }