public static Arguments parseArgs(final String args){
  Map<String,String> parsed=new HashMap<>();
  for (  String argPair : args.split(",")) {
    String[] tokens=argPair.split("=");
    if (tokens.length != 2) {
      throw new IllegalArgumentException("statsd-jvm-profiler takes a comma-delimited list of arguments in k=v form");
    }
    parsed.put(tokens[0],tokens[1]);
  }
  for (  String requiredArg : REQUIRED) {
    if (!parsed.containsKey(requiredArg)) {
      throw new IllegalArgumentException(String.format("%s argument was not supplied",requiredArg));
    }
  }
  return new Arguments(parsed);
}

public static Arguments parseArgs ( final String args ) { Map < String , String > parsed = new HashMap < > ( ) ; for ( String argPair : args . split ( "," ) ) { String [ ] tokens = argPair . split ( "=" ) ; if ( tokens . length != 2 ) { throw new IllegalArgumentException ( "statsd-jvm-profiler takes a comma-delimited list of arguments in k=v form" ) ; } parsed . put ( tokens [ 0 ] , tokens [ 1 ] ) ; } for ( String requiredArg : REQUIRED ) { if ( ! parsed . containsKey ( requiredArg ) ) { throw new IllegalArgumentException ( String . format ( "%s argument was not supplied" , requiredArg ) ) ; } } return new Arguments ( parsed ) ; }
parses arguments into an arguments object
