public static Map<String,String> strToMap(String str,String delim,boolean trim,String pairsSeparator){
  if (str == null)   return null;
  Map<String,String> decodedMap=new HashMap<String,String>();
  List<String> elements=split(str,delim);
  pairsSeparator=pairsSeparator == null ? "=" : pairsSeparator;
  for (  String s : elements) {
    List<String> e=split(s,pairsSeparator);
    if (e.size() != 2) {
      continue;
    }
    String name=e.get(0);
    String value=e.get(1);
    if (trim) {
      if (name != null) {
        name=name.trim();
      }
      if (value != null) {
        value=value.trim();
      }
    }
    try {
      decodedMap.put(URLDecoder.decode(name,"UTF-8"),URLDecoder.decode(value,"UTF-8"));
    }
 catch (    UnsupportedEncodingException e1) {
      Debug.logError(e1,module);
    }
  }
  return decodedMap;
}

public static Map < String , String > strToMap ( String str , String delim , boolean trim , String pairsSeparator ) { if ( str == null ) return null ; Map < String , String > decodedMap = new HashMap < String , String > ( ) ; List < String > elements = split ( str , delim ) ; pairsSeparator = pairsSeparator == null ? "=" : pairsSeparator ; for ( String s : elements ) { List < String > e = split ( s , pairsSeparator ) ; if ( e . size ( ) != 2 ) { continue ; } String name = e . get ( 0 ) ; String value = e . get ( 1 ) ; if ( trim ) { if ( name != null ) { name = name . trim ( ) ; } if ( value != null ) { value = value . trim ( ) ; } } try { decodedMap . put ( URLDecoder . decode ( name , "UTF-8" ) , URLDecoder . decode ( value , "UTF-8" ) ) ; } catch ( UnsupportedEncodingException e1 ) { Debug . logError ( e1 , module ) ; } } return decodedMap ; }
creates a map from a name / value pair string
