Class JsonSerializer
- java.lang.Object
-
- com.exonum.binding.common.serialization.json.JsonSerializer
-
public final class JsonSerializer extends java.lang.ObjectProvidesGsonserializer 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.,HashCodeas a hex string).
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.google.gson.GsonBuilderbuilder()Returns preconfiguredGsonbuilder instance.static com.google.gson.Gsonjson()Returns preconfiguredGsoninstance.
-
-
-
Method Detail
-
builder
public static com.google.gson.GsonBuilder builder()
Returns preconfiguredGsonbuilder 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 preconfiguredGsoninstance. Helpful in cases when no additional configuration of the Json serializer is required.
-
-