private static Object[] convertActionArguments(NetAction action, String[] arguments) throws InvalidValueException { List<NetType> argTypes = action.getArguments(); List<Object> ret = new ArrayList<Object>(); if (argTypes.size() != arguments.length) throw new InvalidValueException(); for (int i = 0; i < arguments.length; i++) ret.add(convertValue(argTypes.get(i), arguments[i])); return ret.toArray(); }
private static void checkActionArguments(NetAction action, Object[] arguments) throws InvalidValueException { List<NetType> argTypes = action.getArguments(); if (argTypes.size() != arguments.length) throw new InvalidValueException(); for (int i = 0; i < arguments.length; i++) checkValue(argTypes.get(i), arguments[i]); }