/** * @see java.lang.Object#equals(java.lang.Object) */ @Override public boolean equals(final Object obj) { if (obj == null) { return false; } if (!(obj instanceof User)) { return false; } return id.equals(((User) obj).getId()); }
/** * @see java.lang.Object#toString() */ @Override public String toString() { return "User#" + hashCode() + "[id=[" + id + "], displayName=[" + displayName + "], admin=[" + admin + "], language=[" + language + "]]"; }
User tmp = daoService.getUser(user.getId()); if (tmp == null) { information.setInformationKey("INSERT_DATE"); information.setInformationValue(getDateTime()); List<Information> informations = user.getInformations(); if (informations == null) { informations = new ArrayList<Information>(); user.setInformations(informations); daoService.addUser(user); information.setInformationKey("UPDATE_DATE"); information.setInformationValue(getDateTime()); List<Information> informations = user.getInformations(); if (informations == null) { informations = new ArrayList<Information>(); informations.addAll(tmp.getInformations()); informations.add(information); user.setInformations(informations); daoService.updateUser(user);
/** * @return the current user's locale. */ @Override public Locale getCurrentUserLocale() { if (logger.isDebugEnabled()) { logger.debug(this.getClass().getName() + ".getCurrentUserLocale()"); } User currentUser = getCurrentUser(); if (currentUser == null) { if (logger.isDebugEnabled()) { logger.debug("no current user, return null"); } return null; } String lang = currentUser.getLanguage(); if (lang == null) { if (logger.isDebugEnabled()) { logger.debug("language not set for user '" + currentUser.getId() + "', return null"); } return null; } Locale locale = new Locale(lang); if (logger.isDebugEnabled()) { logger.debug("language for user '" + currentUser.getId() + "' is '" + locale + "'"); } return locale; }