public class DefaultDomainMapperManager extends Object implements DomainMapperManager
Constructor and Description |
---|
DefaultDomainMapperManager(List<DomainMapperMember> members,
List<PostMapperMember> postMembers,
com.broadleafcommerce.common.extension.TypeFactory typeFactory,
com.broadleafcommerce.common.extension.data.DataRouteReference reference) |
DefaultDomainMapperManager(List<DomainMapperMember> members,
com.broadleafcommerce.common.extension.TypeFactory typeFactory,
com.broadleafcommerce.common.extension.data.DataRouteReference reference) |
Modifier and Type | Method and Description |
---|---|
<P> P |
convertFromPersistentDomain(Object domain,
ContextInfo contextInfo)
Similar to
DomainMapperManager.fromRepositoryDomain(Object, Class, ContextInfo) , but doesn't require the
caller to know the business domain type. |
<D> D |
deleteMap(D repositoryDomain,
ContextInfo contextInfo)
In cases where deletion actually results in a modified state to persist (e.g.
|
<D> D |
fromBusinessDomain(Object businessDomain,
Class<D> repositoryDomainType,
ContextInfo contextInfo)
Map and return a populated repository domain class instance, based on information provided in
a business domain instance.
|
<P> P |
fromRepositoryDomain(BusinessTypeAware repositoryDomain,
ContextInfo contextInfo)
Map and return a populated business domain instance, based on information provided in a
repository domain instance.
|
<P> P |
fromRepositoryDomain(Object repositoryDomain,
Class<P> businessDomainType,
ContextInfo contextInfo)
Map and return a populated business domain instance, based on information provided in a
repository domain instance.
|
<P> P |
fromRepositoryDomainByExample(Object repositoryDomain,
P example,
ContextInfo contextInfo)
Map and return a populated business domain instance, based on information provided in a
repository domain instance.
|
<P> Class<P> |
getBusinessDomainType(Object repositoryDomain)
Ascertain the correct business domain type based on an instance of the repository domain
|
com.broadleafcommerce.common.extension.TypeFactory |
getTypeFactory() |
<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.
|
<P> List<P> |
process(List<?> repositoryDomain,
ContextInfo contextInfo)
Execute both the
DomainMapperMember.fromRepositoryDomain(Object, Object, ContextInfo)
pipeline and PostMapper.transform(List, List, ContextInfo) pipeline in a single
call. |
<P> P |
process(Object repositoryDomain,
ContextInfo contextInfo)
Execute both the
DomainMapperMember.fromRepositoryDomain(Object, Object, ContextInfo)
pipeline and PostMapper.transform(Object, Object, ContextInfo) pipeline in a
single call. |
<P> org.springframework.data.domain.Page<P> |
process(org.springframework.data.domain.Page<?> repositoryDomain,
ContextInfo contextInfo)
Execute both the
DomainMapperMember.fromRepositoryDomain(Object, Object, ContextInfo)
pipeline and PostMapper.transform(List, List, ContextInfo) pipeline in a single
call. |
<P> Stream<P> |
process(Stream<?> repositoryDomain,
ContextInfo contextInfo)
Execute both the
DomainMapperMember.fromRepositoryDomain(Object, Object, ContextInfo)
pipeline and PostMapper.transform(List, List, ContextInfo) pipeline in a single
call. |
<P,D> void |
transform(List<P> projections,
List<D> entities,
ContextInfo contextInfo)
Perform any required modifications to the list of projections.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
transform
public DefaultDomainMapperManager(List<DomainMapperMember> members, com.broadleafcommerce.common.extension.TypeFactory typeFactory, com.broadleafcommerce.common.extension.data.DataRouteReference reference)
public DefaultDomainMapperManager(List<DomainMapperMember> members, List<PostMapperMember> postMembers, com.broadleafcommerce.common.extension.TypeFactory typeFactory, com.broadleafcommerce.common.extension.data.DataRouteReference reference)
public <D> D fromBusinessDomain(Object businessDomain, Class<D> repositoryDomainType, ContextInfo contextInfo)
DomainMapperManager
DomainMapperMember.fromBusinessDomain(Object, Object, ContextInfo)
.fromBusinessDomain
in interface DomainMapperManager
D
- The repository domain typebusinessDomain
- The business instance containing the relevant property informationrepositoryDomainType
- The class defining the persisted domain type to returncontextInfo
- 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.public <P> P fromRepositoryDomain(Object repositoryDomain, Class<P> businessDomainType, ContextInfo contextInfo)
DomainMapperManager
DomainMapperMember.fromRepositoryDomain(Object, Object, ContextInfo)
.fromRepositoryDomain
in interface DomainMapperManager
P
- The business domain typerepositoryDomain
- The persistence-based domain instance containing the relevant
property informationbusinessDomainType
- The class defining the business domain type to returncontextInfo
- 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.public <P> org.springframework.data.domain.Page<P> process(org.springframework.data.domain.Page<?> repositoryDomain, ContextInfo contextInfo)
DomainMapperManager
DomainMapperMember.fromRepositoryDomain(Object, Object, ContextInfo)
pipeline and PostMapper.transform(List, List, ContextInfo)
pipeline in a single
call.process
in interface DomainMapperManager
P
- The projection typerepositoryDomain
- The originating repository domain instances in the form of a page of
content.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.public <P> List<P> process(List<?> repositoryDomain, ContextInfo contextInfo)
DomainMapperManager
DomainMapperMember.fromRepositoryDomain(Object, Object, ContextInfo)
pipeline and PostMapper.transform(List, List, ContextInfo)
pipeline in a single
call.process
in interface DomainMapperManager
P
- The projection typerepositoryDomain
- The originating repository domain instances in the form of a listcontextInfo
- 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.public <P> Stream<P> process(Stream<?> repositoryDomain, ContextInfo contextInfo)
DomainMapperManager
DomainMapperMember.fromRepositoryDomain(Object, Object, ContextInfo)
pipeline and PostMapper.transform(List, List, ContextInfo)
pipeline in a single
call.process
in interface DomainMapperManager
P
- The projection typerepositoryDomain
- The originating repository domain instances in the form of a streamcontextInfo
- 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.public <P> P process(Object repositoryDomain, ContextInfo contextInfo)
DomainMapperManager
DomainMapperMember.fromRepositoryDomain(Object, Object, ContextInfo)
pipeline and PostMapper.transform(Object, Object, ContextInfo)
pipeline in a
single call.process
in interface DomainMapperManager
P
- The projection typerepositoryDomain
- The originating repository domain instancecontextInfo
- 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.public <P,D> void transform(List<P> projections, @Nullable List<D> entities, @Nullable ContextInfo contextInfo)
PostMapper
transform
in interface PostMapper
P
- The projection typeD
- The repository instance typeprojections
- List of projections to transform.entities
- The original list of repository entities from which the projection list was
derived.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.public <P> P fromRepositoryDomainByExample(Object repositoryDomain, P example, ContextInfo contextInfo)
DomainMapperManager
DomainMapperMember.fromRepositoryDomain(Object, Object, ContextInfo)
.fromRepositoryDomainByExample
in interface DomainMapperManager
P
- The business domain typerepositoryDomain
- The persistence-based domain instance containing the relevant
property informationexample
- The business domain instancecontextInfo
- 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.public <P> P fromRepositoryDomain(BusinessTypeAware repositoryDomain, ContextInfo contextInfo)
DomainMapperManager
DomainMapperMember.fromRepositoryDomain(Object, Object, ContextInfo)
.fromRepositoryDomain
in interface DomainMapperManager
P
- The business domain typerepositoryDomain
- The persistence-based domain instance containing the relevant
property information. This instance can produce the business domain type.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.public <D,P> D modifyMap(D repositoryDomain, P businessDomain, ContextInfo contextInfo, boolean allowNull)
DomainMapper
modifyMap
in interface DomainMapper
D
- The repository domain typeP
- The business domain typerepositoryDomain
- The persistence domain instance to modifybusinessDomain
- The business instance containing changes to map to the repository
domaincontextInfo
- 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.public <D> D deleteMap(D repositoryDomain, ContextInfo contextInfo)
DomainMapper
deleteMap
in interface DomainMapper
D
- The repository domain typerepositoryDomain
- The persistence domain instance to inactivatecontextInfo
- The context information used to make tracking determinations relevant to
sandboxing and multitenant concerns.public <P> Class<P> getBusinessDomainType(Object repositoryDomain)
DomainMapper
getBusinessDomainType
in interface DomainMapper
repositoryDomain
- The persistence domain instance to inspectpublic com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
getTypeFactory
in interface DomainMapperManager
public <P> P convertFromPersistentDomain(Object domain, @Nullable ContextInfo contextInfo)
DomainMapperManager
DomainMapperManager.fromRepositoryDomain(Object, Class, ContextInfo)
, but doesn't require the
caller to know the business domain type. In effect, this call combines the
DomainMapper.getBusinessDomainType(Object)
and
DomainMapperManager.fromRepositoryDomain(Object, Class, ContextInfo)
into a single call.convertFromPersistentDomain
in interface DomainMapperManager
domain
- The repository domain instancecontextInfo
- Optional context information. Useful if the domain param is
Trackable
.Copyright © 2021. All rights reserved.