Interface DomainMapper

All Known Subinterfaces:
DomainMapperManager, DomainMapperMember
All Known Implementing Classes:
BasicAuditDomainMapperMember, BusinessTypeAwareDomainMapperMember, ChangeContainerOverridableDomainMapperMember, CreateSetupDomainMapperMember, DefaultDomainMapperManager, ModelMapperDomainMapperMember, MonetaryMapperMember, SingleIndexRequestNotificationStateMapperMember, UpdateValidationDomainMapperMember

public interface DomainMapper
Common interface for DomainMapperMember and DomainMapperManager.
Author:
Jeff Fischer
  • Method Summary

    Modifier and Type
    Method
    Description
    default <D> D
    deleteMap(D repositoryDomain, ContextInfo contextInfo)
    In cases where deletion actually results in a modified state to persist (e.g.
    default <P> Class<P>
    getBusinessDomainType(Object repositoryDomain)
    Ascertain the correct business domain type based on an instance of the repository domain
    default <D, P> D
    modifyMap(D repositoryDomain, P businessDomain, ContextInfo contextInfo, boolean allowNull)
    Perform a mapping operation from business domain instance to persistence specific instance, presumably modifying the state of the persistence specific instance.
  • Method Details

    • modifyMap

      @Nullable default <D, P> D modifyMap(D repositoryDomain, P businessDomain, @Nullable ContextInfo contextInfo, boolean allowNull)
      Perform a mapping operation from business domain instance to persistence specific instance, presumably modifying the state of the persistence specific instance.
      Type Parameters:
      D - The repository domain type
      P - The business domain type
      Parameters:
      repositoryDomain - The persistence domain instance to modify
      businessDomain - The business instance containing changes to map to the repository domain
      contextInfo - The context information used to make tracking determinations relevant to sandboxing and multitenant concerns. See TrackableRepository for more info on persistence behavior based on context.
      allowNull - Whether or not null values in properties in the payload instance should be ignored during the mapping operation.
      Returns:
      The modified repository domain instance. Return null if no action taken.
    • deleteMap

      @Nullable default <D> D deleteMap(D repositoryDomain, @Nullable ContextInfo contextInfo)
      In cases where deletion actually results in a modified state to persist (e.g. archived soft delete), this method will modify the state appropriately toward that end.
      Type Parameters:
      D - The repository domain type
      Parameters:
      repositoryDomain - The persistence domain instance to inactivate
      contextInfo - The context information used to make tracking determinations relevant to sandboxing and multitenant concerns.
      Returns:
      The repository domain state resulting from the delete operation. Return null if no action taken.
    • getBusinessDomainType

      @Nullable default <P> Class<P> getBusinessDomainType(Object repositoryDomain)
      Ascertain the correct business domain type based on an instance of the repository domain
      Parameters:
      repositoryDomain - The persistence domain instance to inspect
      Returns:
      The type of the associated business domain. Return null is not supported.