Class JsonObject


  • public class JsonObject
    extends Object
    This class has a toMap() method that uses Jackson to convert the object to a map and a toString() method that returns the simple class name and the map string. It also implements hashCode() and equals() using the map. Extending this class is an easy way to get a meaningful toString(). If extending is not possible, you may use the static toString() method in this class.
    • Constructor Detail

      • JsonObject

        public JsonObject()
    • Method Detail

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • toMap

        public Map<?,​?> toMap()
        Returns this object as a map.
        Returns:
        the map
      • toString

        public static String toString​(Object obj)
        Returns the string representation for the specified object.
        Parameters:
        obj - the object
        Returns:
        the string representation
      • toMap

        public static Map<?,​?> toMap​(Object obj)
        Returns the specified object as a map.
        Parameters:
        obj - the object
        Returns:
        the map