This method serializes the specified object into its equivalent Json representation. This method should be used when the specified object is not a generic type. This method uses Class#getClass() to get the type for the specified object, but the getClass() loses the generic type infor
(Object src)
| 234 | * @return Json representation of {@code src}. |
| 235 | */ |
| 236 | public String toJson(Object src) { |
| 237 | if (src == null) { |
| 238 | return toJson(JsonNull.createJsonNull()); |
| 239 | } |
| 240 | return toJson(src, src.getClass()); |
| 241 | } |
| 242 | |
| 243 | /** |
| 244 | * This method serializes the specified object, including those of generic types, into its |