All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.ebean.enhance.common.ArgParser Maven / Gradle / Ivy

There is a newer version: 15.8.0
Show newest version
package io.ebean.enhance.common;

import java.util.HashMap;
import java.util.Map;

/**
 * Helper to parse javaagent or ant string arguments.
 */
class ArgParser {

  /**
  * Parse the args returning as name value pairs.
  */
  static Map parse(String args){
    Map map = new HashMap<>();
    if (args != null){
      String[] split = args.split(";");
      for (String nameValuePair : split) {
        String[] nameValue = nameValuePair.split("=");
        if (nameValue.length == 2){
          map.put(nameValue[0].toLowerCase(), nameValue[1]);
        }
      }
    }
    return map;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy