Package dev.javatools.maputils
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.Mapcreate(java.io.File input, Format format)Convert json string that is in the file into a Map.static java.util.Mapcreate(java.lang.Object input)Convert any custom java model into a Map.static java.util.Mapcreate(java.lang.String input, Format format)Create a Map from json String
-
Method Details
-
create
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
Create a Map from json String- Parameters:
input- Json Stringformat- 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
-