Package com.sap.cloud.sdk.typeconverter
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal ConvertedObject<T>
fromDomain
(DomainT domainObject) Transforms the given domain-specific object to the general object.abstract ConvertedObject<T>
fromDomainNonNull
(DomainT domainObject) Actual converter implementation from a domain-specific object to an arbitrary type.final ConvertedObject<DomainT>
Transforms the given object to its domain-specific counterpart.abstract ConvertedObject<DomainT>
toDomainNonNull
(T object) Actual converter implementation from an arbitrary object to its domain-specific counterpart.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.sap.cloud.sdk.typeconverter.TypeConverter
getDomainType, getType
-
Constructor Details
-
AbstractTypeConverter
public AbstractTypeConverter()
-
-
Method Details
-
toDomain
Description copied from interface:TypeConverter
Transforms the given object to its domain-specific counterpart.- Specified by:
toDomain
in interfaceTypeConverter<T,
DomainT> - Parameters:
object
- The object to transform.- Returns:
- A
ConvertedObject
wrapping the domain-specific object.
-
fromDomain
Description copied from interface:TypeConverter
Transforms the given domain-specific object to the general object.- Specified by:
fromDomain
in interfaceTypeConverter<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.
-