Class LocalTimeCalendarConverter

java.lang.Object
com.sap.cloud.sdk.typeconverter.AbstractTypeConverter<LocalTime,Calendar>
com.sap.cloud.sdk.s4hana.datamodel.odata.adapter.LocalTimeCalendarConverter
All Implemented Interfaces:
TypeConverter<LocalTime,Calendar>

public class LocalTimeCalendarConverter extends AbstractTypeConverter<LocalTime,Calendar>
Converts between the deprecated Calendar type and the new LocalTime.

The year, month, and day fields on the Calendar instance are ignored/cleared, as the LocalTime does not contain any values for those

In combination with the ODataField annotation this can be used to expose fields of OData value which would be exposed as Calendar as LocalTime.

  • Constructor Details

    • LocalTimeCalendarConverter

      public LocalTimeCalendarConverter()
  • Method Details

    • toDomainNonNull

      @Nonnull public ConvertedObject<Calendar> toDomainNonNull(@Nonnull LocalTime object)
      Description copied from class: AbstractTypeConverter
      Actual converter implementation from an arbitrary object to its domain-specific counterpart.
      Specified by:
      toDomainNonNull in class AbstractTypeConverter<LocalTime,Calendar>
      Parameters:
      object - The object to transform to its domain-specific counterpart.
      Returns:
      A wrapper containing the domain-specific counterpart.
    • fromDomainNonNull

      @Nonnull public ConvertedObject<LocalTime> fromDomainNonNull(@Nonnull Calendar domainObject)
      Description copied from class: AbstractTypeConverter
      Actual converter implementation from a domain-specific object to an arbitrary type.
      Specified by:
      fromDomainNonNull in class AbstractTypeConverter<LocalTime,Calendar>
      Parameters:
      domainObject - The domain-specific object to transform.
      Returns:
      A wrapper containing the converted object.
    • getType

      @Nonnull public Class<LocalTime> getType()
      Description copied from interface: TypeConverter
      Getter for an class object of the type to convert from/to the domain-specific counterpart.
      Returns:
      The class object of T.
    • getDomainType

      @Nonnull public Class<Calendar> getDomainType()
      Description copied from interface: TypeConverter
      Getter for an class object of the domain-specific type.
      Returns:
      The class object of DomainT.