public class StorageConverter
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
DOT_STRING |
Constructor and Description |
---|
StorageConverter() |
Modifier and Type | Method and Description |
---|---|
static java.util.Map<java.lang.String,java.lang.Object> |
DBObjectToMap(com.mongodb.BasicDBObject dbObject)
This method converts a BasicDBObject object into a Map
|
private static java.lang.Object |
jsonTraverse(java.util.Map<java.lang.String,java.lang.Object> map,
boolean dot) |
private static java.lang.Object |
listTraverse(java.util.List<java.lang.Object> list,
boolean dot) |
static com.mongodb.BasicDBObject |
MapToDBObject(java.util.Map<java.lang.String,java.lang.Object> map)
This method converts a Map
|
(package private) static java.lang.String |
replaceDotToDotUtf(java.lang.String original)
This method replaces DOT(".") to DOT_STRING("U+FF04").
|
(package private) static java.lang.String |
replaceDotUtfToDot(java.lang.String original)
This method replaces DOT_STRING("U+FF04") to DOT(".").
|
static java.lang.Object |
toDBObject(java.lang.Object obj) |
static java.lang.Object |
toJSON(java.lang.Object obj)
This method converts an object into a JSON object, and
returns it to the caller.
|
private static final java.lang.String DOT_STRING
public static com.mongodb.BasicDBObject MapToDBObject(java.util.Map<java.lang.String,java.lang.Object> map)
map
- Map object which will be converted into BasicDBObject.public static java.util.Map<java.lang.String,java.lang.Object> DBObjectToMap(com.mongodb.BasicDBObject dbObject)
dbObject
- BasicDBObject which will be converted into Map object.public static java.lang.Object toJSON(java.lang.Object obj)
obj
- An object turns into JSON object.public static java.lang.Object toDBObject(java.lang.Object obj)
private static java.lang.Object jsonTraverse(java.util.Map<java.lang.String,java.lang.Object> map, boolean dot)
private static java.lang.Object listTraverse(java.util.List<java.lang.Object> list, boolean dot)
static java.lang.String replaceDotUtfToDot(java.lang.String original)
static java.lang.String replaceDotToDotUtf(java.lang.String original)