public static Object fromPersistenceType ( Object value , Class < ? > parameterType ) { if ( ! isTypeConversionRequired ( parameterType ) ) { return value ; } if ( Map . class . isAssignableFrom ( parameterType ) && ( value instanceof String [ ] ) ) { String [ ] rows = ( String [ ] ) value ; Map < String , String > map = new LinkedHashMap <> ( ) ; for ( int i = 0 ; i < rows . length ; i ++ ) { String [ ] keyValue = ConversionStringUtils . splitPreserveAllTokens ( rows [ i ] , KEY_VALUE_DELIMITER . charAt ( 0 ) ) ; if ( keyValue . length == 2 && StringUtils . isNotEmpty ( keyValue [ 0 ] ) ) { String entryKey = keyValue [ 0 ] ; String entryValue = StringUtils . isEmpty ( keyValue [ 1 ] ) ? null : keyValue [ 1 ] ; map . put ( ConversionStringUtils . decodeString ( entryKey ) , ConversionStringUtils . decodeString ( entryValue ) ) ; } } return map ; } throw new IllegalArgumentException ( "Type conversion not supported: " + parameterType . getName ( ) ) ; }
Convert object from persistence to be used in configuration .