public static String toJsonString ( Object value ) { if ( value == null ) { return "null" ; } else if ( value . getClass ( ) . equals ( String . class ) ) { return "\"" + StringUtils . jsonEncoding ( value . toString ( ) ) + "\"" ; } // else it's a RawJson, Boolean or Number so no escaping or quotes else { return value . toString ( ) ; } }
return the value in a JSON friendly way