Class CreateMap

java.lang.Object
dev.javatools.map.CreateMap

public class CreateMap
extends java.lang.Object
Use this for creating a Map from Json String or from models or from json String stored in a file.
  • Constructor Summary

    Constructors 
    Constructor Description
    CreateMap()  
  • Method Summary

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

    Methods inherited from class java.lang.Object

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

  • Method Details

    • create

      public java.util.Map<java.lang.String,​java.lang.Object> create​(java.io.File input) throws java.io.IOException
      Convert json string that is in the file into a Map.
      Parameters:
      input - , file containing the json String.
      Returns:
      returns Map representation of the File content
      Throws:
      java.io.IOException - Throws IOException, if the provided Json is not valid or if the file does not exists.
    • create

      public java.util.Map<java.lang.String,​java.lang.Object> create​(java.lang.String input) throws com.fasterxml.jackson.core.JsonProcessingException
      Create a Map from json String
      Parameters:
      input - Json String
      Returns:
      returns Map representation of the File content
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException - Throws JsonProcessingException, if the provided Json is not valid
    • create

      public java.util.Map<java.lang.String,​java.lang.Object> create​(java.lang.Object input) throws com.fasterxml.jackson.core.JsonProcessingException
      Convert any custom object into a Map.
      Parameters:
      input - And custome model object that you want to convert to Map
      Returns:
      returns Map representation of the File content
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException - Throws JsonProcessingException, if the provided Object is not valid model