Class JsonSerializer


  • public final class JsonSerializer
    extends java.lang.Object
    Provides Gson 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 preconfigured Gson builder instance.
      static com.google.gson.Gson json()
      Returns preconfigured Gson instance.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • builder

        public static com.google.gson.GsonBuilder builder()
        Returns preconfigured Gson 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 preconfigured Gson instance. Helpful in cases when no additional configuration of the Json serializer is required.