Class GsonVdmEntityAdapter<T>

java.lang.Object
com.google.gson.TypeAdapter<VdmObject<T>>
com.sap.cloud.sdk.datamodel.odatav4.adapter.GsonVdmEntityAdapter<T>
Type Parameters:
T - The entity type.

public class GsonVdmEntityAdapter<T> extends com.google.gson.TypeAdapter<VdmObject<T>>
For internal use only by data model classes
  • Constructor Summary

    Constructors
    Constructor
    Description
    GsonVdmEntityAdapter(com.google.gson.TypeAdapterFactory adapterFactory, com.google.gson.Gson gson, Class<? super T> entityRawType)
    For internal use only by data model classes.
  • Method Summary

    Modifier and Type
    Method
    Description
    read(com.google.gson.stream.JsonReader jsonReader)
    For internal use only by data model classes.
    void
    write(com.google.gson.stream.JsonWriter out, VdmObject<T> value)
    For internal use only by data model classes.

    Methods inherited from class com.google.gson.TypeAdapter

    fromJson, fromJson, fromJsonTree, nullSafe, toJson, toJson, toJsonTree

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GsonVdmEntityAdapter

      public GsonVdmEntityAdapter(@Nonnull com.google.gson.TypeAdapterFactory adapterFactory, @Nonnull com.google.gson.Gson gson, @Nonnull Class<? super T> entityRawType)
      For internal use only by data model classes.
      Parameters:
      adapterFactory - The adapter type factory.
      gson - The GSON instance.
      entityRawType - The entity type reference.
  • Method Details

    • read

      @Nullable public VdmObject<T> read(@Nonnull com.google.gson.stream.JsonReader jsonReader) throws IOException
      For internal use only by data model classes.
      Specified by:
      read in class com.google.gson.TypeAdapter<VdmObject<T>>
      Parameters:
      jsonReader - The JsonReader reference.
      Returns:
      The deserialized entity instance.
      Throws:
      IOException - When deserialization failed.
    • write

      public void write(@Nonnull com.google.gson.stream.JsonWriter out, @Nullable VdmObject<T> value) throws IOException
      For internal use only by data model classes.
      Specified by:
      write in class com.google.gson.TypeAdapter<VdmObject<T>>
      Parameters:
      out - The JsonWriter reference.
      value - The entity instance to be serialized.
      Throws:
      IOException - When serialization failed.