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