static String quoteIfNeeded(String source) {
        String trimmed = source.trim();

        if (isObject(trimmed) || isArray(trimmed) || isString(trimmed)
            || isBoolean(trimmed) || isNull(trimmed)
            || isNumber(trimmed)) {
            return source;
        } else {
            return "\"" + source + "\"";
        }
    }
static String quoteIfNeeded ( String source ) { String trimmed = source . trim ( ) ; if ( isObject ( trimmed ) || isArray ( trimmed ) || isString ( trimmed ) || isBoolean ( trimmed ) || isNull ( trimmed ) || isNumber ( trimmed ) ) { return source ; } else { return "\"" + source + "\"" ; } }
Add quotes around the object iff it's not a JSON object.

@param source
@return