code: public String toVoJSONString(boolean pretty) {
          if (pretty) {
              return JSON.toJSONStringWithDateFormat(toVoJSONObject(), Constant.DATE_SERIALIZE_FORMAT, SerializerFeature.PrettyFormat);
          } else {
              return JSONObject.toJSONStringWithDateFormat(toVoJSONObject(), Constant.DATE_SERIALIZE_FORMAT);
          }
      }
docs: No matter context pretty attribute is true or not, this method formats the json string you want.
  
  @param pretty pretty or not.
  @return formatted json string.