docs: private static Object convertStringToPrimitiveOrPrimitiveWrapper(String value, final Class<?> expectedClz)
      throws VoltTypeException
      {
          value = value.trim();
          // detect CSV null
          if (value.equals(Constants.CSV_NULL)) return nullValueForType(expectedClz);
  
          // Remove commas.  Doing this seems kind of dubious since it lets strings like
          //    ,,,3.1,4,,e,+,,16
          // be parsed as a valid double value (for example).
          String commaFreeValue = thousandSeparator.matcher(value).replaceAll("");
  
          try {
              // autoboxing converts to boxed types since this method returns a java Object
              if (isLongClass(expectedClz)) {
                  return Long.parseLong(commaFreeValue);
              }
              if (isIntClass(expectedClz)) {
                  return Integer.parseInt(commaFreeValue);
              }
              if (isShortClass(expectedClz)) {
                  return Short.parseShort(commaFreeValue);
              }
              if (isByteClass(expectedClz)) {
                  return Byte.parseByte(commaFreeValue);
              }
              if (isDoubleClass(expectedClz)) {
                  return Double.parseDouble(commaFreeValue);
              }
          }
          // ignore the exception and fail through below
          catch (NumberFormatException nfe) {
  
              // If we failed to parse the string in decimal form it could still
              // be a numeric value specified as X'....'
              //
              // Do this only after trying to parse a decimal literal, which is the
              // most common case.
              if (expectedClz != double.class) {
                  String hexDigits = SQLParser.getDigitsFromHexLiteral(value);
                  if (hexDigits != null) {
                      try {
                          return SQLParser.hexDigitsToLong(hexDigits);
                      }
                      catch (SQLParser.Exception spe) {
                      }
                  }
              }
          }
  
          throw new VoltTypeException(
                  "Unable to convert string "
                  + value + " to "  + expectedClz.getName()
                  + " value for target parameter.");
      }