Module de.seggebaeing.sqlanalyzer
Class PromptTypeMapper
java.lang.Object
de.seggebaeing.sqlanalyzer.logic.domainmapper.AbstractBusinessDomainMapper<PromptType,PromptTypeDTO>
de.seggebaeing.sqlanalyzer.logic.domainmapper.PromptTypeMapper
- All Implemented Interfaces:
BusinessDomainMapper<PromptType,
PromptTypeDTO>
Bidirectional mapper between
PromptType
and PromptTypeDTO
.
Maintains BDO↔DTO caches and refreshes entries when the source side has a newer version
.
Allocates IDs via an injected supplier for new DTOs. Singleton — access via getInstance()
.
- Since:
- 1.0
- Author:
- Felix Seggebäing
-
Field Summary
Fields inherited from class de.seggebaeing.sqlanalyzer.logic.domainmapper.AbstractBusinessDomainMapper
cacheMapBDOtoDTO, cacheMapDTOtoBDO, idSupplier
-
Method Summary
Modifier and TypeMethodDescriptionget
(PromptType bdo) Maps aPromptType
to itsPromptTypeDTO
with caching.get
(PromptTypeDTO dto) Maps aPromptTypeDTO
to aPromptType
with caching.static PromptTypeMapper
Methods inherited from class de.seggebaeing.sqlanalyzer.logic.domainmapper.AbstractBusinessDomainMapper
initialize, putIntoMaps, putIntoMaps
-
Method Details
-
getInstance
-
get
Maps aPromptTypeDTO
to aPromptType
with caching.Returns the cached BDO if present and current; otherwise creates a new instance from the DTO, updates the bidirectional cache, and returns it.
- Parameters:
dto
- the source DTO; may benull
- Returns:
- the mapped
PromptType
, ornull
ifdto
isnull
- Implementation Note:
- Cache is refreshed when the DTO's
version
is newer than the cached BDO's.
-
get
Maps aPromptType
to itsPromptTypeDTO
with caching. Reuses the cached DTO if current; otherwise creates a new DTO, reusing the cached ID or allocating one viaidSupplier
if absent. Refreshes when the BDO'sversion
is newer.- Parameters:
bdo
- the business object; may benull
- Returns:
- the mapped DTO, or
null
ifbdo
isnull
-