Class LocalDateTimeAdapter
java.lang.Object
com.google.gson.TypeAdapter<T>
com.sap.cloud.sdk.s4hana.datamodel.odata.adapter.AbstractCalendarAdapter<LocalDateTime>
com.sap.cloud.sdk.s4hana.datamodel.odata.adapter.LocalDateTimeAdapter
Gson adapter to (de-)serialize fields of type
LocalDateTime
from and to Json.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected ConvertedObject<LocalDateTime>
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
(LocalDateTime 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
-
LocalDateTimeAdapter
public LocalDateTimeAdapter()
-
-
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<LocalDateTime>
- 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<LocalDateTime>
- 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.
-