Class GsonWrapper

java.lang.Object
com.google.common.collect.ForwardingObject
org.jclouds.json.internal.GsonWrapper
All Implemented Interfaces:
Json

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

    • GsonWrapper

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

    • 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
      invalid reference
      #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
      invalid reference
      #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
      invalid reference
      #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
      invalid reference
      #fromJson(Object, Type)
      Specified by:
      fromJson in interface Json
    • toJson

      public String toJson(Object src)
      Description copied from interface: Json
      Serialize the object into json. If the object is a generic type, use Json.toJson(Object, Type)
      Specified by:
      toJson in interface Json
    • toJson

      public String toJson(Object src, Type type)
      Description copied from interface: Json
      Serialize the generic object into json. If the object is not a generic, use Json.toJson(Object, Type)
      Specified by:
      toJson in interface Json
    • delegate

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