public void set ( final String _key , final String _value , final UserAttributesDefinition _definition ) throws EFapsException { if ( _key == null || _value == null ) { throw new EFapsException ( this . getClass ( ) , "set" , _key , _value , _definition ) ; } else { final UserAttribute userattribute = this . attributes . get ( _key ) ; if ( userattribute == null ) { this . attributes . put ( _key , new UserAttribute ( _definition . name , _value . trim ( ) , true ) ) ; } else if ( ! userattribute . getValue ( ) . equals ( _value . trim ( ) ) ) { userattribute . setUpdate ( true ) ; userattribute . setValue ( _value . trim ( ) ) ; } } }
Sets a key - value pair into the attribute set of an user . The method will search for the key and if the key already exists it will update the user attribute in this set . If the key does not exist a new user attribute will be added to this set .