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

public class LocalTimeAdapter extends AbstractCalendarAdapter<LocalTime>
Gson adapter to (de-)serialize fields of type LocalTime from and to Json.
  • Constructor Details

    • LocalTimeAdapter

      public LocalTimeAdapter()
  • Method Details

    • convertStringToType

      @Nonnull protected ConvertedObject<LocalTime> convertStringToType(@Nonnull String jsonString)
      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 class AbstractCalendarAdapter<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

      @Nonnull protected ConvertedObject<String> convertTypeToString(@Nullable LocalTime entity)
      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 class AbstractCalendarAdapter<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.