(Object... args)
| 29 | public 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, |
no test coverage detected