All Implemented Interfaces:
BusinessDomainMapper<PromptType,PromptTypeDTO>

public class PromptTypeMapper extends AbstractBusinessDomainMapper<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
  • Method Details

    • getInstance

      public static PromptTypeMapper getInstance()
    • get

      public PromptType get(PromptTypeDTO dto)
      Maps a PromptTypeDTO to a PromptType 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 be null
      Returns:
      the mapped PromptType, or null if dto is null
      Implementation Note:
      Cache is refreshed when the DTO's version is newer than the cached BDO's.
    • get

      public PromptTypeDTO get(PromptType bdo)
      Maps a PromptType to its PromptTypeDTO with caching. Reuses the cached DTO if current; otherwise creates a new DTO, reusing the cached ID or allocating one via idSupplier if absent. Refreshes when the BDO's version is newer.
      Parameters:
      bdo - the business object; may be null
      Returns:
      the mapped DTO, or null if bdo is null