Class GsonWrapper

  • All Implemented Interfaces:
    Json

    @Singleton
    public class GsonWrapper
    extends com.google.common.collect.ForwardingObject
    implements Json
    • Constructor Detail

      • GsonWrapper

        @Inject
        public GsonWrapper​(com.google.gson.Gson gson)
    • Method Detail

      • fromJson

        public <T> T fromJson​(String json,
                              Type type)
        Description copied from interface: Json
        Deserialize the generic object from json. If the object is not a generic type, use #fromJson(Object, Class)
        Specified by:
        fromJson in interface Json
      • fromJson

        public <T> T fromJson​(String json,
                              Class<T> classOfT)
        Description copied from interface: Json
        Deserialize the object from json. If the object is a generic type, use #fromJson(Object, Type)
        Specified by:
        fromJson in interface Json
      • fromJson

        public <T> T fromJson​(InputStream json,
                              Charset charset,
                              Type type)
        Description copied from interface: Json
        Deserialize the generic object from json. If the object is not a generic type, use #fromJson(Object, Class)
        Specified by:
        fromJson in interface Json
      • fromJson

        public <T> T fromJson​(InputStream json,
                              Charset charset,
                              Class<T> classOfT)
        Description copied from interface: Json
        Deserialize the object from json. If the object is a generic type, use #fromJson(Object, Type)
        Specified by:
        fromJson in interface Json
      • delegate

        public com.google.gson.Gson delegate()
        Specified by:
        delegate in class com.google.common.collect.ForwardingObject