Class JsonSerializer
- java.lang.Object
-
- com.exonum.binding.common.serialization.json.JsonSerializer
-
public final class JsonSerializer extends java.lang.Object
ProvidesGson
serializer for converting Java objects to Json and vice versa. It is configured to serialize Exonum objects in a format, compatible with the core framework and light clients (e.g.,HashCode
as a hex string).
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.google.gson.GsonBuilder
builder()
Returns preconfiguredGson
builder instance.static com.google.gson.Gson
json()
Returns preconfiguredGson
instance.
-
-
-
Method Detail
-
builder
public static com.google.gson.GsonBuilder builder()
Returns preconfiguredGson
builder instance. Can be useful in cases when some customization is required. For example, type adapters should be extended or replaced.
-
json
public static com.google.gson.Gson json()
Returns preconfiguredGson
instance. Helpful in cases when no additional configuration of the Json serializer is required.
-
-