// sorting @Override public String getOnlineUsersInAlphabeticalOrder() { String users = ""; for (UserModel user : this.users.values()) { if (user.isOnline()) { users += String.format("* %s", user.getUserName()); } } return users; }
@Override public synchronized void readUsers() { for (String userPropertyKey : config.listKeys()) { UserProperty property = new UserProperty(userPropertyKey, config.getString(userPropertyKey)); UserModel user = getUser(property.getUsername()); if (user == null) user = new UserModel(property.getUsername()); PropertyMapper mapper = new PropertyMapper<UserModel>(user); mapper.map(property.getPropertyName(), property.getPropertyValue()); users.put(user.getUserName(), user); } }