Class ZonedDateTimeAdapter
java.lang.Object
com.google.gson.TypeAdapter<T>
com.sap.cloud.sdk.s4hana.datamodel.odata.adapter.AbstractCalendarAdapter<ZonedDateTime>
com.sap.cloud.sdk.s4hana.datamodel.odata.adapter.ZonedDateTimeAdapter
Gson adapter to (de-)serialize fields of type
ZonedDateTime
from and to Json.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected ConvertedObject<ZonedDateTime>
convertStringToType
(String jsonString) Converts a string value read from a json property as an instance of the type to be created by this adapter.protected ConvertedObject<String>
convertTypeToString
(ZonedDateTime entity) Converts an instance of the type handled by this adapter into a string that can be written as a json value.Methods inherited from class com.sap.cloud.sdk.s4hana.datamodel.odata.adapter.AbstractCalendarAdapter
read, write
Methods inherited from class com.google.gson.TypeAdapter
fromJson, fromJson, fromJsonTree, nullSafe, toJson, toJson, toJsonTree
-
Constructor Details
-
ZonedDateTimeAdapter
public ZonedDateTimeAdapter()
-
-
Method Details
-
convertStringToType
Description copied from class:AbstractCalendarAdapter
Converts a string value read from a json property as an instance of the type to be created by this adapter.- Specified by:
convertStringToType
in classAbstractCalendarAdapter<ZonedDateTime>
- Parameters:
jsonString
- The string value of a json property.- Returns:
- A
ConvertedObject
instance containing the resulting object, or is empty if conversion was not possible.
-
convertTypeToString
Description copied from class:AbstractCalendarAdapter
Converts an instance of the type handled by this adapter into a string that can be written as a json value.- Specified by:
convertTypeToString
in classAbstractCalendarAdapter<ZonedDateTime>
- Parameters:
entity
- The entity to convert into a String- Returns:
- A
ConvertedObject
instance containing the resulting string, or is empty if conversion was not possible.
-