Class MongoUtils


  • public class MongoUtils
    extends java.lang.Object
    MongoUtils Some utility methods for manipulating mongo data. This class facilitates testing.
    • Constructor Summary

      Constructors 
      Constructor Description
      MongoUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String decodeName​(java.lang.String name)  
      static java.lang.Object decodeValue​(java.lang.Object valueToDecode)  
      static java.lang.Object encodeName​(java.lang.Object value)  
      static java.lang.String encodeName​(java.lang.String name)  
      static java.lang.Object getNestedValue​(com.mongodb.DBObject dbObject, java.lang.String nestedKey)
      Dig through a given dbObject for the nested value
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MongoUtils

        public MongoUtils()
    • Method Detail

      • decodeValue

        public static java.lang.Object decodeValue​(java.lang.Object valueToDecode)
                                            throws java.io.IOException,
                                                   java.lang.ClassNotFoundException
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
      • decodeName

        public static java.lang.String decodeName​(java.lang.String name)
      • encodeName

        public static java.lang.String encodeName​(java.lang.String name)
      • encodeName

        public static java.lang.Object encodeName​(java.lang.Object value)
                                           throws java.io.IOException
        Throws:
        java.io.IOException
      • getNestedValue

        public static java.lang.Object getNestedValue​(com.mongodb.DBObject dbObject,
                                                      java.lang.String nestedKey)
        Dig through a given dbObject for the nested value
        Parameters:
        dbObject - the mongo object to search
        nestedKey - the field key to find
        Returns:
        the value of the field key