public static Map<String, String> convertToMap(final String attributes) {
        Map<String, String> attributeMap = null;

        // split the attributes up, will be received as a comma separated list
        // of name value pairs
        final String[] nvps = attributes.split(",");

        if (nvps != null) {
            for (final String nvp : nvps) {
                final String[] split = nvp.split("=");
                if (split != null && split.length == 2) {
                    if (attributeMap == null) {
                        attributeMap = new HashMap<String, String>();
                    }
                    attributeMap.put(split[0], split[1].replaceAll("\"", ""));
                }
            }
        }

        return attributeMap;
    }
public static Map < String , String > convertToMap ( final String attributes ) { Map < String , String > attributeMap = null ; final String [ ] nvps = attributes . split ( "," ) ; if ( nvps != null ) { for ( final String nvp : nvps ) { final String [ ] split = nvp . split ( "=" ) ; if ( split != null && split . length == 2 ) { if ( attributeMap == null ) { attributeMap = new HashMap < String , String > ( ) ; } attributeMap . put ( split [ 0 ] , split [ 1 ] . replaceAll ( "\"" , "" ) ) ; } } } return attributeMap ; }
Converts a comma separated list of attributes into a map with their
corresponding values. Double quoted values have the quotes removed. A
typical use case is a step that takes a series of attributes contained
within angle brackets eg [COLOUR="red", name="bob", age=26]

@param attributes
the comma separated attributes
@return the atrribue values mapped by their key