public abstract class SerializationUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static Map<String,Object> |
flattenMap(com.mongodb.DBObject source)
Flattens out a given
DBObject. |
static String |
serializeToJsonSafely(Object value)
Serializes the given object into pseudo-JSON meaning it's trying to create a JSON representation as far as possible
but falling back to the given object's
Object.toString() method if it's not serializable. |
public static Map<String,Object> flattenMap(com.mongodb.DBObject source)
DBObject.
{ _id : 1 nested : { value : "conflux"} }will result in{ _id : 1 nested.value : "conflux" }
source - can be null.Collections.emptyMap() when source is nullpublic static String serializeToJsonSafely(Object value)
Object.toString() method if it's not serializable. Useful for
printing raw DBObjects containing complex values before actually converting them into Mongo native types.value - Copyright © 2011–2018 Pivotal Software, Inc.. All rights reserved.