code: public static int getType(Number val) 
    {
      if (val instanceof Integer) 
      {
        return INT;
      } 
      else if (val instanceof Long) 
      {
        return LONG;
      } 
      else if (val instanceof Short) 
      {
        return SHORT;
      } 
      else if (val instanceof Byte) 
      {
        return BYTE;
      } 
      else if (val instanceof Double) 
      {
        return DOUBLE;
      } 
      else if (val instanceof Float) 
      {
        return FLOAT;
      } else
        throw new IllegalArgumentException();
    }
docs: Make a NumericValue from a standard wrapper subclass of Number