Class AbstractTypeConverter<T,DomainT>

java.lang.Object
com.sap.cloud.sdk.typeconverter.AbstractTypeConverter<T,DomainT>
Type Parameters:
T - The type to convert from/to the domain-specific counterpart.
DomainT - The domain-specific type.
All Implemented Interfaces:
TypeConverter<T,DomainT>
Direct Known Subclasses:
AbstractErpTypeConverter, LocalDateTimeCalendarConverter, LocalTimeCalendarConverter, ZonedDateTimeCalendarConverter

public abstract class AbstractTypeConverter<T,DomainT> extends Object implements TypeConverter<T,DomainT>
Abstract type converter base class for converting types to and from their domain-specific counterparts.
  • Constructor Details

    • AbstractTypeConverter

      public AbstractTypeConverter()
  • Method Details

    • toDomain

      @Nonnull public final ConvertedObject<DomainT> toDomain(@Nullable T object)
      Description copied from interface: TypeConverter
      Transforms the given object to its domain-specific counterpart.
      Specified by:
      toDomain in interface TypeConverter<T,DomainT>
      Parameters:
      object - The object to transform.
      Returns:
      A ConvertedObject wrapping the domain-specific object.
    • fromDomain

      @Nonnull public final ConvertedObject<T> fromDomain(@Nullable DomainT domainObject)
      Description copied from interface: TypeConverter
      Transforms the given domain-specific object to the general object.
      Specified by:
      fromDomain in interface TypeConverter<T,DomainT>
      Parameters:
      domainObject - The domain-specific object to transform.
      Returns:
      A ConvertedObject wrapping the general object.
    • toDomainNonNull

      @Nonnull public abstract ConvertedObject<DomainT> toDomainNonNull(@Nonnull T object) throws Exception
      Actual converter implementation from an arbitrary object to its domain-specific counterpart.
      Parameters:
      object - The object to transform to its domain-specific counterpart.
      Returns:
      A wrapper containing the domain-specific counterpart.
      Throws:
      Exception - If an error occurred during the transformation.
    • fromDomainNonNull

      @Nonnull public abstract ConvertedObject<T> fromDomainNonNull(@Nonnull DomainT domainObject) throws Exception
      Actual converter implementation from a domain-specific object to an arbitrary type.
      Parameters:
      domainObject - The domain-specific object to transform.
      Returns:
      A wrapper containing the converted object.
      Throws:
      Exception - If an error occurred during the transformation.