private Value getArgument(Request request, String parameter) {
        if (parameter.length() <= 1 || parameter.charAt(1) != ':')
            return new StringValue(parameter);

        String value = parameter.substring(2);
        switch (parameter.charAt(0)) {
            case 'b':
                return new Int8Value(Byte.parseByte(value));
            case 'h':
                return new Int16Value(Short.parseShort(value));
            case 'i':
                return new Int32Value(Integer.parseInt(value));
            case 'l':
                return new Int64Value(Long.parseLong(value));
            case 'f':
                return new FloatValue(Float.parseFloat(value));
            case 'd':
                return new DoubleValue(Double.parseDouble(value));
            case 's':
                return new StringValue(value);
        }

        throw new IllegalArgumentException("The first letter in '" + parameter + "' must be a type argument. " +
                                           "There is no jrt type identified by '" + parameter.charAt(0) + "'");
    }
A generic rpc invoker for use by command line tools

@author  bratseth
jrt/src/com/yahoo/jrt/tool/RpcInvoker.java