Class MapCreator

java.lang.Object
dev.javatools.maputils.MapCreator

public final class MapCreator
extends java.lang.Object
Use this for creating a Map from Json/yaml or custom java models.
     1. Json/yaml String or
     2. from a custom java models that you build in your project or
     3. from json/yaml String that is stored in a file.
 
  • Method Summary

    Modifier and Type Method Description
    static java.util.Map create​(java.io.File input, Format format)
    Convert json string that is in the file into a Map.
    static java.util.Map create​(java.lang.Object input)
    Convert any custom java model into a Map.
    static java.util.Map create​(java.lang.String input, Format format)
    Create a Map from json String

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • create

      public static java.util.Map create​(java.io.File input, Format format)
      Convert json string that is in the file into a Map.
      Parameters:
      input - , file containing the json String.
      format - At this time we are supporting json and yaml types
      Returns:
      returns Map representation of the File content
    • create

      public static java.util.Map create​(java.lang.String input, Format format)
      Create a Map from json String
      Parameters:
      input - Json String
      format - At this time we are supporting json and yaml types
      Returns:
      returns Map representation of the File content
    • create

      public static java.util.Map create​(java.lang.Object input)
      Convert any custom java model into a Map.
      Parameters:
      input - And custom model object that you want to convert to Map
      Returns:
      returns Map representation of the File content