Module de.seggebaeing.sqlanalyzer
Class LLMMapper
java.lang.Object
de.seggebaeing.sqlanalyzer.logic.domainmapper.AbstractBusinessDomainMapper<LLM,LLMDTO>
de.seggebaeing.sqlanalyzer.logic.domainmapper.LLMMapper
- All Implemented Interfaces:
BusinessDomainMapper<LLM,
LLMDTO>
Bidirectional mapper between
LLM
and LLMDTO
.
Caches mappings in both directions and refreshes them when the source side has
a newer version
. For DTO→BDO, parses the API enum via
PromptableApi.valueOf(String)
. For BDO→DTO,
allocates an ID via the inherited idSupplier
when no cached DTO exists.
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
Methods inherited from class de.seggebaeing.sqlanalyzer.logic.domainmapper.AbstractBusinessDomainMapper
initialize, putIntoMaps, putIntoMaps
-
Method Details
-
getInstance
-
get
Maps anLLMDTO
to itsLLM
counterpart with caching.Returns the cached BDO if present and up to date; otherwise creates a new
LLM
from the DTO fields (convertingapi
viaPromptableApi.valueOf(String)
), updates the bidirectional cache, and returns it.- Parameters:
dto
- the source DTO; may benull
- Returns:
- the mapped
LLM
, ornull
ifdto
isnull
- Implementation Note:
- The cache is refreshed when the DTO's
version
is newer than the cached BDO'sversion
.
-
get
Maps anLLM
business object to itsLLMDTO
with caching.Returns the cached DTO if present and up to date; otherwise creates a new DTO, reusing the existing ID if cached or allocating one via
idSupplier
if not. The cache is refreshed when the BDO'sversion
is newer than the cached DTO's.- Parameters:
bdo
- the source business object; may benull
- Returns:
- the mapped
LLMDTO
, ornull
ifbdo
isnull
-