code: private static Object transformType(Object value) {
      if (value == null) {
        return null;
      }
      String valueString = value.toString();
  
      // check for boolean
      boolean boolValue = BooleanUtils.toBoolean(valueString);
      if (StringUtils.equals(valueString, Boolean.toString(boolValue))) {
        return boolValue;
      }
  
      // check for integer
      int intValue = NumberUtils.toInt(valueString);
      if (StringUtils.equals(valueString, Integer.toString(intValue))) {
        return intValue;
      }
  
      return value;
    }
docs: Detects if string values are boolean or integer and transforms them to correct types.
  @param value Value
  @return Transformed value