code: private Object parseValue(String value) {
  
          // Try to parse value as number
          try {
              return Double.valueOf(value);
          } catch (NumberFormatException ignored){}
  
          if (value.equals("true") || value.equals("false"))
              return Boolean.valueOf(value);
  
          throw new IllegalArgumentException("Only number or boolean stats values allowed");
  
      }
docs: Helper method to parse string representation
  of value item to number or boolean type
  @param value string representation of value item
  @return parsed value item