Enum Class SimpleJsonMapper

java.lang.Object
java.lang.Enum<SimpleJsonMapper>
com.linkedin.alpini.base.misc.SimpleJsonMapper
All Implemented Interfaces:
Serializable, Comparable<SimpleJsonMapper>, Constable

public enum SimpleJsonMapper extends Enum<SimpleJsonMapper>
A VERY simple JSON mapper. This class will take a string of simple JSON and convert it into a Map. Created by zpolicze on 10/29/14.
  • Enum Constant Details

  • Method Details

    • values

      public static SimpleJsonMapper[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SimpleJsonMapper valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getObjectMapper

      public static com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
    • mapJSON

      public static Map<String,Object> mapJSON(String json) throws Exception
      Converts valid JSON document into a hash map of Strings.
      Parameters:
      json - a valid json string to be mapped.
      Returns:
      the inputted json string as a map.
      Throws:
      Exception - when parameter json is not a valid json string.