public class ObjectMappers extends Object
ObjectMapper across the whole project.| Modifier and Type | Method and Description |
|---|---|
static <T> T |
fromJson(@NonNull String json,
@NonNull Class<T> c)
Convert the specified YAML String to an object of the specified class, throwing an unchecked exception (RuntimeException) if conversion fails
|
static <T> T |
fromYaml(@NonNull String yaml,
@NonNull Class<T> c)
Convert the specified YAML String to an object of the specified class, throwing an unchecked exception (RuntimeException) if conversion fails
|
static org.nd4j.shade.jackson.databind.ObjectMapper |
json()
Get a single object mapper for use with reading and writing JSON
|
static String |
toJson(@NonNull Object o)
Convert the specified object to a JSON String, throwing an unchecked exception (RuntimeException) if conversion fails
|
static String |
toYaml(@NonNull Object o)
Convert the specified object to a YAML String, throwing an unchecked exception (RuntimeException) if conversion fails
|
static org.nd4j.shade.jackson.databind.ObjectMapper |
yaml()
Get a single object mapper for use with reading and writing YAML
|
public static org.nd4j.shade.jackson.databind.ObjectMapper json()
public static org.nd4j.shade.jackson.databind.ObjectMapper yaml()
public static String toYaml(@NonNull @NonNull Object o)
o - Objectpublic static String toJson(@NonNull @NonNull Object o)
o - Objectpublic static <T> T fromYaml(@NonNull
@NonNull String yaml,
@NonNull
@NonNull Class<T> c)
yaml - YAML stringc - Class for the objectpublic static <T> T fromJson(@NonNull
@NonNull String json,
@NonNull
@NonNull Class<T> c)
json - JSON stringc - Class for the objectCopyright © 2022. All rights reserved.