public void convertAndAdd ( final CommonProfile profile , final AttributeLocation attributeLocation , final String name , final Object value ) { if ( value != null ) { final Object convertedValue ; final AttributeConverter < ? extends Object > converter = this . converters . get ( name ) ; if ( converter != null ) { convertedValue = converter . convert ( value ) ; if ( convertedValue != null ) { logger . debug ( "converted to => key: {} / value: {} / {}" , name , convertedValue , convertedValue . getClass ( ) ) ; } } else { convertedValue = value ; logger . debug ( "no conversion => key: {} / value: {} / {}" , name , convertedValue , convertedValue . getClass ( ) ) ; } if ( attributeLocation . equals ( AUTHENTICATION_ATTRIBUTE ) ) { profile . addAuthenticationAttribute ( name , convertedValue ) ; } else { profile . addAttribute ( name , convertedValue ) ; } } }
Convert a profile or authentication attribute if necessary and add it to the profile .