public final class JsonFileToObjectExtensions
extends java.lang.Object
JsonFileToObjectExtensions converts json strings to java object and java
collections.| Constructor and Description |
|---|
JsonFileToObjectExtensions() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
toObject(@NonNull java.io.File jsonFile,
@NonNull java.lang.Class<T> clazz,
@NonNull com.fasterxml.jackson.databind.ObjectMapper mapper)
Transforms the given json file into a java object.
|
static <T> T |
toObject(@NonNull java.io.File jsonFile,
@NonNull com.fasterxml.jackson.core.type.TypeReference<T> typeReference,
@NonNull com.fasterxml.jackson.databind.ObjectMapper mapper)
Transforms the given json file into a java object.
|
public static <T> T toObject(@NonNull
@NonNull java.io.File jsonFile,
@NonNull
@NonNull java.lang.Class<T> clazz,
@NonNull
@NonNull com.fasterxml.jackson.databind.ObjectMapper mapper)
throws java.io.IOException
T - the generic typejsonFile - the json fileclazz - the clazzmapper - the mapperjava.io.IOException - Signals that an I/O exception has occurredpublic static <T> T toObject(@NonNull
@NonNull java.io.File jsonFile,
@NonNull
@NonNull com.fasterxml.jackson.core.type.TypeReference<T> typeReference,
@NonNull
@NonNull com.fasterxml.jackson.databind.ObjectMapper mapper)
throws java.io.IOException
T - the generic typejsonFile - the json filetypeReference - the type referencemapper - the mapperjava.io.IOException - Signals that an I/O exception has occurred