private ClientApiUser toClientApi(User user) {
return toClientApi(user, null);
}
private ClientApiUser toClientApi(User user, Map<String, String> workspaceNames) {
ClientApiUser u = new ClientApiUser();
u.setId(user.getUserId());
u.setUserName(user.getUsername());
u.setDisplayName(user.getDisplayName());
u.setStatus(user.getUserStatus());
u.setUserType(user.getUserType());
u.setEmail(user.getEmailAddress());
u.setCurrentWorkspaceId(user.getCurrentWorkspaceId());
if (workspaceNames != null) {
String workspaceName = workspaceNames.get(user.getCurrentWorkspaceId());
u.setCurrentWorkspaceName(workspaceName);
}
return u;
}