public class JsonUtil extends Object
Constructor and Description |
---|
JsonUtil() |
Modifier and Type | Method and Description |
---|---|
static <T> T |
cache(File file,
Class<T> clazz,
Supplier<T> intializer)
Cache t.
|
static double[] |
getDoubleArray(com.google.gson.JsonArray array)
Get double array double [ ].
|
static int[] |
getIntArray(com.google.gson.JsonArray array)
Get int array int [ ].
|
static com.google.gson.JsonArray |
getJson(double[] kernelDims)
Gets json.
|
static com.google.gson.JsonArray |
getJson(int[] kernelDims)
Gets json.
|
static com.fasterxml.jackson.databind.ObjectMapper |
getMapper()
Gets mapper.
|
static CharSequence |
toJson(Object obj)
Write json.
|
static CharSequence |
toJson(Object obj,
com.fasterxml.jackson.databind.ObjectMapper objectMapper)
To json char sequence.
|
public static double[] getDoubleArray(@Nonnull com.google.gson.JsonArray array)
array
- the array@Nullable public static int[] getIntArray(@Nullable com.google.gson.JsonArray array)
array
- the array@Nonnull public static com.google.gson.JsonArray getJson(@Nonnull double[] kernelDims)
kernelDims
- the kernel dims@Nonnull public static com.google.gson.JsonArray getJson(@Nonnull int[] kernelDims)
kernelDims
- the kernel dimspublic static CharSequence toJson(Object obj)
obj
- the obj@Nonnull public static CharSequence toJson(Object obj, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
obj
- the objobjectMapper
- the object mapperpublic static <T> T cache(File file, Class<T> clazz, Supplier<T> intializer) throws IOException
T
- the type parameterfile
- the fileclazz
- the clazzintializer
- the intializerIOException
- the io exceptionpublic static com.fasterxml.jackson.databind.ObjectMapper getMapper()
Copyright © 2019 SimiaCryptus Software. All rights reserved.