Package io.memoria.jutils.adapter.json
Class JsonGsonUtils
java.lang.Object
io.memoria.jutils.adapter.json.JsonGsonUtils
public class JsonGsonUtils
extends java.lang.Object
-
Method Summary
Modifier and Type Method Description static <T> io.vavr.control.Try<T>deserialize(com.google.gson.stream.JsonReader in, io.vavr.collection.Map<java.lang.String,com.google.gson.TypeAdapter<? extends T>> mappers)static <T> io.vavr.control.Try<io.vavr.collection.List<T>>deserializeAsList(com.google.gson.stream.JsonReader in, com.google.gson.TypeAdapter<T> typeAdapter)static <T> io.vavr.control.Try<io.vavr.collection.List<T>>deserializeAsList(com.google.gson.stream.JsonReader in, io.vavr.CheckedFunction1<com.google.gson.stream.JsonReader,T> reader)static <E extends T, T>
voidserialize(com.google.gson.stream.JsonWriter out, com.google.gson.TypeAdapter<T> typeAdapter, io.vavr.collection.Traversable<E> traversable)static voidserialize(com.google.gson.stream.JsonWriter out, io.vavr.collection.Traversable<java.lang.String> traversable)static <T extends java.lang.Number>
voidserializeNumber(com.google.gson.stream.JsonWriter out, io.vavr.collection.Traversable<T> traversable)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
deserialize
public static <T> io.vavr.control.Try<T> deserialize(com.google.gson.stream.JsonReader in, io.vavr.collection.Map<java.lang.String,com.google.gson.TypeAdapter<? extends T>> mappers) -
deserializeAsList
public static <T> io.vavr.control.Try<io.vavr.collection.List<T>> deserializeAsList(com.google.gson.stream.JsonReader in, com.google.gson.TypeAdapter<T> typeAdapter) -
deserializeAsList
public static <T> io.vavr.control.Try<io.vavr.collection.List<T>> deserializeAsList(com.google.gson.stream.JsonReader in, io.vavr.CheckedFunction1<com.google.gson.stream.JsonReader,T> reader) -
serialize
public static <E extends T, T> void serialize(com.google.gson.stream.JsonWriter out, com.google.gson.TypeAdapter<T> typeAdapter, io.vavr.collection.Traversable<E> traversable) throws java.io.IOException- Throws:
java.io.IOException
-
serialize
public static void serialize(com.google.gson.stream.JsonWriter out, io.vavr.collection.Traversable<java.lang.String> traversable) throws java.io.IOException- Throws:
java.io.IOException
-
serializeNumber
public static <T extends java.lang.Number> void serializeNumber(com.google.gson.stream.JsonWriter out, io.vavr.collection.Traversable<T> traversable) throws java.io.IOException- Throws:
java.io.IOException
-