public class JsonHelper
extends java.lang.Object
| Constructor and Description |
|---|
JsonHelper() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
prettyPrint(java.lang.Object entity)
Transforms the given entity into a pretty-printed JSON representation.
|
static java.lang.String |
prettyPrint(java.lang.String json)
Pretty-prints the given json document into.
|
public static java.lang.String prettyPrint(java.lang.Object entity)
The ObjectMappers.currentObjectMapper() is used to serialize the entity.
entity - some json-serializable objectjava.lang.IllegalStateException - if serializing the entity fails for some reason.public static java.lang.String prettyPrint(java.lang.String json)
json - the json documentjava.lang.IllegalStateException - if serializing the entity fails for some reason.