org.springframework.data.mongodb.core.query
Class SerializationUtils
java.lang.Object
org.springframework.data.mongodb.core.query.SerializationUtils
public abstract class SerializationUtils
- extends Object
Utility methods for JSON serialization.
- Author:
- Oliver Gierke
|
Method Summary |
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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
serializeToJsonSafely
public 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. Useful for
printing raw DBObjects containing complex values before actually converting them into Mongo native types.
- Parameters:
value -
- Returns:
Copyright © 2011-2013-2013 SpringSource. All Rights Reserved.