MCPcopy Create free account
hub / github.com/apache/nutch / toArgMap

Method toArgMap

src/java/org/apache/nutch/util/ToolUtil.java:31–45  ·  view source on GitHub ↗
(Object... args)

Source from the content-addressed store, hash-verified

29public class ToolUtil {
30
31 public static final Map<String, Object> toArgMap(Object... args) {
32 if (args == null) {
33 return null;
34 }
35 if (args.length % 2 != 0) {
36 throw new RuntimeException("expected pairs of argName argValue");
37 }
38 HashMap<String, Object> res = new HashMap<String, Object>();
39 for (int i = 0; i < args.length; i += 2) {
40 if (args[i + 1] != null) {
41 res.put(String.valueOf(args[i]), args[i + 1]);
42 }
43 }
44 return res;
45 }
46
47 @SuppressWarnings("unchecked")
48 public static final void recordJobStatus(String label, Job job,

Callers 8

fetchMethod · 0.95
runMethod · 0.95
deleteMethod · 0.95
parseMethod · 0.95
injectMethod · 0.95
updateTableMethod · 0.95
generateMethod · 0.95
processStatJobMethod · 0.95

Calls 1

putMethod · 0.45

Tested by

no test coverage detected