public class JsonUtil extends Object
| Constructor and Description |
|---|
JsonUtil() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
cache(File file,
Class<T> clazz,
java.util.function.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 void |
writeJson(OutputStream out,
Object obj)
Write json.
|
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 objpublic static void writeJson(@Nonnull OutputStream out, Object obj) throws IOException
out - the outobj - the objIOException - the io exceptionpublic static <T> T cache(File file, Class<T> clazz, java.util.function.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 © 2018 SimiaCryptus Software. All rights reserved.